Auth

Exchange WorkOS authorization code

Completes the authorization-code exchange server-side with the WorkOS API key, then returns the desktop token bundle.

post/v1/auth/workos/exchange

Request

  • Base URL: / (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /v1/auth/workos/exchange
  • Auth: none declared

Request body

codestring required

Authorization code returned by WorkOS AuthKit.

codeVerifierstring nullable

PKCE verifier matching the original code challenge. Optional when PKCE was not used.

Example request

{
  "code": "auth_code_123",
  "codeVerifier": "pkce-verifier"
}

Response

WorkOS token bundle.

access_tokenstring required

JWT access token used as Authorization: Bearer for authenticated Solomon AI API calls.

emailstring nullable

Best-known WorkOS primary email for the user.

expires_atinteger required

Unix timestamp in seconds when the access token expires.

refresh_tokenstring nullable

Refresh token for obtaining a new WorkOS access token.

token_type'Bearer' required

Token type.

user_idstring nullable

WorkOS user id when available.

Example response

{
  "access_token": "example-access-token",
  "email": "user@example.com",
  "expires_at": 1790784000,
  "refresh_token": "refresh_token_123",
  "token_type": "Bearer",
  "user_id": "user_01HABCDEF"
}

Changes

No operation changes recorded.