API Reference
Authentication
Use Bearer authentication with API keys when making requests to the ClearSanction API.
ClearSanction uses API keys to authenticate requests to the API. Each API key is associated with a ClearSanction account and has specific permissions that determine what actions it can perform. When you make a request to the ClearSanction API, you must include your API key in the Authorization header using Bearer authentication.
API keys
Used to interact with the ClearSanction API in your backend. For example, building compliance workflows and automated screening processes.
Intended only for server-side use.
Has full access to your data, limited only by the permissions assigned to the API key.
Must be kept secure and secret.
This reference is about authenticating requests to the ClearSanction API in your backend.
Get an API key
To get started, create an account on the ClearSanction platform and generate your API key from the dashboard.
Example: Create API Key
1. Log in to your ClearSanction account
2. Navigate to the API Keys section
3. Click "Create API Key"
4. Set a name, description, and permissions for the key
5. Save the key and copy the generated valueAuthenticate Requests
Include your API key in the Authorization header of your HTTP requests using Bearer authentication.
Example: Authenticate with API Key
curl -X GET https://api.clearsanction.com/v1/screenings \
-H "Authorization: Bearer cs_live_1a2b3c4d5e6f7g8h9i0j" \
-H "Content-Type: application/json"Test Authentication
You can test your API key by making a simple request to the ClearSanction API. If the request is successful, your API key is valid.
Example: Test API Key
curl -X GET https://api.clearsanction.com/v1/screenings \
-H "Authorization: Bearer cs_live_1a2b3c4d5e6f7g8h9i0j" \
-H "Content-Type: application/json"Response
If your API key is valid, you will receive a successful response from the ClearSanction API. If there is an issue with your API key, you will receive an error response with details about the problem.
Example: Successful Authentication Response
{
"data": [
{
"id": "scr_1234567890abcdef",
"type": "screening",
"attributes": {
"status": "completed",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:05:00Z"
}
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 20
}
}Error Handling
If there is an issue with your API key, you will receive an error response. Common issues include invalid keys, expired keys, or insufficient permissions.
Example: Authentication Error Response
{
"error": {
"type": "invalid_api_key",
"message": "The API key provided is invalid. Please check your key and try again."
}