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

# Create API key

`POST /v1/api-keys`

## Request

- Base URL: `https://api.abm.dev`
- URL: `https://api.abm.dev/v1/api-keys`
- Auth: API key in header `X-API-Key`

Generate a new API key. The plaintext `key` field is only returned once in this response — store it securely.

## Request body

- object
  - `name` string, required: Human-readable label for the key
  - `description` string: Optional long-form description
  - `environment` 'test' | 'live'
  - `scopes` string[]: Permission scopes (e.g. `enrichment:read`, `enrichment:write`). Defaults to read-only if omitted.
  - `expiresAt` string, date-time: Optional expiry timestamp
  - `allowedIpAddresses` string: Comma-separated CIDR allow-list
  - `allowedReferrers` string: Comma-separated referrer allow-list
  - `rateLimitPerMinute` integer: Override the default rate limit for this key

## Response `201`

API key created. The `key` field is shown only in this response.

- CreateApiKeyResponse
  - `id` string
  - `key` string: Plaintext API key — returned ONLY on creation/rotation. Store this securely; it cannot be retrieved again.
  - `name` string
  - `environment` 'test' | 'live'
  - `scopes` string[]
  - `createdAt` string, date-time
  - `expiresAt` string, date-time
  - `warning` string: Reminder that the plaintext key is only shown once

## Other responses

- `400`: Invalid request parameters

---

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