Authentication
Every request requires an API key passed in the Authorization header as a Bearer token.
Keys are scoped to either test or live mode. Test-mode messages are rendered, scored and surfaced in your dashboard but never delivered to real recipients.
Header
Authorization: Bearer afn_live_pK7j3R9kXYbE4mN1c8b9aFScopes
Every key carries one scope, set at creation and changeable later with PATCH /v3/keys/{id}.
| Parameter | Type | Required | Description |
|---|---|---|---|
full_access | default | Optional | Send, read and manage every resource in the account. |
send_only | restricted | Optional | May send (POST /v3/messages, POST /v3/messages.batch), resend never-delivered emails (POST /v3/messages/{id}/resend, POST /v3/messages/resend), cancel scheduled sends (DELETE /v3/messages/{id}), submit verifications (POST /v3/validate, POST /v3/validate/bulk, POST /v3/validate/evaluate) and read any resource (GET). All other write operations — keys, domains, webhooks, templates, suppressions, lists, verification rules — return 403 insufficient_scope. |
read_only | restricted | Optional | GET requests only — events, metrics, message detail. Any write operation returns 403 insufficient_scope. |
Two further gates apply on top of the scope: a key with a source-IP allowlist rejects requests from other addresses with 403 ip_not_allowed, and a test key (afn_test_…) can only send, verify and configure webhooks in simulated mode — other writes return 403 test_key_forbidden (see Test keys). The OpenAPI spec states this per operation: every authenticated operation carries x-required-scope (read_only, send_only or full_access — the lowest scope that may call it) and x-test-key-allowed (whether a test key may call it). In short: every GET endpoint accepts all three scopes; sends, resends, scheduled-send cancellation and verification submits accept send_only or full_access; every other write needs full_access.
Who am I?
GET /v3/whoami echoes the resolved identity: account (id, name, plan, status) and api_key (id, scope, environment). Use it to smoke-test credentials in CI before running a deploy — full reference on the Who am I page under Account.