Overview
The Reelevant API uses OAuth 2.0 for authentication. Three grant types are supported:
All token operations use the endpoint
POST https://api.reelevant.com/v2/auth/token.
A client_id is required for every grant. Contact [email protected] to obtain one.
Authorization Code Flow (PKCE)
This is the recommended flow for web applications. It uses a browser redirect to authenticate the user, then exchanges an authorization code for tokens.Step 1: Generate PKCE Challenge
Generate a randomcode_verifier and derive the code_challenge:
Step 2: Redirect to Authorize
Redirect the user’s browser to the authorization endpoint:
The user sees a login page. After successful authentication, a consent screen is shown. Upon approval, the browser is redirected to your
redirect_uri with an authorization code:
Step 3: Exchange Code for Tokens
code_verifier must match the code_challenge sent in Step 2 (the server verifies SHA256(code_verifier) == code_challenge).
Response:
Some OAuth clients are configured with
requireAuthorizationCodeFlow: true. For these clients, PKCE parameters are mandatory — the implicit flow is disabled entirely.Password Grant
For service accounts and automation scripts where browser-based login is not practical.Two-Factor Authentication (OTP)
If the user has OTP enabled, include thex-otp-code field:
Refresh Token Grant
Exchange a valid refresh token for a new access token without re-authenticating:Using Access Tokens
Include the access token in every API request via theAuthorization header:
Token Lifecycle
Refresh tokens use a rolling expiry: the 30-day window resets each time you use the refresh token. If you refresh at least once a month, the token never expires.