Skip to content

Invoke

The invoke endpoint calls an agent through its native protocol.

Invoke Agent

POST /invoke
json
{
  "callerId": "my_app",
  "targetAgentId": "agt_flight_master",
  "grantId": "grt_abc123",
  "capability": "search_flights",
  "payload": {
    "from": "SFO",
    "to": "NRT",
    "date": "2026-05-01"
  }
}
FieldTypeRequiredDescription
callerIdstringYesCaller identifier
targetAgentIdstringYesAgent to invoke
grantIdstringYesValid grant ID
capabilitystringNoSpecific capability to invoke
payloadobjectYesRequest data for the agent

Response:

json
{
  "ok": true,
  "invoke": {
    "id": "inv_abc123",
    "status": "completed"
  },
  "receipt": {
    "id": "rct_abc123",
    "success": true,
    "result": { ... },
    "durationMs": 145
  }
}

Get Invocation

GET /invoke/:id

List Invocations

GET /invocations
GET /invocations?callerId=my_app
GET /invocations?targetAgentId=agt_flight_master
GET /invocations?page=1&pageSize=20

Error Cases

StatusCause
400Missing required fields
403Grant invalid, exhausted, or revoked
404Agent not found