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

# Create API key

`POST /v1/keys`

## Request

- Base URL: `https://api.briefgate.dev`
- URL: `https://api.briefgate.dev/v1/keys`
- Auth: HTTP bearer

Create a new API key for programmatic access. The raw key value is returned only once — store it securely. Subsequent reads return a redacted prefix only.

## Request body

- CreateKey
  - `name` string, required
  - `mode` 'live' | 'test'
  - `scopes` string[]

## Response `201`

API key created

- object
  - `id` string, required
  - `key` string, required: Full key — only returned on creation.
  - `name` string, required
  - `mode` 'live' | 'test', required
  - `scopes` string[], required
  - `created_at` string, date-time, required

## Other responses

- `400`: Invalid request — malformed body or query parameters
- `401`: Missing or invalid API key
- `403`: Authenticated but not allowed to perform this action
- `422`: Validation error — the body shape is correct but values are invalid

---

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