---
title: "Create an API key"
method: POST
path: "/auth/keys"
tags: ["Auth"]
---

# Create an API key

`POST /auth/keys`

## Request

- Base URL: `https://api.companystack.co.uk`
- URL: `https://api.companystack.co.uk/auth/keys`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`

Returns the full key once. Free accounts can hold 3 active keys, Starter 5, Business 10.

## Request body

- object
  - `name` string

## Response `201`

New key (shown once)

## Other responses

- `400`: Key limit reached or invalid name
- `401`: API key missing, malformed or revoked
- `403`: The key's plan does not include this endpoint (`code: plan_upgrade_required`, with `upgrade_url`), the key may not call it, or the key is beyond the plan's key limit after a downgrade (`code: key_limit_exceeded`: the newest keys are paused until keys are deleted or the plan upgraded)

---

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