auth
[cloud-only] Exchange authorization code or refresh token for a resource-bound access token
[cloud-only] OAuth 2.1 token endpoint (RFC 6749 §3.2). Public clients only — client_secret is rejected.
Two grant types are supported:
- authorization_code — exchanges the code minted by /oauth/authorize (with PKCE verifier) for an access token + first refresh token. Single-use; reuse fails closed.
- refresh_token — rotates the refresh token. Old token immediately invalid; presenting an already-rotated token revokes the entire token family and emits a security metric.
Both grant types re-validate canonical user state, current workspace membership, and the resource's active flag at every mint. A code or refresh token bound to a deactivated resource fails closed.
Errors follow RFC 6749 §5.2. Logs never contain raw codes, refresh tokens, or minted tokens.
Per RFC 6749 §5.1, every 200 and 400 response carries Cache-Control: no-store and Pragma: no-cache so intermediaries cannot cache token-bearing or state-change-reason responses.
post/oauth/token
Response
New token pair