Skip to main content

Send the key

Every request carries the key in the Authorization header:
Treat a key like a password. Keep it in CI secrets or a password manager, never in source code, client-side JavaScript or a public repository. If a key leaks, delete it in the dashboard right away; it stops working immediately.

Create a key

Workspace owners open API in the dashboard sidebar and select Create API key, then choose:
  1. A name, so you can tell keys apart, for example github-actions-shop.
  2. Scopes: what the key may do (below).
  3. Resources: for applications, databases and object storage, whether the key reaches all of them or only specific ones.
The full key is shown once. Servbase stores only a hash of it, so a lost key cannot be shown again: delete it and create a new one. A key acts with your access in the workspace it was created in. It stops working when it is deleted, when you lose access to the workspace, or while the workspace owner’s account is suspended or banned.

Scopes

Give a key only the scopes it needs. A request outside a key’s scopes is refused with 403.
Keys created before the storage scopes were split keep what they could do: a key with storage:write also has storage:delete and storage:buckets.

Limit a key to specific resources

For applications, databases and object storage, a key can reach all of them or only specific ones you choose:
  • Lists return only the resources the key may reach. Any other resource answers 404, as if it did not exist.
  • A key limited to specific buckets cannot create buckets.
  • Resources created later are not added to the key. Create a new key to include them.
Normal rules still apply on top of a key’s scopes. For example, only a running app with a successful build can be stopped, restart works only for Python and Node.js apps, and deploys are refused while an app is stopped.

What keys never see

  • Application details include the names of an app’s variables, never their values.
  • Database passwords are returned only by GET /db/{db_id}/credentials, which needs databases:credentials.