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

# Create an API key

`POST /keys`

## Request

- Base URL: `https://api-docs.jackhamr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.jackhamr.ai/keys`
- Auth: none declared

Generate a new org-scoped API key.

The full plaintext key is returned **only** in this response; it is
never retrievable again. Subsequent reads return only the masked
``key_prefix``.

## Request body

- ApiKeyCreate: Request body for ``POST /api/v1/keys``.
  - `label` string, required
  - `expires_at` string, date-time, nullable
  - `scopes` string[], nullable

## Response `201`

Successful Response

- ApiKeyCreated: Response for ``POST /api/v1/keys`` — the full key, shown once.
  - `id` string, required
  - `label` string, required
  - `key` string, required
  - `key_prefix` string, required
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, nullable
  - `scopes` string[], nullable

## Other responses

- `422`: Validation Error

---

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