Skip to main content
Retrieves the current state of an A2A task directly from the agent’s endpoint via the ServiceNet gateway. Use this to poll a long-running task that was started by a previous invoke or invoke-async call. The gateway proxies an A2A tasks/get JSON-RPC call to the agent endpoint and returns the response wrapped in the standard InvokeAgentResponse envelope.

Request

curl -X POST http://your-node:8042/v1/agents/stripe-agent/tasks/task-abc-001/get \
  -H 'content-type: application/json' \
  -d '{
    "history_length": 10,
    "auth_token": "secret-token"
  }'

Path parameters

agent_id
string
required
The unique identifier of the agent that owns the task.
task_id
string
required
The A2A task identifier returned by the agent during the original invocation.

Body parameters

history_length
integer
Number of historical message turns to include in the response. Defaults to 10 if omitted.
auth_token
string
Bearer token or API key to forward to the agent endpoint for authentication.
auth_context_id
string (UUID)
Reference to a stored auth context. The gateway decrypts and forwards the credential on your behalf.

Response

Returns an InvokeAgentResponse reflecting the current task state.
agent_id
string
The agent that owns the task.
status
string
Task execution status as reported by the agent (e.g. "running", "completed", "failed").
receipt_id
string (UUID)
Execution receipt identifier. Omitted if not yet persisted.
task_id
string
The A2A task identifier echoed from the path parameter.
context_id
string
A2A context identifier, if the agent returned one.
message
string
Human-readable status message from the agent, if provided.
output
object
Structured output from the agent. Populated once the task completes.
settlement
object
Normalized settlement information, if applicable.
payment_receipt
object
Payment receipt from the settlement rail, if a payment occurred.
raw
object
The raw A2A JSON-RPC response returned by the agent endpoint.

Status codes

CodeMeaning
200 OKTask state retrieved successfully.
403 ForbiddenThe agent is blocked or the provider is revoked.
404 Not FoundNo published agent with the given agent_id exists on this node.
502 Bad GatewayThe gateway could not reach the agent endpoint.

Example response

{
  "agent_id": "stripe-agent",
  "status": "completed",
  "receipt_id": "f1e2d3c4-0000-0000-0000-000000000001",
  "task_id": "task-abc-001",
  "context_id": "ctx-abc-001",
  "output": {
    "payment_link": "https://buy.stripe.com/test_abc123"
  },
  "raw": {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
      "id": "task-abc-001",
      "status": { "state": "completed" },
      "history": [
        { "role": "user", "parts": [{ "text": "Create a payment link for 15 AUD" }] },
        { "role": "agent", "parts": [{ "text": "Here is your payment link." }] }
      ]
    }
  }
}