Agents

List an agent's connected OAuth clients

Changed on

List the OAuth clients a user has consented to act as this agent.

Each grant gives the client's display name and redirect-URI origin, the granted scopes, the consenting user, its status, created and last-used timestamps, and can_revoke for the caller. Filter by status (active or revoked); results are cursor-paginated. Allowed for the agent's owner or an admin; any other caller gets 404, the same as for an agent that does not exist. Revoke a grant with POST /oauth-grants/{grant_id}:revoke.

get/agents/{agent_id}/oauth-grants

Request

  • Base URL: / (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /agents/{agent_id}/oauth-grants
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL /authorize, token URL /oauth/token)

Path parameters

agent_idstring required

ID of the agent.

Example:agnt_6968b3984d1c238dbe7e2e29

Query parameters

status'active' | 'revoked' nullable

Filter by grant lifecycle state.

Example:active
limitinteger

Maximum number of grants to return (1-200, default 50).

Example:25
cursorstring nullable

Cursor from a previous page's next_cursor; omit for the first page.

Example:eyJ0IjogIjIwMjYtMDEtMTVUMDk6MzA6MDArMDA6MDAiLCAiaWQiOiAiM2YyYjhjMWUtN2Q0YS00ZTliLWE2YzUtMWQyZTNmNGE1YjZjIn0=

Response

Successful Response

has_moreboolean required

Whether more results exist after this page.

next_cursorstring nullable

Cursor for the next page; null when there are no more results.

Example response

{
  "data": [
    {
      "agent_id": "agnt_6968b3984d1c238dbe7e2e29",
      "agent_status": "active",
      "can_revoke": true,
      "client_name": "Cursor",
      "client_origin": "https://client.example.com",
      "created_at": "2026-01-15T09:30:00Z",
      "id": "ocg_6968b3985e21c5fdf643025d",
      "last_used_at": "2026-01-24T08:15:00Z",
      "oauth_client_id": "oc_Xk3vQ9mT2pLw8RzN5bYc1HdF7gJs4AeU",
      "revoked_at": "2026-01-25T16:00:00Z",
      "scopes": [
        "apis:read",
        "capabilities:execute"
      ],
      "status": "revoked",
      "user_id": "usr_6968b3987ee4c3ec0b4ee3b9"
    }
  ],
  "has_more": true,
  "next_cursor": "eyJ0IjogIjIwMjYtMDEtMTVUMDk6MzA6MDArMDA6MDAiLCAiaWQiOiAiM2YyYjhjMWUtN2Q0YS00ZTliLWE2YzUtMWQyZTNmNGE1YjZjIn0="
}

Changes