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
The page number to retrieve (minimum: 1).
Number of items per page (minimum: 1, maximum: 100).
Response
Array of API key objects.
The unique identifier of the API key.
A memo or description for the API key.
Array of IP addresses allowed to use this key. Empty array means no restrictions.
ISO 8601 timestamp of when the key was last used.
ISO 8601 timestamp of when the key was created.
Pagination metadata.
Number of items per page.
Total number of API keys.
{
"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
A description or memo for the API key (maximum 500 characters).
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.
ISO 8601 datetime string indicating when the key should expire. Must be a future date.
Response
The created API key object.
The unique identifier of the API key.
The description for the API key.
Array of allowed IP addresses.
Will be null for newly created keys.
ISO 8601 timestamp of creation.
Additional metadata containing the secret token.
The actual API key token. This is only returned once during creation.
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
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
The unique identifier of the API key to delete.
Response
Always true if the deletion was successful.
Error Codes
API key not found or does not belong to the authenticated user.