> ## Documentation Index
> Fetch the complete documentation index at: https://mintfax.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> API key authentication for sandbox and live environments

All API requests (except the registration endpoints) require a Bearer token in the `Authorization` header.

## Header Format

```
Authorization: Bearer mfx_test_abc123...
```

## Key Types

| Prefix      | Environment | Traffic                                     |
| ----------- | ----------- | ------------------------------------------- |
| `mfx_test_` | Sandbox     | Routed to sandbox. No real faxes sent.      |
| `mfx_live_` | Live        | Routed to production. Real faxes delivered. |

The key prefix determines routing automatically. There is no separate sandbox URL or environment toggle. See [Environments](/docs/environments) for how isolation works.

## Getting Your First Key

Register a sandbox account to receive your first API key:

```bash theme={null}
# Step 1: Start registration (sends a 6-digit code to your email)
curl -X POST https://api.mintfax.com/v1/account/register \
  -H "Content-Type: application/json" \
  -d '{"name": "My App", "email": "dev@example.com"}'

# Step 2: Verify the code from your email
curl -X POST https://api.mintfax.com/v1/account/register/verify \
  -H "Content-Type: application/json" \
  -d '{"email": "dev@example.com", "code": "482901"}'
```

The `api_key` field in the verification response is your key. It is shown once - store it securely.

## Multiple Keys

Each account can have multiple named API keys, managed via the control panel. Use separate keys for different applications or environments to scope access and simplify rotation.

## Key Rotation

Generate a new key in the control panel, update your application, then revoke the old key. Both keys work simultaneously during the transition.

## Security

* Store keys in environment variables or a secrets manager, not in source code
* Use sandbox keys (`mfx_test_`) during development and testing
* Rotate keys immediately if you suspect a leak
* Each key is scoped to a single environment
