Agent Tasks Endpoint Reference
Reference for 1 Agent Tasks endpoint of the Talonic API: parameters, request body, curl and Node.js examples, response and errors.
Pull worklist for external AI agents at Agent (via MCP) stages. Tasks use leased claims and declared-field result submission.
Every request needs an API key in the Authorization: Bearer header. Examples read the key from the TALONIC_API_KEY environment variable.
POST
/v1/agent-tasks/claim-nextRequest body (application/json)
pipeline_id*string (uuid)
countinteger Default:
10curl
curl -X POST 'https://api.talonic.com/v1/agent-tasks/claim-next' \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pipeline_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"count": 10
}'Node.js (18+)
const res = await fetch("https://api.talonic.com/v1/agent-tasks/claim-next", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"pipeline_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"count": 10
}),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();Response 200 — The claimed tasks (full payloads) and how many were claimed.
{
"data": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"pipeline_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"grain": "document",
"pipeline_document_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"document_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"record_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"stage_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"phase_index": 1,
"status": "available",
"execution_epoch": 1,
"claimed_at": "2026-01-15T09:30:00Z",
"lease_expires_at": "2026-01-15T09:30:00Z",
"timeout_at": "2026-01-15T09:30:00Z"
}
],
"claimed": 1
}- 400 — The request is invalid.
- 401 — Missing or invalid API key.
- 429 — Daily rate limit exceeded.