/v1/postbatches/{id}/importUpload the CSV of a Postbatch
Attaches a completed csv upload (DRAFT or VALIDATED; a previous import is replaced) and starts the parse: encoding and delimiter detection, header checks, the row limit, a sample and a mapping proposal from the template presets or the header names. Pass a mapping to skip the proposal. Poll GET .../import. An Idempotency-Key stays with the import it made for as long as the import exists: the same key with the same upload and mapping answers that import, with another request it is refused (idempotency_key_reused).
postbatches.writeIdempotent with a keyPath parameters
idstringrequiredHeaders
Idempotency-Keystringmax length 255Up to 255 characters, scoped to the organisation and the endpoint, kept for 24 hours: a repeat with the same body replays the stored response with Idempotent-Replayed: true (API-004).
Body
uploadIdstringrequiredmin length 1max length 40mappingobjectReturns
25 fields of the 202 answer
idstringrequiredpostbatchIdstringrequireduploadIdstringrequiredkindenumrequiredAn import is an ingestion of kind postbatch_file
postbatch_filepostflow_batchpostflow_filestatusenumrequiredUPLOADEDPARSINGPARSEDMAPPEDPROCESSINGDONEFAILEDCANCELLEDEXPIREDencodingstring or nullrequireddelimiterstring or nullrequiredheadersarray of stringrequiredsampleRowsarray of objectsrequiredrowCountinteger or nullrequiredmalformedRowsarray of integerrequiredtargetsarray of objectsrequired3 fields
namestringrequiredrequiredbooleanrequiredkindenumrequiredrecipientvariablelistFieldgroupproposedMappingobject or nullrequiredmappingSourcestring or nullrequiredmappingobject or nullrequiredissuesarray of objectsrequired5 fields
codeenumrequiredunknown_targetunknown_columnunmapped_requiredunused_columnempty_expressionseverityenumrequirederrorwarningmessagestringrequiredtargetstringcolumnstringrowCountsobjectrequiredCounts per outcome: total, processed, created, held (valid), invalid (needsAttention), suppressed, duplicates and refused (lines that could not be read)
errorsarray of objectsrequired3 fields
codestringrequiredmessagestringrequiredlineintegererrorRowsinteger or nullrequiredRows in the error file once processed; null before, and after the purge
purgedAtdate-time or nullrequiredWhen the file, its rows and its error file were deleted: 7 days after the Postbatch was approved or cancelled, or when an import untouched for 30 days expired; the counts stay
parsedAtdate-time or nullrequiredstartedAtdate-time or nullrequiredfinishedAtdate-time or nullrequiredcreatedAtdate-timerequiredupdatedAtdate-timerequired