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

# Create new API key

`POST /api/v1/auth/api-keys`

Create a new API key with specified permissions and optional expiration. Requires authentication with admin permissions.

## Request body

- object
  - `name` string, required — API key name
  - `permissions` string[], required — API key permissions
  - `expiresAt` number — Expiration timestamp
  - `description` string — API key description
  - `rateLimitOverride` object — Custom rate limits for this key
    - `requestsPerMinute` integer
    - `requestsPerHour` integer
    - `requestsPerDay` integer
  - `metadata` object — Additional metadata

## Response `201`

API key created successfully

- object
  - `success` true, required
  - `timestamp` number, required
  - `apiKey` object, required
    - `id` string, required — API key identifier
    - `name` string, required — API key name
    - `permissions` string[], required — API key permissions
    - `createdAt` number, required — Creation timestamp
    - `lastUsed` number — Last usage timestamp
    - `expiresAt` number — Expiration timestamp
    - `isActive` boolean, required — Key status
    - `key` string, required — The actual API key value (only shown once)
    - `keyPreview` string, required — Preview of the key (last 8 characters)
  - `message` string, required — Success message
  - `securityReminder` string, required — Security reminder message

## Other responses

- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - Insufficient permissions
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error

---

[API](https://skmtc.net/manifoldfinance/apis/xga-auction-system-api.md) · [All operations](https://skmtc.net/manifoldfinance/apis/xga-auction-system-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/manifoldfinance/xga-auction-system-api/revisions/329190dccb50/schema)
