---
title: "Create API key"
method: POST
path: "/v1/api-keys"
tags: ["api-keys"]
---

# Create API key

`POST /v1/api-keys`

## Request

- Base URL: `https://api.framelane.io`
- URL: `https://api.framelane.io/v1/api-keys`
- Auth: HTTP bearer

Create a new API key for the workspace. The plaintext key is returned once.

## Request body

- ApiKeyCreate
  - `name` string, required: Human-readable label for the new API key.

## Response `201`

Successful Response

- ApiKeyCreated: Returned once at creation time -- includes the plaintext secret.
  - `id` string, required: Unique API key ID.
  - `name` string, required: Human-readable label for this key.
  - `key_prefix` string, required: First 8 characters of the key, shown for identification.
  - `created_at` string, date-time, required: ISO-8601 UTC timestamp when this key was created.
  - `last_used_at` string, date-time, nullable: ISO-8601 UTC timestamp of the most recent authenticated request.
  - `revoked_at` string, date-time, nullable: ISO-8601 UTC timestamp when this key was revoked. Null if still active.
  - `key` string, required: Plaintext API key. Store it securely — this is the only time it is returned.

## Other responses

- `401`: Missing or invalid API key.
- `422`: Validation Error

---

[API](https://skmtc.dev/framelane/apis/framelane-api.md) · [All operations](https://skmtc.dev/framelane/apis/framelane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/framelane/apis/framelane-api/revisions/a223001ca8e5?raw)
