Skip to main content
POST
/
api-keys
Create an API key
curl --request POST \
  --url https://slog.ai/api-keys \
  --header 'Content-Type: application/json' \
  --header 'slog-api-key: <api-key>' \
  --data '
{
  "name": "CI/CD key",
  "expiresAt": "2027-01-01T00:00:00.000Z"
}
'
{
  "id": "apik_01jqapikey002",
  "name": "CI/CD key",
  "prefix": "sk_a1b2c3",
  "userId": "user_01jquser0001",
  "workspaceId": "ws_01jqws000001",
  "createdAt": "2026-05-24T10:00:00.000Z",
  "lastUsedAt": null,
  "expiresAt": "2027-01-01T00:00:00.000Z",
  "key": "sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}

Authorizations

slog-api-key
string
header
required

API key obtained from the Slog dashboard or returned by the signup/invite-redeem flows. Pass as the slog-api-key header.

Body

application/json
name
string
required

Human-readable label for the key.

Minimum string length: 1
Example:

"CI/CD key"

expiresAt
string<date-time> | null

Optional expiry time. Omit or pass null for a non-expiring key.

Example:

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

Response

API key created. Store the key value — it will not be shown again.

id
string

Unique API key ID (UPID).

Example:

"apik_01jqapikey001"

name
string
Example:

"Default"

prefix
string

First 10 characters of the raw key, safe to display.

Example:

"sk_a1b2c3"

userId
string

ID of the user this key belongs to.

Example:

"user_01jquser0001"

workspaceId
string
Example:

"ws_01jqws000001"

createdAt
string<date-time>
Example:

"2026-05-01T10:00:00.000Z"

lastUsedAt
string<date-time> | null
Example:

"2026-05-20T08:00:00.000Z"

expiresAt
string<date-time> | null
Example:

null

key
string

Full raw API key value — shown only at creation time.

Example:

"sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"