younifyd
Menu

Import Batch

Import Multiple Collections

POST/utils/import

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Import Batch action (under Utilities).
  3. Fill in the fields below, then reference the result from later steps as {{importBatch.response.data}}.

Request

Query parameters

modestring

`add` inserts new items and remaps conflicting primary keys, `merge` upserts items. Defaults to `add`.

One ofaddmerge

dryRunboolean

When true, no data is persisted; the computed id mappings are still returned.

dangerouslyAllowDeleteboolean

Only valid with `mode=merge`. Deletes any existing records in the imported collections whose primary key is absent from the import, mirroring the payload. Destructive.

Request body

Enter the body as JSON in the step's Body field.

filestring (binary)

A JSON file containing an array of `{ collection, items }` objects.

json
{
  "file": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{importBatch.response.data.<field>}}.

dataobject
appliedboolean

Whether the changes were committed. `false` for a dry run.

modestring

One ofaddmerge

collectionsobject

Per-collection summary of the changes made.

json
{
  "data": {
    "applied": false,
    "mode": "add",
    "collections": {}
  }
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Was this page helpful?
Import Batch — Directus — Documentation