Skip to main content
Every request to https://api.gork.email/v1 authenticates with a Bearer API key. Keys start with gork_live_ (or gork_test_) followed by 48 hex characters. Only a SHA-256 hash is stored — the raw key is shown once, at creation.

Create a key

1

Open the console

Go to Dashboard → API Keys and choose Create key, or call the API with a key that already holds keys:write.
2

Name it and pick scopes

Give the key a descriptive name (sdr-agent-prod) and select the minimum scopes it needs (table below). Omit scopes entirely for a full-access key (*).
3

Save the raw key immediately

The apiKey field is returned exactly once. Store it in a secrets manager — afterwards only the keyPrefix (first 16 characters) is visible, for identification.
Response (201)
List keys (prefixes only) with GET /v1/keys (keys:read). Revoke with DELETE /v1/keys/:id (keys:write) — revocation deactivates the key immediately and returns { "data": { "id": "...", "status": "revoked" } }. A revoked or unknown key fails with invalid_api_key (401).

Scopes

A key can also hold a resource wildcard such as messages:*, which covers every messages: scope. Endpoints reject under-scoped keys with insufficient_scope (403), naming the required and granted scopes.
Follow least privilege: a sending agent needs inboxes:read, messages:read, messages:send, and threads:read — nothing else. It should never hold keys:write, which would let it mint new keys.

Inbox-scoped agent keys

Pass inboxId when creating a key to bind it to a single inbox. Bound keys default to mail-only scopes (inboxes:read, messages:read, messages:send, threads:read); any requested scopes are intersected with that allowlist, and a request with zero mail scopes fails with invalid_scopes (400).
cURL
A bound key can only operate inside its own inbox — reads are filtered to it, sends from any other inbox fail with inbox_access_denied (403), and it is blocked from POST /v1/inboxes entirely. Use one bound key per agent so a compromised key cannot reach other inboxes.

Rotation

1

Create the replacement

Create a new key with the same name plus a version suffix and the same scopes.
2

Deploy it

Update the secret in your agent’s environment and confirm traffic succeeds (check lastUsedAt on the new key via GET /v1/keys).
3

Revoke the old key

Delete the old key with DELETE /v1/keys/:id. There is no grace period — do this last.

If a key leaks

  1. Revoke it immediately: DELETE /v1/keys/:id. Authentication fails closed on revocation.
  2. Create a replacement key and rotate the secret everywhere it was stored.
  3. Review GET /v1/keys (lastUsedAt per key) and your sending logs for traffic you do not recognize.
  4. If the leaked key held keys:write, audit the key list for keys you did not create and revoke those too.
Never commit keys to git, bake them into client-side bundles, or log the Authorization header. The raw key exists only in the creation response — support cannot recover it.