Start an import
/api/importsThe body is the file: a JSON array of records, or one record per line. Send it as the body with Content-Type application/json and the source as a query parameter, or as a multipart form with a file part and a source field. At most 64 MB. The import runs in the background; ask GET /api/imports/{id} how it is going. dryRun=true reads and counts without writing anything. dedup=false writes every record even when Modbot already has the event from somewhere else; it does not turn off the check that stops the same file being imported twice, which always runs. seenBy is the source every record is filed under unless the record sets its own: one of AuditLog, SyncDiff, Companion, Discord, Manual or Modbot, and Manual when nothing says otherwise. The format is documented at docs.modbot.co/self-hosting/importing-old-data.
Needs the ImportOldData permission.
An API key, made on Settings, API keys. Every key starts with mbk_.
In: header
Query Parameters
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/api/imports"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "source": "string", "fileName": null, "dryRun": true, "dedup": true, "seenBy": "AuditLog", "status": "Queued", "received": 0, "imported": 0, "skipped": 0, "alreadyKnown": 0, "rejected": 0, "rejections": [ { "line": 0, "reason": "string" } ], "error": null, "startedBy": "string", "createdAt": "2019-08-24T14:15:22Z", "startedAt": null, "finishedAt": null}