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

# Create API key

> Generate a new programmatic API key for your workspace.

Create an API token (`mf_live_...`) to authorize backend services and SDKs via the Mailofly API.

> **Security Note**: The full secret plaintext token is returned only upon creation. Store it securely.

### Body Parameters

**name** `string` *required*

Descriptive name for the key (e.g. `Production Backend`).

**expires\_at** `string`

Optional expiration timestamp in ISO 8601 format.

### Response

**data** `object`

**id** `string`

API key ID.

**name** `string`

Name.

**secret\_suffix** `string`

Last 4 characters of token.

**token** `string`

The full API key secret.

**created\_at** `string`

Creation timestamp.

```bash cURL theme={null}
curl -X POST https://api.mailofly.com/api-keys \
  -H "Authorization: Bearer mf_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production App"
  }'
```

```json 201 Created theme={null}
{
  "data": {
    "id": "key_123456",
    "name": "Production App",
    "secret_suffix": "9aBc",
    "token": "mf_live_sample_token_secret_value_9aBc",
    "created_at": "2026-09-11T14:00:00Z"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.