The endpoints
Call it
- Python
- TypeScript
- curl
a2a_call.py
Output
Versions
TheA2A-Version header picks the version, for the card and for every call:
A method name from the other version is unknown (
-32601). SubscribeToTask, ListTasks, push notifications and the extended card are not supported and answer -32004.
Messages, contexts and tasks
- The message’s text parts, joined with newlines, are your agent’s prompt. A file or URL part is refused with
-32005, because agents take text. The message’smetadata, and the request’s, reach your agent asparams. contextIdis your agent’s session. Leave it out on the first message and one is generated and returned; send it back to continue the conversation, and your agent remembers.- Each message creates a task.
SendMessagewaits until the run ends or pauses, and returns the task with the reply as one text artifact namedreply.SendStreamingMessagesends the task first, then aworkingstatus update for each tool call and step, the reply’s text as artifact updates as it arrives, and a final status update. GetTaskreturns a task for seven days after it last changed. A task whose run was lost part way, for example when Onecortex restarted, reads as failed:The run was interrupted. Send the message again.CancelTaskcancels a working or paused task and stops its run. A task that already finished is refused with-32002.
Pauses
A run your agent pauses for a person, as in Human in the loop, leaves the task inTASK_STATE_INPUT_REQUIRED. Its status message carries the question as text and the full interrupts as a data part:
taskId:
- A text part answers a task waiting on one question: the text is the answer.
- A data part holding a
resumeanswers any number, each answer shaped as your agent’s schema asks:
-32004.
The Agent Card
Other agents discover yours by reading its card, without a key. Onecortex builds it from your agent and thecard: block of its agent.yml:
agent.yml
The card says that the agent exists, and its name, description and skills. It never names your organization, repository, framework or region. It changes when a deploy changes
agent.yml. A deleted, suspended or never deployed agent’s card is 404, the same as an agent that does not exist.
The card is also served at https://api.onecortex.io/v1/agents/{agentId}/.well-known/agent-card.json, for clients that resolve the well known path next to the A2A URL rather than under it.
An A2A client can sign in instead of using a key, the same way as an MCP client: it names the agent’s A2A URL as the resource when it asks for a token, the person allows it, and the token calls this one agent.
Errors
Refusals of the call itself keep their HTTP status, with a JSON-RPC error body, so a client can tell a retry from a mistake:
A method’s own error is a
200 with a JSON-RPC error: -32001 for a task that does not exist, or belongs to another organization, and the codes above. A run that fails ends its task in TASK_STATE_FAILED, with the message from Errors.