API
Authentication
All requests to the Caret API must be authenticated using API keys. This page explains how to create and use API keys for authentication.
API Keys
Caret uses API keys to authenticate requests. API keys are workspace-specific and provide full access to the associated workspace’s resources.
Creating an API Key
To create an API key:
- Log in to your Caret workspace
- Navigate to Workspace Settings > API & Integrations > API Keys
- Click “Create API Key”
- Enter a descriptive name for your API key
- Click “Create”
- Your API key will be displayed. Make sure to copy it immediately as it won’t be shown again.
API Key Format
Caret API keys have the following format:
Always keep your API keys secure and never share them in public repositories or client-side code.
Using API Keys
To authenticate your requests, include your API key in the Authorization
header of your requests.
Example Request
API Key Security
Here are some best practices for keeping your API keys secure:
- Never hardcode API keys: Store them in environment variables or a secure key management system.
- Rotate keys regularly: Create new API keys and deprecate old ones on a regular schedule.
- Use separate keys for different environments: Use different API keys for development, staging, and production.
- Restrict access: Limit which users in your organization can create and manage API keys.
- Monitor usage: Regularly review the usage of your API keys to detect any unusual activity.
Revoking API Keys
If an API key is compromised, you should revoke it immediately:
- Log in to your Caret workspace
- Navigate to Workspace Settings > API & Integrations > API Keys
- Find the API key you want to revoke
- Click “Revoke”
- Confirm the action
Once revoked, all requests using that API key will be rejected.