Skip to content

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.

  1. Click + Issue API key.
  2. Give the key a name (e.g. Production web) so you can tell later what it's used for.
  3. Choose a permission. See the permissions table below.
  4. 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_a1b2c3d4

Permissions ​

Each key is limited to certain APIs. Give each integration only what it needs.

PermissionCreate inquiriesCreate outboundsContent 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 usedRecommended permission
Website contact form (called directly from the browser)inquiry
Showing content on your websitecontent
Creating outbounds from a server or scriptfull
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 full keys 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 inquiry or content permission. 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 401 immediately. 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"
}