Skip to main content

API Keys

Create, list, and revoke API keys for authentication.

List API Keys

Returns all API keys for the authenticated user.

Response

[
  {
    "id": "key_abc123",
    "name": "Production Server",
    "prefix": "pk_live_a1b2c3",
    "created_at": "2024-01-15T10:30:00Z",
    "last_used_at": "2024-01-16T14:22:00Z"
  }
]
For security, only the key prefix is returned. The full key is only shown once when created.

Create API Key

Create a new API key.

Request

name
string
required
A descriptive name for the key (e.g., “Production Server”)

Response

{
  "id": "key_abc123",
  "name": "Production Server",
  "key": "pk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "created_at": "2024-01-15T10:30:00Z"
}
The full key value is only returned once. Store it securely immediately.

Example

curl -X POST https://api.pdflet.dev/api/v1/api-keys/ \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json" \
  -d '{"name": "Production Server"}'

Delete API Key

Revoke an API key. This action cannot be undone.

Parameters

id
string
required
The API key ID to delete

Response

Returns 204 No Content on success.

Example

curl -X DELETE https://api.pdflet.dev/api/v1/api-keys/key_abc123/ \
  -H "Authorization: Bearer your_jwt_token"
Revoking a key immediately invalidates it. Any requests using this key will fail with 401 Unauthorized.