Authentication Using Client CredentialsCompliancely now supports Client ID and Client Secret authentication as an alternative to account username and password for generating API access and refresh tokens.
We recommend using client credentials for API integrations, as they provide authentication independent of your Compliancely account login credentials. This helps prevent integration disruptions when account passwords or email addresses change.
Authenticates a user using a valid Client ID and Client Secret, and returns a pair of tokens: an access token and a refresh token.
Refer to the Authentication Guide for the recommended process.
This API allows you to create or retrieve an access token and refresh token using your Client ID and Client Secret. The access_token provided must be included in the Authorization header as a Bearer for all subsequent API requests, as shown below
--header 'Authorization: Bearer {{access_token}}'Request & Response Format
curl --location '{{base_url}}/api/v2/token/' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_id": "<client_id>",
"client_secret": "<client_secret>"
}'curl --location '{{base_url}}/api/v2/token/' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "<username>",
"password": "<password>"
}'{
"access": "<access_token>",
"access_expiry_seconds": <expires_in_seconds>,
"refresh": "<refresh_token>",
"refresh_expiry_seconds": <expires_in_seconds>
}Both authentication methods use the same API endpoint.
Generate Client Credentials
To generate your credentials:
- Log in to the Compliancely portal.
- Navigate to the Developer section.
- Generate your Client ID and Client Secret.
Securely store the credentials and use them to authenticate through the existing Token API.
Compatibility with Existing Integrations
To simplify the transition to client credentials, Compliancely currently provides a temporary compatibility option for integrations using the existing username and password request fields.
You can supply your Client ID and Client Secret through these fields without modifying your existing request structure:
{
"username": "<client_id>",
"password": "<client_secret>"
}This allows existing integrations to adopt client credentials with minimal development effort.
Important: This is a transitional compatibility option and may be discontinued in a future release. We recommend updating your integration to use the dedicated client_id and client_secret fields for long-term compatibility.
Security Note: Keep your Client Secret secure and do not expose it in frontend applications or client-side code.
Validity
The access_token is valid for 1 hour. After it expires, you can use the Access Token by Refresh Token endpoint to obtain a new access_token.
The refresh_token remains valid for 24 hours.
Recommendation: Use the refresh token after the access_token expires to enhance overall security.
Throttling
This API enforces throttling, allowing a maximum of 10 requests per minute (RPM). If you exceed this limit, the following error will be returned, and you will need to wait 10 minutes before retrying.
{
"detail": "Your request has been throttled due to exceeding the allowed rate limit. Please wait for 10 minutes before trying again. If this issue persists, consider adjusting the request frequency or contact support for further assistance."
}| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
