---
title: "Create Api Key"
method: POST
path: "/admin/api-keys"
tags: ["API Keys"]
---

# Create Api Key

`POST /admin/api-keys`

## Request

- Base URL: `https://developer.claimmind.life` (the document declares no server; this is the origin it was published from)
- URL: `https://developer.claimmind.life/admin/api-keys`
- Auth: OAuth 2
  - Password
  - Token URL: `token`

Create a new API key for a tenant.

Access control:
- MTK Admin: Must specify tenant_id, can access any tenant
- Super Admin: Must specify tenant_id within their hospital group
- Org Admin: Uses their own tenant_id (query param ignored)

## Query parameters

- `tenant_id` string, nullable: Tenant ID to create API key for. Required for MTK Admin, optional for others.

## Request body

- APIKeyCreate: Request schema for creating a new API key.
  - `name` string, required: Human-readable name for the API key
  - `scopes` string[], required: List of permission scopes

## Response `201`

Successful Response

- APIKeyCreatedResponse: Response schema when a new API key is created (includes full key).
  - `id` integer, required
  - `description` string, required
  - `key` string, required: Full API key (only shown once)
  - `key_identifier` string, required
  - `scopes` string[], required
  - `status` string, required
  - `organization_id` string, required
  - `is_org_key` boolean, required
  - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/claimmind/apis/claimmind-open-api-service.md) - [All operations](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/revisions/ee8bfbeadb8a?raw)
