API Key Methods

HTTP Endpoints

POST /keys

Creates a new API keys for the authenticated user.

The user is identified by the ‘user_id’ in the request context. Requests must include a JSON body with a “name” and “description”.

Request Headers:
Status Codes:

Request Syntax:

{
  "name": "string"
  "description" "string"
}

Response Syntax:

"<key>"
Raises:

May raise exceptions related to database operations.

GET /keys

List all API keys for the authenticated user.

This endpoint retrieves all API keys associated with the authenticated user. The user is identified by the ‘user_id’ in the request context.

Request Headers:
Status Codes:

Example response:

[
  {
    "name": "API Key Name",
    "description": "Key Description",
    "dateCreated": "2024-07-16 10:30:00",
    "dateExpired": "2024-08-15 10:30:00"
  }
]
Raises:

May raise exceptions related to database operations.

DELETE /keys/(key_id)

Deletes the specified API key.

The user is identified by the ‘user_id’ in the request context. Requests must include a JSON body with a “name” and “description”.

Request Headers:
Status Codes:
Raises:

May raise exceptions related to database operations.