---
title: "Create Api Key"
method: POST
path: "/api/api-keys"
tags: ["api-keys"]
---

# Create Api Key

`POST /api/api-keys`

## Request

- Base URL: `https://app.ctlsurf.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.ctlsurf.com/api/api-keys`
- Auth: HTTP bearer

Create a new API key. The full key is only returned once.

## Request body

- ApiKeyCreate: Schema for creating a new API key.
  - `name` string, required

## Response `201`

Successful Response

- ApiKeyCreatedResponse: Schema returned when a new API key is created (includes the full key once).
  - `id` string, uuid, required
  - `name` string, required
  - `key_prefix` string, required
  - `is_active` boolean, required
  - `created_at` string, date-time, required
  - `last_used_at` string, date-time, nullable
  - `key` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ctlsurf/apis/notebook-control-plane.md) · [All operations](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/llms.txt) · [OpenAPI document](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/revisions/ddfbbe20d5ce?raw)
