Tasks API
Tasks represent ongoing conversations or operations between agents.
Task States
| State | Description |
|---|---|
submitted | Task received, pending processing |
working | Agent is processing |
input-required | Waiting for user input |
completed | Successfully completed |
failed | Error occurred |
canceled | Canceled by user |
rejected | Rejected 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..."}
]
}
]
}