---
title: "Create API key"
method: POST
path: "/v4/account/api-keys"
---

# Create API key

`POST /v4/account/api-keys`

Create a new API key with a name, permissions, and optional scopes (allowed_subaccounts, allowed_ips, expires_at). The full 64-character token is returned **only once** in this response — store it securely. Permission: `account:apikeys:create`.

## Request body

- object
  - `name` string, required — Human-readable label for the key.
  - `permissions` string[], required — List of permission strings. Use GET /v4/account/api-keys/allowed-permissions to see what your account can grant.
  - `allowed_subaccounts` string[] — Subaccount UUIDs this key can act on. Empty array means all subaccounts.
  - `allowed_ips` string[] — IP addresses or CIDR ranges allowed to use this key. Empty array means no IP restriction.
  - `expires_at` integer, nullable — Unix timestamp for key expiry. Must be in the future. Omit or null for no expiry.

## Response `201`

Created API key. The `data.token` field contains the 64-character secret — store it securely, it is only shown once.

- object
  - `success` boolean
  - `message` string
  - `data` object
    - `id` string, uuid
    - `token` string — 64-character secret. Only returned once at creation.
    - `name` string
    - `permissions` string[]
    - `allowed_subaccounts` string[]
    - `allowed_ips` string[]
    - `expires_at` integer, nullable
    - `created_at` integer — Unix timestamp of when the key was created.
  - `warning` string

## Other responses

- `401` — Unauthorized
- `403` — Permission not allowed for your account, or permission escalation attempt
- `422` — Validation error — invalid permissions, invalid subaccounts, invalid IPs, or no valid permissions provided
- `500` — Internal server error

---

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