Agents

Approve an agent and mint its authorization code

Called by the console's server after a person signs in and approves, with that member's tenant API key (a widget token is refused, because it lives in browsers). The key's member needs agent:manage (owners and admins), and member_id must belong to the workspace. The approved scopes are a subset of what was requested. The grant is bound to one application_id of the workspace. domains:purchase also needs a spend_cap_cents and a saved card. Persistent access is the default; persist: false ends it after expires_days. The authorization code is single use and is exchanged at POST /oauth/agent/token.

post/agent/consent

Request

  • Base URL: https://api.customdomain.ai/v1
  • URL: https://api.customdomain.ai/v1/agent/consent
  • Auth: HTTP bearer

Request body

requeststring required

The consent request id the browser arrived with (aqr_...).

member_idstring required

The member who approves. It must belong to the workspace.

application_idstring required

The one application of the workspace the agent will act within.

scopesAgentScope[] required

What is approved, a subset of what the agent asked for.

can_purchaseboolean

Ignored. Purchase is allowed exactly when domains:purchase is among the scopes.

spend_cap_centsinteger

The monthly spend cap in US cents. Required, and above 0, with domains:purchase, which also needs a saved card (409 without one).

persistboolean

True (the default) keeps the access until it is revoked. False ends it after expires_days.

expires_daysinteger

With persist: false, days until the grant expires.

Response

The redirect for the agent, with its code

redirect_uristring required

Where to send the person: the agent's redirect URI with code and state added.

codestring required

The single use authorization code. It lives 5 minutes.

statestring
grant_idstring required

Changes

No recorded changes to this operation across all 1 revision of this API.