/{app_slug}/v1/agent-access/authorizations/{handle}/approveAuthApprove an agent authorization
Call it when the user presses Allow, from your backend or your page, with the user's own token. Narrow `scopes` to what the user allowed and store your own `context` (e.g. the workspaces they chose; Auth keeps it opaque and returns it on introspection). Then send the browser to `redirect_to`. Single use: a second decision is 409.
Path parameters
app_slug*stringThe app slug.
handle*stringThe `request` handle.
Request body
scopesarrayThe scopes the user allowed; a subset of the requested ones. Default: all requested.
contextobjectYour data, kept on the grant and returned by introspection (at most 2 KB as JSON), e.g. the workspaces the user chose. Keys round-trip exactly.
Response · 200 Approved; the connection exists.
redirect_to*string · uriSend the browser here: the client's redirect URI with `code` (or `error`), `state` and `iss`.
grant_idstringThe new connection (approve only).
Example: "agr_9xY…"
Example
Request
POST https://api.auth.productcraft.co/{app_slug}/v1/agent-access/authorizations/{handle}/approve
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"scopes": [
"string"
],
"context": {}
}Response
{
"redirect_to": "string",
"grant_id": "agr_9xY…"
}