Docs

Authentication

All requests to the API and to Storage are authenticated with API tokens.

API tokens

Create tokens in the Console or with the CLI. Send the token in the Authorization header using the Bearer scheme:

HTTP
Authorization: Bearer pc_live_xxxxxxxxxxxxxxxx

Tokens are shown once when created. Store them in a secrets manager and rotate them regularly.

Scopes

ScopeAllows
storage:readList buckets, read and list objects
storage:writeCreate buckets, upload and delete objects
cdn:purgePurge cached objects
adminManage tokens and account settings

Create a token with the CLI

Authentication errors

Requests without a valid token receive 401 Unauthorized:

JSON
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API token."
  }
}