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:
Authorization: Bearer pc_live_xxxxxxxxxxxxxxxx
Tokens are shown once when created. Store them in a secrets manager and rotate them regularly.
Scopes
| Scope | Allows |
|---|---|
storage:read | List buckets, read and list objects |
storage:write | Create buckets, upload and delete objects |
cdn:purge | Purge cached objects |
admin | Manage tokens and account settings |
Create a token with the CLI
popug token create --name ci --scope storage:write --scope cdn:purge
Authentication errors
Requests without a valid token receive 401 Unauthorized:
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API token."
}
}