EndpointsCreate API key for user

Create API key for user

Creates a new API key for the current user. The key gives access to all resources of the user. The raw key is returned only once in the response.

curl -X POST "//v1/api-keys" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (API Key)" \
  -d '{
  "name": "John Doe",
  "expiration_date": "2024-12-25T10:00:00Z"
}'
{
  "id": "example_string",
  "key_prefix": "example_string",
  "name": "John Doe",
  "expiration_date": "2024-12-25T10:00:00Z",
  "created_at": "2024-12-25T10:00:00Z",
  "revoked_at": "2024-12-25T10:00:00Z",
  "api_key": "example_string"
}
POST
/v1/api-keys
POST
Bearer Token (API Key)
Bearer Tokenstring
Required

User API Key. Create in the Ctxfy dashboard or via POST /v1/api-keys. Use Bearer <api_key> in Authorization header.

User API Key. Create in the Ctxfy dashboard or via POST /v1/api-keys. Use Bearer <api_key> in Authorization header.
Content-Typestring
Required

The media type of the request body

Options: application/json
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (API Key). User API Key. Create in the Ctxfy dashboard or via POST /v1/api-keys. Use Bearer <api_key> in Authorization header.

Responses