API keys

Create an API key for scripts and CI, choose what it can do, and call the Dekka API with it.

An API key lets a script or CI job use the Dekka API on your organisation's behalf. Keys start with dk_ and are sent as a bearer token to https://api.dekka.cloud/v1. A CI job that only deploys one project is safer with a project token, which can't reach anything outside that project.

Create a key

Open Settings, then API keys, and choose Create key. Give it a name that says where it's used, such as github-actions, tick the access it needs and choose when it Expires: in 30 days, 90 days, a year or never. Dekka shows the key once and stores only a hash, so copy it before you close the dialog.

Only admins can create keys, and only from the dashboard, so a key can never create another key.

Which access should a key have?

Access Lets the key
Read See projects, services and logs
Write Create, deploy and change services
Admin Manage organisation settings

A key can never do more than the person who created it. A developer's key with Admin access still acts as a developer.

Call the API

curl https://api.dekka.cloud/v1/me \
  -H "Authorization: Bearer $DEKKA_API_KEY"
const res = await fetch("https://api.dekka.cloud/v1/me", {
  headers: { Authorization: `Bearer ${process.env.DEKKA_API_KEY}` },
});
const me = await res.json();
import os
import httpx

me = httpx.get(
    "https://api.dekka.cloud/v1/me",
    headers={"Authorization": f"Bearer {os.environ['DEKKA_API_KEY']}"},
).json()

A key that is wrong, expired or revoked answers 401 invalid_api_key. Every error has the same shape, with a request_id to quote if you contact support:

{
  "error": {
    "code": "entitlement_exceeded",
    "message": "The Free plan does not include custom domains. Upgrade to add one.",
    "details": { "entitlement": "custom_domains", "limit": 0, "current": 0, "requested": 1, "plan": "Free" },
    "request_id": "…"
  }
}

Revoke a key

Choose Revoke next to the key on the API keys page. It stops working straight away and leaves the list.