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

# Create API key

`POST /api/v1/me/api-keys`

## Request

- Base URL: `https://api.proof.holdings`
- URL: `https://api.proof.holdings/api/v1/me/api-keys`
- Auth: API key in cookie `auth_token`

Create a new API key. The full key value is only shown once in the response.

## Request body

- CreateAPIKeyRequest: Request body for creating an API key
  - `name` string
  - `environment` 'production' | 'test'
  - `scopes` string[]
  - `profile_id` string: Bind the key to a sub-account (PublicProfile) owned by the caller. Immutable after creation.

## Response `201`

API key created (full key shown only once)

- APIKeyCreatedResponse: A newly created or regenerated API key, with its full value — the one response that carries it.
  - `id` string, required: MongoDB ObjectId
  - `key` string, required: The full API key. Returned only in this response; it cannot be read again.
  - `name` string, required
  - `prefix` string, required
  - `environment` 'production' | 'test', required
  - `scopes` string[], required
  - `profile_id` string, required: MongoDB ObjectId
  - `created_at` string, date-time, required
  - `warning` string, required

## Other responses

- `400`: Validation error

---

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