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

# Create a new API key

`POST /api/api-keys/`

## Request

- Base URL: `https://api.auravms.com`
- URL: `https://api.auravms.com/api/api-keys/`
- Auth: HTTP bearer

Returns the raw key ONCE. Save it immediately.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `name` string, required
  - `scopes` string
  - `expires_in_days` integer

## Response `200`

API key created

- object
  - `success` boolean
  - `key` string: Raw key - save immediately
  - `id` integer
  - `name` string
  - `key_prefix` string
  - `scopes` string[]

## Other responses

- `409`: Idempotency key is processing or was already used with a different request body

---

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