---
title: "Create API key for entity"
method: POST
path: "/api/v1/entities/{id}/api-keys"
tags: ["entities"]
---

# Create API key for entity

`POST /api/v1/entities/{id}/api-keys`

Generate a new API key for the entity. API keys are used for programmatic
      access to the auction system.

## Path parameters

- `id` string, required

## Request body

- CreateApiKeyDto
  - `name` string, required — Human-readable name for the API key
  - `description` string — Description of the API key usage
  - `scopes` string[], required — Scopes/permissions for the API key
  - `expiresAt` string, date-time, nullable — Expiration date for the API key (optional, null for no expiration)

## Response `201`

API key created successfully

- ApiKeyResponseDto
  - `id` string, required — Unique API key identifier
  - `entityId` string, required — Entity ID that owns this API key
  - `name` string, required — Human-readable name for the API key
  - `description` string — Description of the API key usage
  - `keyPrefix` string, required — API key prefix (for identification)
  - `key` string — Full API key (only returned on creation)
  - `scopes` string[], required — Scopes/permissions for the API key
  - `status` 'active' | 'revoked' | 'expired', required — API key status
  - `createdAt` string, date-time, required — API key creation timestamp
  - `expiresAt` string, date-time, nullable — API key expiration timestamp
  - `lastUsedAt` string, date-time — Last usage timestamp
  - `totalRequests` number, required — Total number of requests made with this key
  - `currentWindowRequests` number, required — Number of requests in the current rate limit window
  - `rateLimit` number, required — Rate limit for this API key (requests per hour)
  - `isActive` boolean, required — Whether API key is currently active and valid
  - `hasExpired` boolean, required — Whether API key has expired
  - `isNearRateLimit` boolean, required — Whether API key is approaching rate limit
  - `daysUntilExpiration` number, nullable, required — Days until expiration (null if no expiration)

## Other responses

- `403` — Not authorized to create API key for this entity
- `404` — Entity not found

---

[API](https://skmtc.dev/manifoldfinance/apis/eigenlayer-public-api-specification.md) · [All operations](https://skmtc.dev/manifoldfinance/apis/eigenlayer-public-api-specification/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/manifoldfinance/eigenlayer-public-api-specification/revisions/068b24703dfe/schema)
