API Keys

Create Api Key

Create a new API key for programmatic access to the Lumethic API.

Generate a long-lived API key that can be used instead of JWT tokens for server-to-server integrations, CI/CD pipelines, and automated workflows. The raw key is returned only once in the response — store it securely.

Authentication Required: Valid JWT token

Request Body:

  • account_id: The account to associate the key with (must be an account you have access to)
  • description: Optional label to identify the key's purpose
  • expires_in_days: Key lifetime in days (default 365, minimum 1)

Response: Returns the created key metadata and the raw key string.

Status Codes:

  • 201: API key created successfully
  • 403: You do not have access to the specified account
post/v1/apikeys/

Request

  • Base URL: https://api.lumethic.com
  • URL: https://api.lumethic.com/v1/apikeys/
  • Auth: OAuth2PasswordBearer (a scheme the document does not define)

Headers

X-API-Keystring nullable

Request body

descriptionstring nullable
account_idstring uuid required
expires_in_daysinteger nullable
scopestring nullable

Example request

{
  "account_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "description": "CI/CD pipeline key",
  "expires_in_days": 90
}

Response

API key created successfully

idstring uuid required

Unique identifier for the API key

prefixstring required

Key prefix for identification (e.g., 'ask_a1b2c3d4')

account_idstring uuid required

Account this key is associated with

user_idstring uuid required

User who created the key

descriptionstring nullable required

User-provided description of the key's purpose

expires_atstring date-time required

ISO 8601 timestamp when the key expires

created_atstring date-time required

ISO 8601 timestamp when the key was created

raw_keystring required

The full API key string. Store this securely — it cannot be retrieved again after creation.

Changes

No recorded changes to this operation across all 1 revision of this API.