Skip to main content
POST
Create an API key

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

API key creation parameters.

Request body for creating a new API key.

name
string
required

A human-readable label for the key (1–255 characters).

Required string length: 1 - 255
Example:

"CI bot"

expiresAt
string<date-time>

Optional ISO-8601 expiry timestamp. Must be in the future. Omit for a non-expiring key.

Example:

"2027-01-01T00:00:00Z"

userId
integer

Optional. When provided by an admin, mints the key on behalf of this user. The target user must already have a grant in the current organization. Defaults to the authenticated caller.

Required range: x >= 1
Example:

42

Response

The created API key, including the plaintext secret (shown once only).

A newly created or rotated API key, including the plaintext secret. The secret is shown exactly once and cannot be retrieved again. Note that lastUsedAt and revokedAt are not returned by the create and rotate operations.

id
string
required

The unique identifier for the API key.

Example:

"uuid-1234"

name
string
required

A human-readable label for the key.

Example:

"CI bot"

prefix
string
required

The first 8 characters of the key's random portion — the part that follows the lilt_ prefix. Safe to display.

Example:

"aaaaaaaa"

key
string
required

The full plaintext API key (lilt_ followed by 40 hex characters). Shown once only.

Example:

"lilt_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

createdAt
string<date-time>
required

ISO-8601 timestamp when the key was created.

Example:

"2026-04-29T00:00:00Z"

expiresAt
string<date-time> | null

ISO-8601 timestamp when the key expires, or null if it does not expire.

Example:

"2027-01-01T00:00:00Z"

ownerEmail
string | null

Email address of the user who owns the key. Returned when creating a key; omitted when rotating one.

Example:

"developer@lilt.com"

ownerUserId
integer | null

Numeric identifier of the user who owns the key. Returned when creating a key; omitted when rotating one.

Example:

42