Authorization header. This flow is designed for server-to-server communication — there is no user login involved. Your application exchanges its credentials directly for an access token, which it then presents with each request.
Get Your Credentials
Before you can authenticate, you need a client ID and client secret issued by Lumenaza.Contact Lumenaza support to request your API credentials. You will receive a
client_id and a client_secret tied to your whitelabel customer account. Keep these safe — they grant full access to your API account.Request an Access Token
1
Choose your environment
Lumenaza provides two environments, each with its own token endpoint. Use the test environment during development and the production environment for live traffic.
2
POST to the token endpoint
Send a Replace
POST request with your credentials and the desired scopes in the request body using application/x-www-form-urlencoded encoding.YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with the credentials provided by Lumenaza.3
Parse the token response
A successful request returns a JSON object containing your access token:
Token response
Use the Token in API Requests
Include the access token in theAuthorization header of every API request using the Bearer scheme.
The token value above is truncated for readability. Use the full
access_token string exactly as returned by the token endpoint.Token Expiry and Reuse
Tokens are short-lived. Theexpires_in field in the token response tells you how many seconds the token remains valid.
Best practices for token management:
- Cache and reuse your token for its entire lifetime rather than requesting a new one per API call. This reduces latency and avoids rate-limiting on the token endpoint.
- Track expiry by recording the time you received the token and subtracting a small buffer (e.g. 30 seconds) to account for clock skew. Refresh before that deadline.
- Request a new token when the current one expires. The client credentials flow makes this straightforward — simply repeat the
POSTto the token endpoint.
Scopes
Scopes control what actions your token is permitted to perform. Request only the scopes your integration actually needs.
You can request both scopes in a single token (
scope=read write) or restrict a token to read only for integrations that never need to mutate data.
Common Authentication Errors
403 Forbidden — Insufficient scope
403 Forbidden — Insufficient scope
Cause: Your token was issued with a scope that does not cover the action you are attempting. For example, using a
read-only token to POST a new consumer.Resolution:- Request a new token that includes the
writescope. - Review your integration to ensure you are requesting the appropriate scopes at token creation time.
Example error response
400 Bad Request — Invalid token request
400 Bad Request — Invalid token request
Cause: The token request body is malformed — common causes include a missing
grant_type, incorrect Content-Type header, or invalid client_id/client_secret values.Resolution:- Ensure
Content-Type: application/x-www-form-urlencodedis set on the token request. - Double-check that
grant_type=client_credentialsis included in the body. - Confirm your
client_idandclient_secretare correct and have not been rotated.
Example error response
Test vs. Production Environments
Lumenaza maintains fully isolated environments to keep development activity separate from live data.Credentials issued for the test environment will not work against the production token endpoint, and vice versa. Make sure your application reads the correct credentials and base URL from environment-specific configuration (e.g. environment variables) rather than hardcoding either set.

