---
title: "Mint an API key"
method: POST
path: "/v1/admin/keys"
tags: ["admin"]
---

# Mint an API key

`POST /v1/admin/keys`

## Request

- Base URL: `https://api.ticexplorer.com`
- URL: `https://api.ticexplorer.com/v1/admin/keys`
- Auth: HTTP bearer

Returns the secret once; only its sha256 hash is stored.

## Request body

- KeyRequest
  - `name` string, required: Who/what the key is for.
  - `scopes` string[]
  - `user_id` string, nullable: Owning account for usage/billing (default: the key name).

## Response `201`

Successful Response

- ApiKeyCreated
  - `id` string, required
  - `name` string, required
  - `scopes` string[], required
  - `key` string, required: The secret. Shown once; only a hash is stored.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `429`: Too Many Requests

---

[API](https://skmtc.dev/ticexplorer/apis/tic-explorer-api.md) · [All operations](https://skmtc.dev/ticexplorer/apis/tic-explorer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ticexplorer/apis/tic-explorer-api/revisions/9800d20135b9?raw)
