okaeDocs
APIExperimental

API reference · v1

Exchange the authorisation code

POST
/api/v1/auth/token

A native client exchanges a single-use, five-minute code bound to its PKCE challenge, callback URI, owner and workspace. Store the credential securely and send it as Authorization: Bearer <token> on API requests.

Request Body

application/x-www-form-urlencoded

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/auth/token" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'grant_type=authorization_code&code=%3Cauthorisation-code%3E&redirect_uri=http%3A%2F%2Fexample.com&code_verifier=%3CPKCE-verifier%3E'
{  "access_token": "<store-in-keychain>",  "token_type": "Bearer",  "expires_in": 604800,  "workspace_id": "befd47ea-81e8-4413-9684-54493256f63c"}