Import-Export

Get the latest import job of a schema

Changed on

Returns the progress of the latest import job for the organization and schema: the running job, whoever started it (it blocks every other import of the schema), otherwise the caller's own last finished job if it finished within the last 24 hours. Used to show the state of an import (or dry run) that was started earlier.

get/v1/entity:import:latest

Request

  • Base URL
    https://entity.sls.epilot.io
  • URL
    https://entity.sls.epilot.io/v1/entity:import:latest
  • Auth
    • HTTP bearer
    • or API key in header x-epilot-org-id

Query parameters

schemastring required

Slug of the schema.

Response

Progress of the latest import job.

jobPollIdstring

The ID of the import job.

trigger_automationsboolean

Whether committed rows of the job trigger automations.

started_bystring

User id of whoever started the job. A finished job is only returned by entity:import:latest to this user, and only this user can commit or discard a dry run.

status'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED'
totalinteger

Number of data rows in the file, once known.

importedEntitiesCountinteger
failedEntitiesCountinteger
importedEntitiesUrlstring
failedEntitiesUrlstring
updated_atstring date-time
failure_reasonstring
failure_code'invalid_csv_bad_headers' | 'dry_run_required' | 'dry_run_mismatch' | 'dry_run_expired' | 'import_file_changed' | 'prescan_missing' | 'import_too_large' | 'token_expired' | 'max_duration_exceeded' | 'no_progress' | 'internal_error'

Machine readable reason of a failed job. failure_reason holds the human text.

  • invalid_csv_bad_headers: the file has neither a _schema nor an _id column
  • dry_run_required, dry_run_mismatch, dry_run_expired: the dry-run rule rejected the commit before any row
  • import_file_changed: the file was replaced after the pre-scan
  • prescan_missing: the job cannot be continued after an update
  • import_too_large: the file has more rows than a single job can report on
  • token_expired: the session that started the job expired before it finished
  • max_duration_exceeded: the job ran longer than allowed
  • no_progress: consecutive runs made no progress
  • internal_error: an unexpected error ended the job
abortableboolean
dry_runboolean
unique_keystring[]
report_urlstring

Download link of the per-row report (CSV, UTF-8 with BOM).

phase'scanning' | 'dry_run' | 'importing' | 'finalizing' | 'done'

What the job is doing now: scanning the file (pre-scan), running the dry_run or importing rows, finalizing the report, or done (every terminal status).

heartbeat_atstring date-time

Refreshed at every phase change and at least every few seconds while the job makes progress (rows or pre-scan). A PROCESSING job whose heartbeat is minutes old may be stuck.

started_atstring date-time

When the job started.

finished_atstring date-time

When the job ended; set on a terminal status.

Changes

    • warning

      added the new dry_run_expired enum value to the response property for the response status

    • warning

      added the new dry_run_mismatch enum value to the response property for the response status

    • warning

      added the new dry_run_required enum value to the response property for the response status

    • warning

      added the new import_file_changed enum value to the response property for the response status

    • warning

      added the new import_too_large enum value to the response property for the response status

    • warning

      added the new internal_error enum value to the response property for the response status

    • warning

      added the new invalid_csv_bad_headers enum value to the response property for the response status

    • warning

      added the new max_duration_exceeded enum value to the response property for the response status

    • warning

      added the new no_progress enum value to the response property for the response status

    • warning

      added the new prescan_missing enum value to the response property for the response status

    • warning

      added the new token_expired enum value to the response property for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      endpoint added