Create an API key
Mint a live or test key for a project. The full key is returned once and never stored.
/v1/admin/projects/{slug}/api-keysAdmin keyThe response is the only time you see the full key. Flaresend stores its first 12 characters (prefix) and a SHA-256 hash, so a lost key can't be recovered; revoke it and create a new one. See API keys for how live and test keys differ.
Path parameters
The project the key belongs to.
Body parameters
A label so you can tell keys apart, 1 to 200 characters, for example production-web.
live keys (fs_live_…) send email. test keys (fs_test_…) record each email with status test and never send it; they skip the suppression check and don't count against rate or daily limits.
An ISO 8601 date-time with a time zone offset. Must be in the future. After it, requests with the key fail with 401 expired_api_key. Without it the key doesn't expire.
Response
Status 201.
The full key: fs_live_ or fs_test_ followed by 32 letters and digits. Shown only in this response. Store it in your app's secrets.
The key ID, used to rename or revoke it.
The project's ID.
The label.
The key's mode.
The first 12 characters of the key, for recognising it later.
null on a new key. Updated at most once a minute while the key is in use.
ISO 8601 creation time.
null on a new key.
The expiry you set, in UTC, or null.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_body | name or mode is missing or malformed, or expiresAt is not in the future. |
| 404 | project_not_found | No project has this slug. |