Skip to main content
POST
/
api
/
v3
/
batches
/
{batchId}
/
items
Stream batch items (Phase 2)
curl --request POST \
  --url https://api.trigger.dev/api/v3/batches/{batchId}/items \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/x-ndjson' \
  --data '"<string>"'
{
  "id": "<string>",
  "itemsAccepted": 123,
  "itemsDeduplicated": 123,
  "sealed": true,
  "enqueuedCount": 123,
  "expectedCount": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

batchId
string
required

The batch ID returned from POST /api/v3/batches

Body

NDJSON (newline-delimited JSON) stream where each line is a BatchItemNDJSON object. Example: {"index":0,"task":"my-task","payload":{"key":"value1"}} {"index":1,"task":"my-task","payload":{"key":"value2"}}

Response

Items successfully processed

id
string
required

The batch ID.

itemsAccepted
integer
required

Number of items successfully accepted.

itemsDeduplicated
integer
required

Number of items that were deduplicated (already enqueued).

sealed
boolean
required

Whether the batch was sealed and is ready for processing. If false, the batch needs more items before processing can start. Clients should check this field and retry with missing items if needed.

enqueuedCount
integer

Total items currently enqueued. Only present when sealed=false to help with retries.

expectedCount
integer

Expected total item count. Only present when sealed=false to help with retries.