Skip to main content
POST
/
v1
/
api-keys
Create a new API key
curl --request POST \
  --url https://api.example.com/v1/api-keys \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "status": "ACTIVE",
  "name": "<string>",
  "prefix": "<string>",
  "secret": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json
name
string
required

The name of the API key

expires_at
string<date-time>
required

The expiration date and time of the API key

Response

API key created successfully

id
string<uuid>
created_at
string<date-time>
last_used_at
string<date-time>
expires_at
string<date-time>
status
enum<string>
Available options:
ACTIVE,
EXPIRED,
REVOKED
name
string
prefix
string
secret
string

The full API key secret (only returned on creation)