v3
latestOpenAPI 3.1.02026-07-3197486526.1 KBanalyzeAsync > batches
Retrieve batch results
Use this method to retrieve the results for each item in a batch. You can call it while the batch has the pending or processing status.
Each result entry has a status. For details on each status, see the Item statuses section on the The batch object page.
Each result entry includes a task identifier in the task_id field. Use this value with the GET method of the /analyze/tasks/{task_id} endpoint if you need the full analysis task response.
You can retrieve results for 30 days after batch creation.
get/analyze/batches/{batch_id}/results
Path parameters
batch_idstring required
The unique identifier of the batch.
Headers
x-api-keystring required
Your API key.
<Note title="Note"> You can find your API key on the <a href="https://playground.twelvelabs.io/dashboard/api-keys" target="_blank">API Keys</a> page. </Note>Response
The response is a JSON Lines (application/jsonl) stream. Each line is a JSON object containing one result entry for a batch item.
Example body with four result entries:
{"task_id":"68f4ddaf8aaa60d33df0e900","custom_id":"summary-001","status":"ready","data":{"generation_id":"gen_xyz789","data":"This video covers the keynote launch...","finish_reason":"stop","usage":{"output_tokens":150,"input_tokens":45}}}
{"task_id":"68f4ddaf8aaa60d33df0e901","custom_id":"summary-002","status":"failed","error":{"code":"asset_unavailable","message":"The asset could not be read."}}
{"task_id":"68f4ddaf8aaa60d33df0e902","custom_id":"summary-003","status":"processing"}
{"task_id":"68f4ddaf8aaa60d33df0e903","custom_id":"summary-004","status":"queued"}