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

# Create API key

`POST /api/keys`

## Request

- Base URL: `https://www.zestio.de`
- URL: `https://www.zestio.de/api/keys`
- Auth: API key in cookie `sb-access-token`

Generate a new API key. The secret is only shown once — store it securely.

## Request body

- CreateApiKeyRequest
  - `name` string: Friendly name for the key

## Response `201`

API key created

- CreateApiKeyResponse
  - `key` ApiKey
    - `id` string
    - `name` string
    - `keyPrefix` string
    - `lastUsedAt` string, date-time, nullable
    - `createdAt` string, date-time
    - `isActive` boolean
  - `secret` string: The full API key (only shown once)
  - `warning` string

## Other responses

- `400`: Bad request - invalid parameters
- `401`: Unauthorized - invalid or missing credentials
- `500`: Internal server error

---

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