Skip to main content

List API Keys

curl -X GET "https://panel.example.com/api/account/api-keys?page=1&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
Retrieve a paginated list of API keys for the authenticated user.

Query Parameters

page
number
default:"1"
The page number to retrieve (minimum: 1).
limit
number
default:"50"
Number of items per page (minimum: 1, maximum: 100).

Response

data
array
Array of API key objects.
pagination
object
Pagination metadata.
{
  "data": [
    {
      "identifier": "clx1a2b3c4d5e6f7g8h9i0j1",
      "description": "Production API Key",
      "allowed_ips": ["192.168.1.1", "10.0.0.1"],
      "last_used_at": "2024-03-15T10:30:00.000Z",
      "created_at": "2024-01-01T00:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 50,
    "total": 1,
    "totalPages": 1
  }
}

Create API Key

curl -X POST "https://panel.example.com/api/account/api-keys" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "memo": "Development API Key",
    "allowedIps": ["192.168.1.100"],
    "expiresAt": "2025-12-31T23:59:59Z"
  }'
Create a new API key for the authenticated user.

Request Body

memo
string
A description or memo for the API key (maximum 500 characters).
allowedIps
string[]
Array of IP addresses (IPv4 or IPv6) allowed to use this key. If omitted or empty, the key can be used from any IP address.
expiresAt
string
ISO 8601 datetime string indicating when the key should expire. Must be a future date.

Response

data
object
The created API key object.
meta
object
Additional metadata containing the secret token.
The secret_token in the meta field is only returned during key creation. Make sure to save it securely - you won’t be able to retrieve it again.
{
  "data": {
    "identifier": "clx1a2b3c4d5e6f7g8h9i0j1",
    "description": "Development API Key",
    "allowed_ips": ["192.168.1.100"],
    "last_used_at": null,
    "created_at": "2024-03-15T10:30:00.000Z"
  },
  "meta": {
    "secret_token": "xyp_1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0"
  }
}

Error Codes

400
error
Invalid request body, invalid IP address format, or expiration date is not in the future.

Delete API Key

curl -X DELETE "https://panel.example.com/api/account/api-keys/clx1a2b3c4d5e6f7g8h9i0j1" \
  -H "Authorization: Bearer YOUR_API_KEY"
Delete an API key by its identifier.

Path Parameters

identifier
string
required
The unique identifier of the API key to delete.

Response

success
boolean
Always true if the deletion was successful.
{
  "success": true
}

Error Codes

404
error
API key not found or does not belong to the authenticated user.

Build docs developers (and LLMs) love