Skip to main content

Failure download endpoints

ResourceCSVJSON
TransactionsGET /batch-import/transaction-jobs/{jobId}/failures.csvGET …/failures
User eventsGET /batch-import/user-event-jobs/{jobId}/failures.csvGET …/failures
EntitiesGET /batch-import/entity-jobs/{jobId}/failures.csvGET …/failures
Legacy entity CSV alias: GET /entities/automatic/bulk/imports/{jobId}/failures.csv.
  • …/failures.csv β†’ CSV file download (Content-Type: text/csv)
  • …/failures β†’ JSON body (Content-Type: application/json)

Overview

Batch imports expose failures at three layers:
LayerWhenWhere to read
Pre-jobRequest rejected before jobId is returned (400)HTTP response body (error.code)
Job-levelWhole job aborted (status: failed)Unified history β†’ workerError, metadata.apiError; JSON failures β†’ jobFailure
Row-levelSome rows failed (failed > 0, job may still be completed)Failures CSV/JSON per kind
Row-level failures always include a stable code (machine-readable) and message (human detail). Legacy jobs may only have free-text error; the API normalizes them on read.

Entity row outcomes (created / skipped / failed)

OutcomeIn failures.csv?Where
createdNoJob succeeded
skipped_existingNo β€” not a failureJob skipped / skippedExisting, full report CSV, JSON skips[]
failedYesfailures.csv, JSON failures[]

Duplicate taxId (entities)

Bulk manual default uses duplicateTaxIdPolicy: skip_existing:
  • Same taxId + same type already in org β†’ skipped_existing, skip code SKIPPED_DUPLICATE_TAX_ID
  • Does not appear in failures.csv
Bulk automatic: existing main entity β†’ skipped_existing, SKIPPED_ENTITY_ALREADY_EXISTS Hard failures:
SituationFailure code
Same taxId, different type (person vs company)TAX_ID_TYPE_MISMATCH
Same taxId + type with error policy (unit API; not bulk default)DUPLICATE_TAX_ID
Duplicate externalIdDUPLICATE_EXTERNAL_ID

Row-level failure codes (BATCH_IMPORT_ITEM_FAILURE_CODES)

CodeMeaning
VALIDATION_ERRORRow failed Zod / schema validation before persistence.
PROCESSING_ERRORUnexpected error while processing the row.
ENTITY_NOT_FOUNDReferenced entity does not exist in the organization.
INVALID_RISK_MATRIXRisk matrix id invalid or not in org.
CREATION_QUOTA_EXCEEDEDOrganization creation quota exceeded.
DATABASE_INSERT_ERRORDatabase rejected insert (unclassified).
DUPLICATE_EXTERNAL_IDEntity or transaction with same externalId already exists.
DUPLICATE_TAX_IDSame taxId + type already exists (hard error path).
TAX_ID_TYPE_MISMATCHtaxId registered under a different entity type.
CONSTRAINT_VIOLATIONOther DB constraint (FK, check, unique index).
MISSING_COUNTRYEntity row missing valid ISO2 country.
INVALID_COUNTRYCountry not allowed for import mode (e.g. automatic β‰  AR/BR/CL).
ENRICHMENT_FAILEDEnrichment provider failed for entity row.
CREATION_FAILEDEntity could not be created for the row.

Skip reason codes (BATCH_IMPORT_SKIP_REASON_CODES)

Not failures β€” used when outcome=skipped_existing:
CodeMeaning
SKIPPED_DUPLICATE_TAX_IDManual bulk skipped row: duplicate taxId + type
SKIPPED_ENTITY_ALREADY_EXISTSAutomatic bulk skipped row: entity already existed
Risk matrix / business rules: rule execution runs after the row is created. Rule outcomes do not appear in failures.csv / JSON failures[] and do not roll back the row. Use alerts, risk score, and audit timelines for rule results.

Job-level codes (BATCH_IMPORT_JOB_FAILURE_CODES)

CodeMeaning
INVALID_ENTITY_REFERENCESTransaction batch: validateExistingEntity=true and unresolved origin/destination refs β€” no rows created.
TOO_MANY_ITEMSFile exceeds plan row limit.
CSV_PARSE_ERRORCSV could not be parsed or mapped.
MAPPING_VALIDATION_ERRORSaved mapping or validate-csv preflight failed.
MISSING_REQUIRED_FIELDRequired multipart / row field missing before queue.
COOPERATIVE_CANCELJob cancelled while processing.
WORKER_ERRORUnhandled worker error.

Scenario matrix (client FAQ)

ScenarioIn row failures?Typical code / location
Missing CSV column (pre-parse)No400 before job
Invalid entity ref (txn batch, default validation)NoJob INVALID_ENTITY_REFERENCES
Duplicate txn externalId with skipDuplicates=trueNoCounted as skipped
Duplicate entity externalId (manual import)YesDUPLICATE_EXTERNAL_ID
Duplicate entity taxId (same type, bulk default)Noskipped_existing β†’ SKIPPED_DUPLICATE_TAX_ID in skips[]
Duplicate entity taxId (type mismatch)YesTAX_ID_TYPE_MISMATCH
Enrichment failure (entity automatic)YesENRICHMENT_FAILED
User event invalid fieldYesVALIDATION_ERROR
Rules / matrix evaluation errorNoRow still created

Reproducible test scenarios

User events (simplest row failures): valid CSV + mapping; one row with empty required field β†’ GET …/user-event-jobs/{jobId}/failures. Entities (manual): create entity with external_id=X, import another row with same external_id β†’ DUPLICATE_EXTERNAL_ID. Transactions (job-level): validateExistingEntity=true + originExternalId=DOES_NOT_EXIST β†’ job failed, jobFailure.code=INVALID_ENTITY_REFERENCES. Transactions (row-level): batchErrorHandling=continue_collect_errors + mix valid rows with DB constraint violations β†’ row entries in failures endpoint.

Limits

  • Max 500 row failures persisted per transaction batch job (CSV + JSON may truncate; JSON exposes truncated + failuresTotal).
See also: Bulk imports overview.