Skip to main content
POST
/
headless
/
imports
Create a new headless import
curl --request POST \
  --url https://app.dromo.io/api/v1/headless/imports/ \
  --header 'Content-Type: application/json' \
  --header 'X-Dromo-License-Key: <api-key>' \
  --data '
{
  "fields": [
    {
      "key": "first_name",
      "type": "string",
      "label": "First Name",
      "validators": []
    },
    {
      "key": "last_name",
      "type": "string",
      "label": "Last Name",
      "validators": []
    }
  ],
  "initial_data": [
    {
      "first_name": "Zeph",
      "last_name": "paul.zeph@gmail.com"
    }
  ],
  "hooks": {
    "rowHooks": [
      "(record, mode) => { return { row: { first_name: { value: \"Updated from row hook\" } } }; }"
    ]
  }
}
'
{
  "id": "94187d21-9820-420f-b08c-a80cbbf52604",
  "schema_id": "94187d21-9820-420f-b08c-a80cbbf52604",
  "status": "AWAITING_UPLOAD",
  "original_filename": "user_data.csv",
  "created_date": "2023-11-07T05:31:56Z",
  "modified_date": "2023-11-07T05:31:56Z",
  "upload": "https://dromo-headless-imports-prod.s3.us-west-2.amazonaws.com/test-key-123?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20230227%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20230227T160315Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Signature=example1234567890abcdef1234567890abcdef1234567890abcdef12345678",
  "review_url": "https://app.dromo.io/headless/94187d21-9820-420f-b08c-a80cbbf52604/",
  "result_metadata": null,
  "import_errors": null
}

Authorizations

X-Dromo-License-Key
string
header
required

This backend API key is different than your frontend license key. Please use the "Backend" license key from your Dromo Dashboard.

Body

application/json
schema_id
string

ID of a saved schema. Mutually exclusive with fields — provide schema_id or fields, not both. When provided alongside settings or hooks, those values are merged on top of the saved schema for this import only.

Example:

"94187d21-9820-420f-b08c-a80cbbf52604"

fields
object[]

Inline schema field definitions. Required when schema_id is omitted; mutually exclusive with schema_id. Accepts the same field definitions as a saved schema.

Example:
[
{
"key": "first_name",
"type": "string",
"label": "First Name",
"validators": []
},
{
"key": "last_name",
"type": "string",
"label": "Last Name",
"validators": []
}
]
settings
object

Import settings. When used with schema_id, merged on top of the saved schema (provided keys overwrite; omitted keys are unchanged). When used without schema_id, defines settings for the inline schema.

Example:
{
"importIdentifier": "contacts-import",
"invalidDataBehavior": "BLOCK_SUBMIT"
}
hooks
object

Import hooks. When used with schema_id, merged on top of the saved schema. When used without schema_id, defines hooks for the inline schema.

Example:
{
"rowHooks": [
"(record, mode) => { return { row: { first_name: { value: \"Updated from row hook\" } } }; }"
]
}
original_filename
string | null

Name of the file being imported (exclude if using initial_data)

Example:

"user.csv"

initial_data
any[] | null

Complete JSON data to be imported, max size 15MB (exclude if using a file)

Example:
[
{
"first_name": "Zeph",
"last_name": "paul.zeph@gmail.com"
}
]
import_metadata
object
Example:
{
"user": {
"id": "jeff_id",
"name": "Jeff",
"email": "jeff@dromo.io",
"companyName": "Dromo",
"companyId": "dromo_id"
}
}

Response

Import successfully initialized

id
string
read-only
Example:

"94187d21-9820-420f-b08c-a80cbbf52604"

schema_id
string
Example:

"94187d21-9820-420f-b08c-a80cbbf52604"

status
enum<string>
read-only
Available options:
AWAITING_UPLOAD,
RUNNING,
SUCCESSFUL,
FAILED,
NEEDS_REVIEW
Example:

"AWAITING_UPLOAD"

original_filename
string
Example:

"user_data.csv"

created_date
string<date-time>
read-only
modified_date
string<date-time>
read-only
upload
string
read-only
Example:

"https://dromo-headless-imports-prod.s3.us-west-2.amazonaws.com/test-key-123?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20230227%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20230227T160315Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Signature=example1234567890abcdef1234567890abcdef1234567890abcdef12345678"

review_url
string
read-only
Example:

"https://app.dromo.io/headless/94187d21-9820-420f-b08c-a80cbbf52604/"

result_metadata
object
Example:

null

import_errors
object[] | null
Example:

null