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)
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
PassinboxId 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
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
- Revoke it immediately:
DELETE /v1/keys/:id. Authentication fails closed on revocation. - Create a replacement key and rotate the secret everywhere it was stored.
- Review
GET /v1/keys(lastUsedAtper key) and your sending logs for traffic you do not recognize. - If the leaked key held
keys:write, audit the key list for keys you did not create and revoke those too.