Skip to main content

Tasks API

Tasks represent ongoing conversations or operations between agents. See the A2A Task spec for the full protocol definition.

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
A2A-Version: 1.0
Content-Type: application/json

{
"jsonrpc": "2.0",
"method": "GetTask",
"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
A2A-Version: 1.0
Content-Type: application/json

{
"jsonrpc": "2.0",
"method": "CancelTask",
"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..."}
]
}
]
}