API keys
API keys authenticate your calls to the Open API. Keys are issued per space and can only reach that space's data.
A key is a string starting with chp_, sent in the Authorization: Bearer header of every request.
Using a key
bash
curl https://api.cherpa.me/v1/content/blog/entries \
-H "Authorization: Bearer chp_a1b2c3d4e5f6..."Issue a key
Issue keys under Settings → API keys in the console.
- Click + Issue API key.
- Give the key a name (e.g.
Production web) so you can tell later what it's used for. - Choose a permission. See the permissions table below.
- Click Issue to see the full key. Copy it and store it somewhere safe.
The full key is shown only once, right after it's issued
Once you close the dialog you can't view it again. If you lose it, delete the key and issue a new one. The list only shows the beginning of each key (chp_a1b2c3d4).
Issued key
chp_a1b2c3d4e5f6...Key as shown in the list
chp_a1b2c3d4Permissions
Each key is limited to certain APIs. Give each integration only what it needs.
| Permission | Create inquiries | Create outbounds | Content delivery |
|---|---|---|---|
full Full access | ✓ | ✓ | ✓ |
content Read content | – | – | ✓ |
inquiry Submit inquiries | ✓ | – | – |
Calling an API the key isn't permitted to use returns 403.
| Where it's used | Recommended permission |
|---|---|
| Website contact form (called directly from the browser) | inquiry |
| Showing content on your website | content |
| Creating outbounds from a server or script | full |
Call without permission · 403
json
{
"code": 7,
"message": "This API key doesn't have that permission",
"detail": "This API key doesn't have that permission"
}Storing and rotating keys
- Keep
fullkeys on the server. Anything in a browser bundle, app binary or public repository can be read by anyone. - If you must call from the browser, use a key with the
inquiryorcontentpermission. Even if it leaks, it can't do anything outside that scope. - Issue separate keys per environment (development, production) and per use, so if one leaks you only need to replace that one.
- If a key leaks, delete it under API keys. Requests using it are rejected with
401immediately. Then issue a new key to replace it.
Use the Last used time in the list to find and clean up unused keys (updated every 5 minutes).
Call with a deleted key · 401
json
{
"code": 16,
"message": "Invalid API key",
"detail": "Invalid API key"
}