v1
latestOpenAPI 3.0.32026-07-26172157253.6 KBClient
Exchange OAuth code for tokens (PKCE)
Exchange the insforge_code (received from OAuth callback) for access and refresh tokens.
This endpoint is used for PKCE flow in mobile/desktop/server clients:
- After OAuth callback, your redirect_uri receives insforge_code parameter
- Call this endpoint with the code and your original code_verifier
- Receive access token and refresh token in response
The code_verifier must match the code_challenge sent during OAuth initiation.
post/api/auth/oauth/exchange
Query parameters
client_type'web' | 'mobile' | 'desktop' | 'server'
Client type determines how refresh tokens are returned:
- web: Refresh token stored in httpOnly cookie, csrfToken returned in response
- mobile/desktop/server: refreshToken returned directly in response body
Request body
Example request
{
"code": "abc123...",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
}Response
Tokens exchanged successfully