Authentication
The API uses bearer tokens. Send the token in the Authorization header of every request:
curl https://api.conversionloop.net/v1/projects \
-H "Authorization: Bearer cl_sk_..."
API tokens
Workspace owners and admins create tokens in the dashboard under Settings → API tokens. When you create one, you choose:
- a name, so you know later what the token is used for,
- scopes, which decide which endpoints the token may call,
- an expiry (optional). After that date the token stops working.
The token is shown once, right after you create it. Conversionloop stores only a hash of it and cannot show it again. If you lose a token, create a new one and revoke the old one.
In the token list you see the first characters of each token (for example cl_sk_7f3k9x) and when it was last used, so you can tell tokens apart without the secret.
A token belongs to one workspace and can reach all projects of that workspace. A request for a project in another workspace answers 404, as if the project did not exist.
Scopes
| Scope | Allows |
|---|---|
projects:read |
List and read projects, get the script tag and the script size |
projects:write |
Create, change and archive projects, rotate the public key |
datafields:read |
List data fields |
datafields:write |
Create, change and delete data fields |
audiences:read |
List and read audiences |
audiences:write |
Create, change and delete audiences |
campaigns:read |
List and read campaigns |
campaigns:write |
Create, change, publish, pause and archive campaigns |
insights:read |
Read results, export responses, read session usage |
billing:read |
Read the subscription |
billing:write |
Reserved. Subscription changes are made in the dashboard. |
Each endpoint in the API reference lists the scope it needs. A token without that scope gets 403 forbidden.
Tokens cannot create, list or revoke other tokens. Token management is only available in the dashboard, so a token can never give itself more rights.
Keep tokens secret
An API token grants access to your workspace. Treat it like a password:
- Use it only on your server, never in browser code or mobile apps. Your website does not need a token: the script tag uses the public key, which is not a secret.
- Keep it in an environment variable or a secret manager, not in your repository.
- Give each integration its own token with only the scopes it needs. Then you can revoke one without affecting the others.
The API does not accept requests from browsers on other domains (CORS), so a token in front-end code would not work anyway.
Replacing a token
- Create a new token with the same scopes.
- Deploy your integration with the new token.
- Revoke the old token in the dashboard. It stops working immediately.
Errors
| Status | Code | Meaning |
|---|---|---|
401 |
unauthorized |
No token, or the token is unknown, expired or revoked. |
403 |
forbidden |
The token is valid but lacks the scope for this endpoint. |
See Requests and errors for all error codes.