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

# Create key

`POST /api/keys`

## Request

- Base URL: `https://api.mymarky.ai`
- URL: `https://api.mymarky.ai/api/keys`
- Auth: HTTP bearer

Create a new API key for the specified org.

Send an `Idempotency-Key` header to make a retry safe: a resend with the same
key returns the ORIGINAL key (including its one-time secret) instead of
minting a second key.

Errors:
    401 authentication_required: The login token is missing, invalid, or expired.
    403 permission_denied: You are not a member of this org.
    422 IDEMPOTENCY_KEY_CONFLICT: The Idempotency-Key was reused with a different body.

## Headers

- `Idempotency-Key` string, nullable: Optional. Send a unique value (e.g. a UUID) to make this create request safe to retry. A repeat with the same key returns the original response instead of creating a duplicate. Cached for 24h, scoped to your org. Reusing a key with a different body returns 422.
- `Marky-Version` '2026-04-08' | '2026-07-17' | '2026-08-02' | '2026-08-04' | '2026-08-06'

## Request body

- ApiKeyCreateRequest
  - `name` string, required: A label for this API key (e.g. 'n8n production')
  - `org_id` string, required: Organization ID to create the key for

## Response `201`

Successful Response

- ApiKeyCreateResponse
  - `id` string, required: API key ID
  - `key` string, required: Full API key (shown only once)
  - `name` string, required
  - `key_prefix` string, required: Key prefix for identification
  - `created_at` string, required

## Other responses

- `400`: Bad request — the input was malformed or otherwise invalid.
- `401`: Authentication failed — the API key is missing or invalid.
- `422`: Validation error — one or more fields failed validation.
- `429`: Rate limited — retry after the window resets (see Retry-After).
- `500`: Server error — something failed on our side; retry or quote X-Request-Id.

---

[API](https://skmtc.dev/mymarky/apis/marky-public-api.md) · [All operations](https://skmtc.dev/mymarky/apis/marky-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mymarky/apis/marky-public-api/revisions/25aeacae455c?raw)
