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

# Create Api Key

`POST /api/v1/api-keys`

## Request

- Base URL: `https://api.trueight.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.trueight.com/api/v1/api-keys`
- Auth: HTTP bearer

Create a new API key. The raw key is returned in the response body
exactly once — store it securely. It cannot be retrieved later.

## Request body

- CreateAPIKeyRequest
  - `name` string, required: Label for this key

## Response `201`

Successful Response

- APIKeyCreatedResponse: Returned once at creation. The raw `key` is never shown again — store it securely.
  - `id` string, required: API key database ID
  - `key` string, required: Full API key (shown once). Format: tru8_sk_<32 hex chars>. Store securely — it cannot be retrieved later.
  - `key_prefix` string, required: Key prefix for identification (e.g. tru8_sk_a1b2)
  - `name` string, required: Label for this key
  - `created_at` string, date-time, required: Creation timestamp

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/trueight/apis/tru8-evidence-research-api.md) · [All operations](https://skmtc.dev/trueight/apis/tru8-evidence-research-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trueight/apis/tru8-evidence-research-api/revisions/5684065fa01a?raw)
