Skip to main content

Import API

The routes behind Admin → Import. They need an admin session. The routes that change an import (POST and DELETE) also need the header X-Import-Request: 1, which a form on another site cannot send; without it the answer is 400 INVALID_REQUEST. For the file formats and the workflow see CSV Import.

An import job has an uuid (the name used in every URL), an entity (product, category, customer or customerAddress), a mode (upsert, create or update) and a status:

uploaded → validating → validated → queued → running → completed, or stopped (10 failed rows), interrupted (the worker stopped reporting), failed or canceled.

Errors use the usual JSON error shape with an extra code: INVALID_REQUEST (400), NOT_FOUND (404), WRONG_STATUS (409, the action is not allowed in the job's status), IMPORT_RUNNING (409, an upload for a type whose import is running), IMPORT_ALREADY_RUNNING (409, another import is queued or running), OPEN_JOB_EXISTS (409), FILE_HAS_ERRORS (409), FILE_UNAVAILABLE (409) and FILE_TOO_LARGE (413).

Endpoints​

Upload a file​

Streams a CSV file into a new job and returns it. Send the form fields before the file field: the fields are read while the file arrives. When the whole request has been read and is valid (a field that comes after the file, or a second file, makes it a 400 and changes nothing), the type's unstarted jobs are deleted and replaced is true. Nothing is parsed here: the check starts in the background.

Request Schema (application/json)
Field NameField TypeRequired
entitystring (product, category, customer, customerAddress)Yes
modestring (upsert, create, update)No
checkImagesbooleanNo
filestringYes
POST/api/import-jobs
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/import-jobs
Sample Of Response
{
"data": {
"uuid": "6f1d9a52-0000-4000-8000-000000000001",
"entity": "product",
"mode": "upsert",
"status": "uploaded",
"fileName": "products.csv",
"fileSize": 12345678,
"counts": { "total": 0, "errors": 0, "warnings": 0 },
"createdAt": "2026-10-19T09:00:00.000Z",
"createdBy": { "id": 1, "name": "Jane" },
"replaced": false
}
}

Get a job​

The job's status, stage and counts. This is what the admin page asks every 5 seconds while the job is at work.

Request Schema (application/json)
No request body required
GET/api/import-jobs/{id}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/import-jobs/{id}
Sample Of Response
{
"data": {
"uuid": "6f1d9a52-0000-4000-8000-000000000001",
"entity": "product",
"mode": "upsert",
"status": "running",
"stage": "writing",
"cancelRequested": false,
"fileName": "products.csv",
"fileSize": 12345678,
"fileKept": true,
"options": { "checkImages": false },
"counts": {
"total": 49310, "errors": 0, "warnings": 25,
"createRows": 48310, "updateRows": 1000,
"created": 17400, "updated": 560, "failed": 3, "skipped": 0,
"byCode": { "validate": {}, "import": { "WRITE_FAILED": 3 } }
},
"errorMessage": null,
"createdAt": "2026-10-19T09:00:00.000Z",
"startedAt": "2026-10-19T09:02:00.000Z",
"finishedAt": null,
"waitingSince": null,
"createdBy": { "id": 1, "name": "Jane" }
}
}

List the open jobs​

The unfinished job of each type, and the stopped or interrupted ones. The upload page uses it to show the notices before an upload.

Request Schema (application/json)
No request body required
GET/api/import-open-jobs
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/import-open-jobs
Sample Of Response
{ "data": [ { "uuid": "…", "entity": "category", "status": "validated" } ] }

List the problems of a job​

The problems of the check (before the import started) or of the import (after it), a page at a time. Messages are in the language of the request (the X-Locale header, when it names an enabled language) or else the store's language; a job's errorMessage too. The same goes for the problems written in the file with errors. The problems are stored as a sentence and its values, so changing the store's language changes how an old import reads.

Request Schema (application/json)
Field NameField TypeRequired
phasestring (validate, import)No
severitystring (error, warning)No
codestringNo
columnstringNo
pageintegerNo
limitintegerNo
GET/api/import-jobs/{id}/issues
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/import-jobs/{id}/issues
Sample Of Response
{
"data": {
"phase": "validate",
"page": 1,
"limit": 50,
"total": 2,
"byCode": { "INVALID_VALUE": 1, "REFERENCE_NOT_FOUND": 1 },
"truncated": false,
"items": [
{ "row": 2, "key": null, "column": "url_key", "code": "INVALID_VALUE", "severity": "error",
"params": {}, "message": "The value in column "url_key" must use only lowercase letters, digits and single hyphens…", "value": "bad key!" }
]
}
}

Download the file with errors​

Every row of the uploaded file plus an _errors column. A job that ended with no failed or skipped rows keeps no file, and the answer is 409 FILE_UNAVAILABLE.

Request Schema (application/json)
No request body required
GET/api/import-jobs/{id}/file-with-errors.csv
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/import-jobs/{id}/file-with-errors.csv
Sample Of Response
url_key,name,parent,status,position,_errors
bad key!,Bad key,,1,1,"url_key: The value in column ""url_key"" must use only lowercase letters…"

Download a template​

The template of a type: the header row and two example rows, built for this store (it has a column for each attribute and custom field). {entity} is products, categories, customers or customer-addresses.

Request Schema (application/json)
No request body required
GET/api/import-templates/{entity}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/import-templates/{entity}
Sample Of Response
url_key,name,parent,status,position,description,meta_title,meta_description,image
example-category,Example category,,1,1,Describe the category here.,Example category,A few words for search engines.,https://example.com/images/example-category.jpg

Start an import​

Moves a checked job without errors to queued. A worker picks it up, checks the file once more, and writes. 409 FILE_HAS_ERRORS if the check found errors; 409 IMPORT_ALREADY_RUNNING if another import is queued or running.

Request Schema (application/json)
No request body required
POST/api/import-jobs/{id}/start
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/import-jobs/{id}/start
Sample Of Response
{ "data": { "uuid": "…", "status": "queued" } }

Cancel​

Asks the worker to stop between two rows; a queued job that no worker has claimed is canceled at once. The rows already written stay.

Request Schema (application/json)
No request body required
POST/api/import-jobs/{id}/cancel
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/import-jobs/{id}/cancel
Sample Of Response
{ "data": { "uuid": "…", "status": "running", "cancelRequested": true, "cancel": "requested" } }

Resume​

Continues a stopped or interrupted job: the failed rows are tried again and the import goes on after the last saved row. 409 OPEN_JOB_EXISTS if the type has another unfinished job.

Request Schema (application/json)
No request body required
POST/api/import-jobs/{id}/resume
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/import-jobs/{id}/resume
Sample Of Response
{ "data": { "uuid": "…", "status": "queued" } }

Check again​

Runs the check again on the stored file of a checked job, for example after you created a record the file refers to.

Request Schema (application/json)
No request body required
POST/api/import-jobs/{id}/recheck
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/import-jobs/{id}/recheck
Sample Of Response
{ "data": { "uuid": "…", "status": "uploaded" } }

Delete a job​

Deletes the job, its file and its problems. 409 WRONG_STATUS for a job that is at work (uploading, validating, queued or running). The rows already imported stay in the store.

Request Schema (application/json)
No request body required
DELETE/api/import-jobs/{id}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/import-jobs/{id}
Sample Of Response
{ "data": { "uuid": "…", "status": "completed" } }

GraphQL​

The list of past imports in the admin is the query importJobs(filters), and the largest accepted file is importLimits { maxFileBytes }. Filters: status, entity, file (part of the file name), ob and od (order by created_at, entity, status, file_name or file_size), page and limit.