Skip to content

Grants

Grants authorize a caller to invoke a specific agent.

Create Grant

POST /grant
json
{
  "callerId": "my_app",
  "targetAgentId": "agt_flight_master",
  "type": "session",
  "quota": 10
}
FieldTypeRequiredDescription
callerIdstringYesWho is requesting access
targetAgentIdstringYesAgent to access
typestringYesone_time, session, or persistent
quotanumberNoMax invocations

Response:

json
{
  "status": "created",
  "grant": {
    "id": "grt_abc123",
    "callerId": "my_app",
    "targetAgentId": "agt_flight_master",
    "type": "session",
    "status": "active",
    "quota": 10,
    "used": 0,
    "createdAt": "..."
  }
}

Get Grant

GET /grant/:id

List Grants

GET /grants
GET /grants?callerId=my_app
GET /grants?targetAgentId=agt_flight_master
GET /grants?status=active
GET /grants?page=1&pageSize=20

Revoke Grant

POST /grant/:id/revoke

Grant Statuses

StatusDescription
activeGrant is valid and usable
expiredGrant has passed its expiration time
revokedGrant was manually revoked
exhaustedGrant has used all its quota