Overview
The Reelevant API uses OAuth 2.0 for authentication. Four 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. For client_credentials, HTTP Basic can supply it instead of the request body. 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:Client Credentials Grant (Service Accounts)
REELEVANT_CLIENT_ID and REELEVANT_CLIENT_SECRET in the integration environment. Keep the secret outside source control. This example caches the access token in memory and requests another one 60 seconds before expiry.
A service account and its client secret are created by an admin; see the service account guide.
Send grant_type=client_credentials, client_id, and client_secret as JSON or application/x-www-form-urlencoded. You can instead send the credentials in an HTTP Basic header:
Response:
refresh_token. Access tokens expire after one hour; request another token with the client credentials when needed. Successful responses include Cache-Control: no-store and Pragma: no-cache.
Up to two client secrets can be active at once, allowing rotation. Revoking a secret also revokes access tokens issued with that secret. Disabling the service account immediately blocks new grants and invalidates its existing access tokens.
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.
Revoking Tokens
Revoke an access token or refresh token:SCIM Provisioning
Inbound provisioning uses company-scoped bearer tokens instead of OAuth user tokens. See SCIM 2.0 provisioning.SSO Authentication
Companies with SSO configured are automatically redirected to their identity provider during the OAuth authorize flow. If SSO is mandatory for the company, password-based login is disabled (except for service accounts).Error Handling
A disabled service account returns
UserDisabled.
Related
Service accounts
Create service accounts and manage their client secrets.
Authentication & SSO
Review platform authentication options and integration patterns.