v3

latestOpenAPI 3.1.02026-07-3197486526.1 KB
analyzeAsync > 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"}
task_idstring required

The unique task identifier generated by the platform for this item.

custom_idstring nullable required

The custom identifier you provided when you created the batch. If you did not provide one, this field is null.

status'queued' | 'processing' | 'ready' | 'failed' | 'canceled' required

The status of a result entry. This field is different from the batch status. For the meaning of each value, see the Item statuses section on the The batch object page.