Create batch
Phase 1 of 2-phase batch API. Creates a batch record and optionally blocks the parent run for batchTriggerAndWait. After creating a batch, stream items via POST /api/v3/batches/{batchId}/items.
BearerAuthAuthorizationBearer <JWT>application/json- body
runCount*integerExpected number of items in the batch. Must be a positive integer, up to the server's maximum batch size (1,000 by default; self-hosted instances can configure it). Requests above the maximum return a 400.
1 <= valuetaskIdentifiers?array<string>Distinct task identifiers of the items in the batch. Used to authorize tokens scoped to specific tasks. If omitted, only credentials with broad task access are accepted.
1 <= itemsparentRunId?stringParent run ID (friendly ID) for batchTriggerAndWait.
resumeParentOnCompletion?booleanWhether to resume parent on completion. Set to true for batchTriggerAndWait.
idempotencyKey?stringIdempotency key for the batch. If provided and a batch with this key already exists, the existing batch will be returned.
Batch successfully created
application/json- response
id*stringThe batch ID (friendly ID). Use this to stream items via POST /api/v3/batches/{batchId}/items.
runCount*integerThe expected run count.
isCached*booleanWhether this response came from a cached/idempotent batch.
idempotencyKey?stringThe idempotency key if provided.
curl -X POST 'https://api.trigger.dev/api/v3/batches' \ -H 'Content-Type: application/json' \ -d '{ "runCount": 1}'{ "id": "string", "runCount": 0, "isCached": true, "idempotencyKey": "string"}Was this page helpful?
Last updated
Edit on GitHub