GET /api/v1/forward/batches/{batch_id}/tasks
Lists the status, result summary, error, artifacts, and usage for tasks in a Batch with pagination. You can call this endpoint while the Batch is in any state. It returns tasks only for a Batch owned by the current PAT user.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batch_id | string | Yes | Batch ID. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
status | string | No | - | Filter by task status: pending, running, completed, failed, cancelled, or expired. |
custom_id | string | No | - | Exact-match filter for the caller-defined task identifier. Only one value is supported. Returns an empty list when no match is found. |
limit | integer | No | 20 | Page size. Maximum: 100. |
after_id | string | No | - | Cursor for the next page. Pass the previous response's last_id. The cursor must belong to the current Batch. |
Example request
Example response
HTTP 200 OK
Response fields
| Field | Type | Description |
|---|---|---|
object | string | Always list. |
data | array | Batch Task objects on the current page. |
data[].custom_id | string | Caller-defined task identifier and the public pagination cursor in the current version. |
data[].status | string | Task status, using the same definitions as Batch request_counts. |
data[].started_at | string | Start time of the final persisted execution attempt, in RFC 3339 UTC. Omitted if the task has not started. |
data[].completed_at | string | Task completion time, in RFC 3339 UTC. Omitted if the task is not complete. |
data[].output_summary | string | Final response text, up to 500 Unicode characters. Omitted when there is no result. |
data[].error | object | Returned only for failed tasks. Contains code and message. |
data[].artifacts | array | Delivered artifacts. Returns an empty array when there are none. |
data[].usage | object | Usage for the final or current CAS Session. Omitted if CAS has not returned valid usage. |
data[].usage.total_credits | number | Cumulative CAS Session Credit usage. It is not a token count or currency amount. Explicit zero values are preserved. |
first_id | string | custom_id of the first task on the current page. |
last_id | string | custom_id of the last task on the current page. |
has_more | boolean | Whether more tasks are available. |
usage represents only the final or current Session and does not accumulate usage from replaced historical Sessions.
Error codes
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request | status, limit, or after_id is invalid. |
| 404 | not_found_error | batch_not_found | Batch does not exist, belongs to another user, or its result files have completed the 30-day cleanup. |
| 401 | authentication_error | authentication_required | PAT or SAT is invalid or expired. |
Notes
- When
has_more=true, passlast_idunchanged asafter_idin the next request. - Artifact downloads reuse the Files API. There is no Batch-specific artifact download endpoint.