Files & Batches
List Batches
List batches in the current Workspace.
Overview
Return the batches created through POST /v1/batches in the current Workspace, newest first. Message Batches are listed by List Message Batches.
Query parameters
limitintegerquerydefault:
20Number of batches to return, from 1 to 100.
afterstringquery
Batch ID cursor: return batches after this one. Use the
last_id of the previous page. Cannot be combined with before.beforestringquery
Batch ID cursor: return batches before this one. Cannot be combined with
after.orderstringquerydefault:
descasc or desc, by creation time.Request
curl -X GET "https://api.tokenlab.sh/v1/batches?limit=20" \
-H "Authorization: Bearer sk-your-api-key"Response
{
"object": "list",
"data": [{ "id": "batch_abc123", "object": "batch", "status": "completed" }],
"first_id": "batch_abc123",
"last_id": "batch_abc123",
"has_more": false
}Important fields
objectstring
Always
list.dataarray
Batches.
statusstring
Status of each batch.
has_moreboolean
More results are available when
has_more is true.Authorization
BearerAuth AuthorizationBearer <token>
API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
In: header
Query Parameters
limit?integer
Number of batches to return. Default 20.
Range
1 <= value <= 100default
20after?string
Batch ID cursor: return batches after this one. Cannot be combined with before.
before?string
Batch ID cursor: return batches before this one. Cannot be combined with after.
order?string
Sort order by creation time.
default
"desc"Value in
- "asc"
- "desc"
Response
application/json
application/json
application/json