FlaresendDocs
Admin API

Create an API key

Mint a live or test key for a project. The full key is returned once and never stored.

POST/v1/admin/projects/{slug}/api-keysAdmin key

The 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

slugstringpathrequired

The project the key belongs to.

Body parameters

namestringrequired

A label so you can tell keys apart, 1 to 200 characters, for example production-web.

mode'live' | 'test'required

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.

expiresAtstring

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.

keystring

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.

idstring

The key ID, used to rename or revoke it.

projectIdstring

The project's ID.

namestring

The label.

mode'live' | 'test'

The key's mode.

prefixstring

The first 12 characters of the key, for recognising it later.

lastUsedAtstring | null

null on a new key. Updated at most once a minute while the key is in use.

createdAtstring

ISO 8601 creation time.

revokedAtstring | null

null on a new key.

expiresAtstring | null

The expiry you set, in UTC, or null.

Errors

StatusCodeWhen
400invalid_bodyname or mode is missing or malformed, or expiresAt is not in the future.
404project_not_foundNo project has this slug.