Skip to main content
All gork.email endpoints live under a single versioned base URL:
cURL
Every public endpoint is namespaced under /v1 (e.g. POST /v1/messages/send). The /v1 prefix is immutable — backwards-compatible changes never break existing integrations.

Authentication

Authenticate with a bearer API key on every request:
cURL
Keys are formatted as gork_live_... (production) or gork_test_... (test). Only the SHA-256 hash is stored server-side — the raw key is shown exactly once at creation and can never be retrieved again.
A missing or malformed Authorization header returns 401 unauthorized. A revoked or unknown key returns 401 invalid_api_key. A key whose format does not start with gork_ returns 401 invalid_api_key_format.

Scopes

Every key carries a set of scopes. Endpoints declare the scope they require, and a key without it receives 403 insufficient_scope. A key with the * wildcard scope (the default for unbound keys) may call everything. Resource wildcards are also honored: messages:* covers both messages:read and messages:send.
Inbox-bound agent keys (created with an inboxId) may only hold mail scopes — inboxes:read, messages:read, messages:send, threads:read — and every call is confined to their own inbox. See API Keys.

Success envelope

Every successful response wraps its payload in a data envelope:
200 OK
List endpoints return an array under data:
200 OK

Error envelope

Errors always use the same shape:
422 Unprocessable Entity

Idempotency

POST /v1/messages/send accepts an Idempotency-Key header. Replaying a request with the same key returns the original result instead of sending twice:
cURL
  • Keys are capped at 255 characters — longer values are rejected with 400 validation_failed.
  • A replayed delivery returns HTTP 200 (not 201) with an Idempotent-Replayed: true response header.
  • Always generate a fresh UUID per logical send, and reuse it only when retrying that same send after a network failure.

Rate limits

Requests are limited to 240 requests per minute per organization. Every authenticated response carries the current budget: Exceeding the budget returns 429 rate_limit_exceeded. Back off and retry after the reset time.

Health and machine-readable spec

  • GET https://api.gork.email/health returns { "status": "healthy", "service": "gork.email", ... } with no authentication. Use it for uptime checks.
  • GET https://api.gork.email/openapi.json serves the full OpenAPI specification — the same source SDKs and agent tool definitions are generated from.