POST /api-keys
Create a new API key scoped to a verified domain.
Authentication
JWT (Dashboard)
Request Body
| Field | Type | Required | Description |
|---|
domainId | string (UUID) | Yes | Domain to scope the key to |
keyName | string | Yes | Display name for the key |
permissions | string[] | No | Permissions (default: ["send"]) |
Response
{
"success": true,
"data": {
"apiKey": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"key": "snd_abc123_xyz789secretpart",
"key_prefix": "snd_abc123",
"key_name": "Production",
"permissions": ["send"],
"created_at": "2026-03-07T12:00:00Z"
}
},
"message": "API key created successfully. Save it securely - it will not be shown again."
}
The full API key is only returned once at creation. Store it securely — you cannot retrieve it later.
Errors
| Status | Error | Cause |
|---|
400 | Domain not verified | Domain must be verified before creating keys |
400 | Duplicate name | Key name must be unique per user |