---
title: "Create Key"
method: POST
path: "/v1/auth/keys"
tags: ["auth"]
---

# Create Key

`POST /v1/auth/keys`

## Request

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

## Query parameters

- `name` string

## Headers

- `authorization` string, nullable
- `X-API-Key` string, nullable

## Response `201`

Successful Response

- ApiKeyCreated
  - `id` string, required
  - `name` string, required
  - `prefix` string, required
  - `createdAt` string, date-time, required
  - `lastUsedAt` string, date-time, nullable, required
  - `revoked` boolean, required
  - `key` string, required: Shown once. Store it now.

## Other responses

- `422`: Validation Error

---

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