Authentication
To access any endpoint in the API, you must authenticate your requests using a Bearer token. This ensures only authorized users and systems can interact with your data.
Bearer token authentication
All API requests must include an Authorization
header with a valid Bearer token. You can find and manage your tokens in the API settings section of your dashboard.
Here’s how to authenticate using cURL:
cURL
curl https://localhost:3000/api/metrics/revenue \
-H "Authorization: Bearer {token}"
Or using JavaScript:
JavaScript (fetch)
const res = await fetch('http://localhost:3000/api/metrics/revenue', {
headers: {
Authorization: 'Bearer {token}'
}
})
const data = await res.json()
Security best practices
- Keep your token secret — never share or expose it in frontend code.
- Rotate tokens regularly to minimize risk.
- Revoke tokens immediately if you suspect they’re compromised.
For help managing tokens, visit your API settings in the dashboard.