---
title: "Create a CLI token"
method: POST
path: "/api/cli-tokens"
tags: ["Authentication"]
---

# Create a CLI token

`POST /api/cli-tokens`

Create a new CLI token for API access. The plain token value is returned only once in the response — store it securely.

## Request body

- object
  - `name` string, required — Human-readable token name
  - `expiresIn` integer — Optional expiration duration in seconds (min 3600 = 1 hour, max 31536000 = 1 year)

## Response `201`

Token created. The `key` field contains the plain token — store it securely, it cannot be retrieved again.

- object
  - `success` boolean
  - `token` object
    - `id` string, uuid
    - `name` string
    - `key` string — Plain token value (shown only once)
    - `start` string — Display prefix for identification
    - `enabled` boolean
    - `expiresAt` string, date-time, nullable
    - `createdAt` string, date-time

## Other responses

- `401` — Authentication required or token invalid
- `409` — Duplicate token name within this project

---

[API](https://skmtc.dev/supercheck-io/apis/supercheck-api.md) · [All operations](https://skmtc.dev/supercheck-io/apis/supercheck-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/supercheck-io/supercheck-api/revisions/81782deccf0e/schema)
