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

# Create API key

`POST /api-keys`

Creates a company-scoped API key. The caller must have the `api_keys:manage` permission. Account-scoped keys select the target company with the x-company-id header; companyId in the JSON body is not a supported selector. The plain key is returned only once.

## Request body

- object
  - `name` string — Human-readable key name.
  - `preset` 'full_access' | 'read_only' | 'agent_safe' | 'ai_drafting' | 'data_ingest_safe' | 'data_ingest_automations' | 'transactional_sender' | 'marketing_sender' — Permission preset to apply when scopes is omitted. Defaults to full_access. Full-access keys are stored with scopes set to null, meaning all current and future permissions.
  - `scopes` string[] — Explicit permission scopes for the new key. Overrides preset when provided.

## Response `200`

API key created

- object
  - `success` boolean
  - `apiKey` object
    - `id` string
    - `name` string
    - `key` string — Plain API key. This is shown only on creation.
    - `prefix` string
    - `scopes` string[], nullable — Explicit permission scopes, or null for full access.
    - `permissions` object — Effective permission receipt for the newly created key. Only scopes set to null grant current and future full access.
      - `preset` string — Effective preset derived from the stored scopes. An explicit all-current-scopes array is custom, not full_access.
      - `fullAccess` boolean
      - `selectedScopeCount` integer
      - `currentScopeCount` integer
      - `description` string
    - `createdAt` string, date-time
  - `message` string
  - `instructions` object

## Other responses

- `400` — Invalid permission preset or scope list
- `401` — Unauthorized
- `403` — Missing required API key management permission
- `500` — API key could not be created

---

[API](https://skmtc.net/sequenzy/apis/sequenzy-api.md) · [All operations](https://skmtc.net/sequenzy/apis/sequenzy-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sequenzy/sequenzy-api/versions/af1cf9620482/schema)
