POST/v1/postbatches/{id}/approve

Approve a Postbatch

Pins the template version, locks the quote in a price snapshot, checks the balance or the credit for the whole quote and answers 202 with the Postbatch APPROVING; a job then moves every valid item to READY with its reservation for the next planned run or a later planned run of the product group (targetRunId), a thousand at a time, with its progress in `approval` (done of total). The Postbatch becomes APPROVED when every item is released; when the balance runs out halfway it returns to VALIDATED (or PENDING_APPROVAL) with `approval.state` refused, the released items kept, and approving again goes on. Approving an APPROVING Postbatch answers it as it is, or starts a failed approval again. Items that need attention are skipped only with skipInvalid.

Scope postbatches.approve

Path parameters

idstringrequired

Body

targetRunIdstringmin length 1max length 40
skipInvalidbooleandefault false

Returns

21 fields of the 202 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

202Success
401Authentication required or API key invalid
403Permission or scope missing, organisation suspended
404Not found
422Validation failed
429Rate limited for this API key and class; wait Retry-After seconds
otherError (RFC 9457 problem details)