API Keys
Create a new API key
Errors
Returns error if permissions are invalid, database error, or key generation fails
post/api/api-keys
Request body
Example request
{
"expiresAt": "2024-01-01T00:00:00Z",
"name": "Production API Key",
"permissions": [
"read:posts",
"write:posts"
]
}Response
API key created successfully
Example response
{
"createdAt": "2023-01-01T00:00:00Z",
"expiresAt": "2024-01-01T00:00:00Z",
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"isActive": true,
"key": "pk_live_1234567890abcdef",
"keyPrefix": "pk_live_",
"name": "Production API Key",
"permissions": [
"read:posts",
"write:posts"
]
}