Platform API reference

Platform API · Oauth-Authorization-Server

post/v1/oauth/consent/{request_id}Auth

Record the human’s consent decision

Approving mints a single-use authorization code bound to the client, the redirect URI, the PKCE challenge, the chosen workspace and the approved policy. The policy is narrowed against the human's own authority through the same `assertCallerCanGrant` the workspace-role and PAK lanes use; a grant that exceeds the granter is refused, never trimmed. Denying returns a redirect carrying `error=access_denied`. CSRF: the session must be presented as an `Authorization: Bearer` header. The ambient `auth_token` cookie is not accepted on its own, and a request whose `Sec-Fetch-Site` / `Origin` says a browser on another origin is driving it is refused — cookie policy cannot be the only CSRF control on the endpoint that mints a code.

Path parameters

request_id*string · uuid

Id of the request.

Request body

approved*boolean

True to approve, false to deny.

workspace_idstring · uuid

Workspace the grant is scoped to. Required when approving.

policyarray

The policy the human approved. Defaults to the policy the requested presets resolve to. May narrow it, and may add an escalation action a preset withheld — but never beyond the human's own authority: a grant that exceeds the granter is refused with 403 and the response names the refused statements.

productsarray

Products the connection is limited to: the assistant is offered only their tools, plus the workspace basics, and a call to any other product’s tool is refused. Omitted or null means every product. An empty list leaves only the workspace basics.

Example: ["mail","waitlist"]

Response · 200

redirect_to*string

Absolute URL the browser must be sent to. Always the redirect URI captured when the request was created.

Example

Request

POST https://api.platform-auth.productcraft.co/v1/oauth/consent/{request_id}
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "approved": false,
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "policy": [
    {
      "effect": "allow",
      "actions": [
        "social.read",
        "social.list"
      ],
      "resources": [
        "*"
      ]
    }
  ],
  "products": [
    "mail",
    "waitlist"
  ]
}

Response

{
  "redirect_to": "string"
}