Skip to content

jobs/create

Create an import job, or a dry run, from an uploaded file or a URL source and a template.

POST/_emdash/api/plugins/fluximporter/jobs/create
Administrator; requires header X-EmDash-Request: 1

The route checks the template against the data and the collection, then saves a job with the status created. It writes no entries itself: drive the job with jobs/next until it finishes. Authentication and the response envelope are described on the jobs page.

Give the data as an uploadId, from the upload route or sources/paste, or as the sourceId of a URL source. With a sourceId the source is fetched first.

application/json

FieldTypeRequiredDefaultDescription
uploadIdstringone of—An uploaded or pasted file, from the upload route or sources/paste. Set exactly one of uploadId and sourceId.
sourceIdstringone of—A saved URL source, fetched first. A real run is skipped when the feed and the template are unchanged since its last import.
forcebooleanoptionalfalseWith sourceId: fetch without the cached validators, and create the job even if nothing changed.
templateobjectone of—How source columns or paths map to fields. Set exactly one of template and templateId. See Template format.
Fields of template (12)
FieldTypeRequiredDefaultDescription
version1required—The template format version. Always 1.
sourceobjectoptional{ "format": "csv" }How to read the data: format (csv, json, jsonl, xml or xlsx), and records, sheet, headerRow or filter where the format uses them.
collectionstringrequired—The slug of the collection to import into.
localestringrequired—The locale the entries are written in.
keyobjectrequired—The value that identifies each record, such as { "from": "sku" }. It matches a record to the entry it created before.
slugobjectoptional—Where each entry's slug comes from.
fieldsobjectrequired—The field mappings, by field slug: where each value comes from and its type. Map at least one field.
taxonomiesobjectoptional—Terms to assign, by taxonomy name.
bylinesobjectoptional—Existing bylines to credit.
publishAtobjectoptional—Each record's publication time. Needs publish: true.
translationOfobjectoptional—The key of the entry each record translates.
rulesobjectoptional—Record rules: write mode, update scope, edit protection, owner and missing entries.
templateIdstringone of—A saved template, read once; the job keeps a copy of it.
templateRevisioninteger · ≥ 1optional—With templateId: refuse with TEMPLATE_CHANGED unless the template is at this revision.
dryRunbooleanrequired—true plans the import and writes no entries.
publishbooleanoptionaltruePublish the entries the job writes; false keeps them as drafts.
batchSizeinteger · 1–500optional50Records per jobs/next call. On Cloudflare Workers a batch can hold fewer.
budgetMsinteger · 500–25,000optional4000Time per jobs/next call, in milliseconds.
journalbooleanoptionaltrueKeep a journal so the job can be rolled back. Dry runs keep none. See Rollback.
origin"wizard"optional—From version 0.9.0: marks a job the admin's wizard started, shown as Wizard on the Jobs tab. Any other value is ignored.
missingfalse | objectoptional—Only for a template with rules.missing. false skips the missing-entries phase for this run; { "maxPercent": 0–100 } replaces its threshold. See Missing entries.

The body can be at most 2 MiB.

Request

Terminal window
curl -X POST "https://example.com/_emdash/api/plugins/fluximporter/jobs/create" \
-H "Authorization: Bearer $EMDASH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"uploadId": "01JDQ7M3X8K4N2P5R6S7T8V9WA3f9c2a7e5b1d4c6a8e0f2b4d6a8c0e1f",
"templateId": "01JDQ6Y2B9C4D7E1F3G5H8J0KM",
"dryRun": true
}'

Response 200

response.json · abridged
{
"success": true,
"data": {
"id": "01JDQ8B5ZK3W9Y7C2M4N6P8R0T",
"status": "created",
"templateId": "01JDQ6Y2B9C4D7E1F3G5H8J0KM",
"templateRevision": 3,
"dryRun": true,
"publish": true,
"batchSize": 50,
"budgetMs": 4000,
"columns": ["sku", "Name", "Price"],
"warnings": [],
"counters": { "created": 0, "updated": 0, "unchanged": 0, "locked": 0,
"conflict": 0, "failed": 0, "filtered": 0 },
"error": null,
"createdAt": "2026-11-27T09:14:02.511Z",
"updatedAt": "2026-11-27T09:14:02.511Z"
}
}

The answer is the whole job row, which also holds the template, the upload ID and the cursor. When a real run from a sourceId finds the feed and the template unchanged since the source’s last import, no job is created and the answer is { "skipped": "unchanged", "sourceId": "…", "uploadId": "…" }. Pass force: true to import anyway.

CodeHTTP statusMeaning
VALIDATION_ERROR400The body doesn't match the schema, or sets both or neither of uploadId and sourceId, or of template and templateId.
INVALID_TEMPLATE400The template is invalid, or doesn't fit the source or the collection. details.problems lists why.
INVALID_OPTIONS400An option is out of range or doesn't fit the template, such as missing without rules.missing.
INVALID_SOURCE400The upload is gone or can't be read as the template's format. details.code has the reader's code.
TEMPLATE_NOT_FOUND404No saved template has this templateId.
TEMPLATE_CHANGED409The saved template isn't at templateRevision. details.revision has the current one.
NOT_FOUND404No URL source has this sourceId.
CREDENTIAL_MISSING409The source's credential no longer exists.
URL_BLOCKED400The source's address can't be fetched from the site.
FETCH_FAILED502The source's address couldn't be reached. HTTP_ERROR, TOO_MANY_REDIRECTS and LENGTH_REQUIRED are 502 too.
TOO_LARGE413The fetched feed, or an XLSX file, is over the size limit.
INVALID_PLUGIN_REQUEST413The request body is over 2 MiB.
All error codes

jobs/create is not an MCP tool. Agents create jobs with fluximporter__dry_run (the jobs/plan route) and fluximporter__start_import (jobs/start), which only take saved templates and always keep a journal. See Agent tools.