Skip to main content
POST
Create an API key
The 201 response is the only place the raw key appears (apiKey.key). FaceMode stores only a hash - if you lose it, create a new key.
Notes:
  • scopes is optional; omit it for the default set. Unknown names fail with INVALID_SCOPES.
  • expiresAt is optional; when provided it must parse as a date (INVALID_EXPIRY_DATE) and be in the future (EXPIRY_MUST_BE_FUTURE). Null means never expires.
  • At most 5 keys per account (API_KEY_LIMIT_REACHED, 403).

Authorizations

x-api-key
string
header
required

FaceMode API key (fm_...).

Body

application/json
name
string
required

Human-friendly label for the key.

description
string
expiresAt
string<date-time>

Optional expiry timestamp; must be in the future.

scopes
enum<string>[]

Optional scope list. Defaults to sessions:create, sessions:read, sessions:end, avatars:read, usage:read.

Granular permission attached to an API key.

Available options:
sessions:create,
sessions:read,
sessions:end,
avatars:read,
avatars:write,
keys:read,
keys:write,
keys:delete,
billing:read,
billing:write,
credits:read,
usage:read

Response

API key created. apiKey.key contains the raw key - shown only once.

apiKey
object