API keys
How API keys work, what they can reach, and how to scope, rescope and revoke them.
An API key lets a script or an agent call the management API on behalf of your organisation. Keys look like sdhk_sk_..., belong to an organisation, and are sent as a bearer token:
curl -s "$API/v1/billing/plan" \
-H "authorization: Bearer $SDHK_KEY"Each key is limited to 600 requests per minute.
Agents should prefer Agent Auth where a capability covers what they need. It gives the agent its own identity that a human approves, instead of a shared key.
Key management has no API
You create, rescope and revoke keys in the dashboard only. These actions are not in the API or the OpenAPI spec, and an API key cannot mint another one. If you hold a key and need a wider scope, ask the account owner.
Create a key
Keys are created by a person in the dashboard.
- Open Organization, then API Keys, and click New Key.
- Give the key a name.
- Choose Project access: all projects, or exactly one. This cannot be changed later.
- Set an expiry, or turn expiry off for a key that never expires.
- Grant permissions per resource, then click Create Key.
- Copy the key on the next step.
The plaintext key is shown once. If you lose it, revoke the key and create a new one. There is no way to show it again.
Project access
A key with access to all projects can target any project in the organisation, using the X-Project-Id header. A key bound to one project sees only that project. A request for any other project returns 404, and the key cannot create projects.
Permissions
Each resource gets one of three levels:
| Level | What the key can do |
|---|---|
| No access | The resource is unreachable through this key. |
| Read | View the resource. |
| Read and write | Create, update and, where applicable, delete. This includes destructive and secret-revealing actions for that resource. |
The resources are Projects, Sources, Destinations, Connections, Connectors, Deliveries, Events and Billing. Grant the least access the key needs. A key must hold at least one resource.
Minting a scoped key is capped at your own role in the organisation, so only an owner or admin can create a key with write access to billing.
Unscoped keys
A key with no permissions set, for example one created before scoping existed, is unscoped. It gets the same access as an organisation member: full read, and non-destructive writes (create, update, toggle, retry and replay).
These need an explicit read and write grant on that resource, so an unscoped key cannot do them:
DELETEon sources, destinations, connections, projects and connectorsPOST /v1/sources/{id}/rotate-maskGET /v1/destinations/{id}/signing-secretPOST /v1/destinations/{id}/rotate-signing-secretPOST /v1/connectors, and its regenerate-enrollment and toggle-disabled- the billing mutations:
cancel,resume,change-planandrevert-scheduled-change
Rescope a key
You can change a key's permissions in place from the dashboard. The secret does not change, so nothing using the key needs updating, and the new permissions apply on the next request.
Saving an unscoped key replaces its member-tier fallback with exactly the permissions you choose. The project binding is fixed for the life of the key.
Revoke a key
Revoking a key is permanent, and any request using it stops working immediately. Use it when a key leaks or is no longer needed. An expired key stops working in the same way.
Errors
| Response | Meaning |
|---|---|
401 UNAUTHORIZED | The key is missing, wrong, expired or revoked. |
403 INSUFFICIENT_API_KEY_PERMISSIONS | The key is valid, but its permissions do not cover this action. |
A 403 INSUFFICIENT_API_KEY_PERMISSIONS will not go away on retry. Ask whoever holds the key to scope it for that resource. It differs from a plain 403 FORBIDDEN, which is a session or organisation refusal, not a key-scope one. A 404 on a resource you expect can mean the key is bound to a different project.
Next steps
- Agent Auth — the preferred credential for agents
- Projects — how project access works
- Errors — every error code
- Rate limits — the 600 requests per minute limit