Skip to main content
mintfax has three kinds of API key. The prefix is a structural promise: every request is routed based on the prefix the key carries. You pick a key, the routing follows.

The three key kinds

mfx_test_... - sandbox environment key

Operational key scoped to a single sandbox environment. Sends sandbox faxes (no carrier dispatch). Reads that environment’s sandbox fax history, events, webhooks, and credit balance. Cannot touch live data and cannot call /account/*.

mfx_live_... - live environment key

Operational key scoped to a single live environment. Sends real faxes through the carrier. Reads that environment’s live data. Requires the account to be activated - until the first live credit purchase succeeds, a live key returns account_not_activated on operational routes.

mfx_acct_... - account management key

Account-scoped admin key. Reads and manages account-level resources: balances across all pools, the pool-wide transaction ledger, and the list of API keys. Cannot send faxes and cannot call /environment/*. Think of it as the keys-and-money key, not the send-a-fax key.

The prefix is the sandbox/live wall

mintfax follows Stripe’s sk_test_ / sk_live_ pattern, with a third acct kind for the account namespace. Because the gateway routes on prefix, the wall between sandbox and live is structural, not configurational:
A key never spans sandbox and live. Each environment is one type for its life. To send live, use a live key against a live environment. To send sandbox, use a sandbox key against a sandbox environment. There is no environment toggle in the API.
This is the type-homogeneity rule. If you accidentally point a sandbox key at production code, you do not silently send real faxes - the worst case is that nothing happens, because sandbox keys cannot reach live resources by construction.

Registration provisions two keys

POST /account/register/verify returns both a mfx_test_... key and a mfx_acct_... key in the same response. Store both. They have different jobs:
  • Use the sandbox key for your first sandbox fax in dev. It is scoped to the sandbox environment created at registration.
  • Use the acct key when you need to programmatically manage environments, balances, or other keys. For example: listing all your API keys, reading the live and sandbox balances side by side, or creating a new live environment key after you activate.
Both plain-text keys are shown once only. Save them to a secrets manager or .env file before navigating away.

Creating more keys

Environment keys (test or live)

POST /account/keys with scope_kind=test or scope_kind=live creates an environment-scoped key. Use an mfx_acct_... key to authenticate the call:
The response includes the plain-text key once. Store it immediately.

Account keys

Subsequent mfx_acct_... keys cannot be created via the API. POST /account/keys with scope_kind=account returns HTTP 403 with acct_key_creation_dashboard_only:
Rationale: account keys are admin-equivalent for the account. Restricting their lifecycle to the dashboard adds a human-loop attestation step, so an API-only chain of compromise cannot escalate from a stolen environment key to full account control.

Revocation

Deleting an environment key via the API:
Revocation is effective on the next request - there is no caching layer to wait on. A revoked key returns api_key_invalid.

Which key for which endpoint

The API splits cleanly into two scopes:
  • Operational (/faxes, /environment/*, /webhooks, /events) - environment keys only.
  • Account (/account/*) - account keys only.
When a key hits a route it is not scoped for, the API returns HTTP 403 with a specific code: These codes are stable. Match on them programmatically if you need to fall back to a different key in your client.

Worked example: agent registration flow

A coding agent registers, stores both keys, sends a sandbox fax, then later switches to live.
The acct key never sends faxes. The environment keys never read account-level data. The prefix tells the gateway everything it needs to know.
Last modified on July 20, 2026