Skip to main content

Tasks API

Tasks represent ongoing conversations or operations between agents.

Task States

StateDescription
submittedTask received, pending processing
workingAgent is processing
input-requiredWaiting for user input
completedSuccessfully completed
failedError occurred
canceledCanceled by user
rejectedRejected by agent

Get Task

POST /a2a
Content-Type: application/json

{
"jsonrpc": "2.0",
"method": "tasks/get",
"params": {
"id": "task-123",
"historyLength": 10
},
"id": 1
}

Response:

{
"jsonrpc": "2.0",
"result": {
"id": "task-123",
"contextId": "ctx-456",
"status": {
"state": "completed",
"timestamp": "2026-02-28T12:00:00Z"
},
"messages": [...],
"artifacts": [...]
},
"id": 1
}

Cancel Task

POST /a2a
Content-Type: application/json

{
"jsonrpc": "2.0",
"method": "tasks/cancel",
"params": {
"id": "task-123"
},
"id": 1
}

Artifacts

Tasks can produce artifacts (files, data):

{
"artifacts": [
{
"id": "artifact-1",
"name": "report.pdf",
"mimeType": "application/pdf",
"parts": [
{"kind": "file", "data": "base64..."}
]
}
]
}