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

# Create a new API key

`POST /api/credentials/keys`

Create a new named API key for the authenticated user. The full token is returned only in this response - it cannot be retrieved again.

## Request body

- CreateKeySchema
  - `name` string, required — A descriptive name for the key

## Response `201`

API key created. The full token is only returned in this response.

- ApiKeyCreatedSchema
  - `created` string, date-time
  - `heron_id` string
  - `is_active` boolean
  - `name` string
  - `token` string — Full token - shown only once
  - `token_prefix` string

## Other responses

- `400` — Invalid request

---

[API](https://skmtc.dev/herondata/apis/heron-data-api.md) · [All operations](https://skmtc.dev/herondata/apis/heron-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/herondata/heron-data-api/revisions/f2e441edece2/schema)
