Skip to main content
POST
/
v1
/
admin
/
api-keys
Create API key
curl --request POST \
  --url http://localhost:3000/v1/admin/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "scopes": [],
  "expires_at": "2023-11-07T05:31:56Z",
  "staff_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'
{
  "success": true,
  "api_key": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "key_prefix": "<string>",
    "key_last_four": "<string>",
    "staff_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "description": "<string>",
    "scopes": [
      "<string>"
    ],
    "is_active": true,
    "expires_at": "<string>",
    "last_used_at": "<string>",
    "usage_count": 123,
    "created_at": "<string>",
    "updated_at": "<string>",
    "revoked_at": "<string>",
    "staff": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "email": "<string>",
      "first_name": "<string>",
      "last_name": "<string>"
    }
  },
  "secret": "<string>"
}

Body

application/json
name
string
required
Required string length: 1 - 100
description
string
Maximum string length: 500
scopes
string[]
expires_at
string<date-time>
staff_id
string<uuid>

Response

201 - application/json

Created API key with secret

success
boolean
required
api_key
object
required
secret
string
required