---
title: "Mint an API token. The secret is returned once, here only."
method: POST
path: "/tokens"
tags: ["API tokens"]
---

# Mint an API token. The secret is returned once, here only.

`POST /tokens`

## Request

- Base URL: `https://www.livediagram.app/api`
- URL: `https://www.livediagram.app/api/tokens`
- Auth: HTTP bearer

## Request body

- object
  - `name` string

## Response `201`

Success.

- object
  - `token` string, required: The secret, shown once.
  - `id` string, required
  - `name` string, nullable
  - `expiresAt` number, required

## Other responses

- `400`: Error.
- `401`: Error.
- `409`: Error.
- `429`: Rate limited. Back off and retry.

---

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