/auth/oauth/tokenRedeem Authorization Code
RFC 6749 token endpoint for the operator authorization code with PKCE.
A form-encoded grant_type=authorization_code with code, code_verifier, client_id and redirect_uri returns { access_token, token_type, expires_in }.
- Single use: a second redemption, or two racing, gets
invalid_grant. So does a wrong verifier, client or redirect, a code older than 60 seconds, or a Console session that has ended. The answer never says which. - Lifetime: the token lasts at most 15 minutes and never past its Console session. There is no refresh token:
refresh_tokenisunsupported_grant_type. - What it can do: it acts for the person in the session's organization and project, with their current roles. It can't reach any
/auth/*path or change anything under/me, mint a credential, approve a pending change, decide a gate, grant an access request, or satisfy a step-up challenge. - Revocation: it's checked against its client session on every request, so revoking that session, signing out the Console session or revoking all sessions ends it at once.
- Browsers: a browser call is answered only from the client's own configured origin, without credentials.
Errors use the RFC 6749 §5.2 body { error } with Cache-Control: no-store.
| grant_type * | "authorization_code" | Always |
| code * | string | The code from the redirect. Single use, 60 seconds. Example: "Qm9vb2t3b3JtLWV4YW1wbGUtY29kZS0zMi1ieXRlcy1sb25n" |
| code_verifier * | string | The PKCE verifier whose S256 is the request's Example: "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk" |
| client_id * | string | The configured client's id. Example: "playground" |
| redirect_uri * | string | Exactly the Example: "https://docs.example.com/api-playground/callback" |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | RFC 6749 §5.1 success. No `refresh_token`. | |
| 404 | K9O_NOT_FOUND | This deployment configures no OAuth clients. |
| 429 | K9O_RATE_LIMITED | Too many token requests from this address; wait and try again. |
| access_token * | string | The access token: a JWT for the person, narrowed to this client. Send it as It can't reach |
| token_type * | "Bearer" | Always |
| expires_in * | integer | Seconds until the token expires: at most 900, and never past the Console session it came from. There is no refresh token; sign in again after it. |
curl -X POST 'https://<org>.api-<region>.k9o.io/auth/oauth/token'Showing example in cURL
{
"grant_type": "authorization_code",
"code": "Qm9vb2t3b3JtLWV4YW1wbGUtY29kZS0zMi1ieXRlcy1sb25n",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
"client_id": "playground",
"redirect_uri": "https://docs.example.com/api-playground/callback"
}{
"access_token": "string",
"token_type": "Bearer",
"expires_in": 0
}