POST/v1/postbatches

Create a Postbatch

A Postbatch starts in DRAFT with a published template version, the finish and the destination; the product follows from the template. Upload the CSV next.

Scope postbatches.writeIdempotent with a key

Headers

Idempotency-Keystringmax length 255

Up 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

namestringrequiredmin length 2max length 120
campaignIdstringmin length 1max length 80
advertisingCategorystring or null
templateVersionIdstringrequiredmin length 1max length 40
finishstringrequiredmin length 1max length 40
postKindenum
ADVERTISING_CUSTOMERSADVERTISING_NON_CUSTOMERSNO_ADVERTISING
destinationstringrequiredmin length 2max length 2

Returns

21 fields of the 201 answer
idstringrequired
namestringrequired
campaignIdstring or nullrequired
advertisingCategorystring or nullrequired
statusenumrequired
DRAFTIMPORTINGVALIDATEDPENDING_APPROVALAPPROVINGAPPROVEDSCHEDULED_FOR_RUNIN_PRODUCTIONCOMPLETEDCANCELLED
templateIdstringrequired
templateVersionIdstringrequired
productobjectrequired
4 fields
idstringrequired
specificationIdstringrequired
finishstringrequired
destinationstringrequired
postKindenumrequired
ADVERTISING_CUSTOMERSADVERTISING_NON_CUSTOMERSNO_ADVERTISING
countsobjectrequired
importIdstring or nullrequired
approvedAtdate-time or nullrequired
targetRunIdstring or nullrequired
priceSnapshotIdstring or nullrequired
itemCountAtApprovalinteger or nullrequired
approvalobject or nullrequired
9 fields
stateenumrequired
workingfailedrefuseddone
doneintegerrequired
totalintegerrequired
skippedintegerrequired
runsarray of stringrequired
codestring or nullrequired
errorstring or nullrequired
startedAtdate-timerequired
finishedAtdate-time or nullrequired
bulkActionobject or nullrequired
7 fields
kindenumrequired
cancelskip_attention
stateenumrequired
workingfaileddone
doneintegerrequired
totalintegerrequired
errorstring or nullrequired
startedAtdate-timerequired
finishedAtdate-time or nullrequired
cancelledAtdate-time or nullrequired
completedAtdate-time or nullrequired
createdAtdate-timerequired
updatedAtdate-timerequired

Responses

201Success
401Authentication required or API key invalid
403Permission or scope missing, organisation suspended
409A request with this Idempotency-Key is still in progress (idempotency_in_progress)
422Validation failed
429Rate limited for this API key and class; wait Retry-After seconds
otherError (RFC 9457 problem details)