---
title: "Create API token"
method: POST
path: "/v1/auth/tokens"
tags: ["Tokens"]
---

# Create API token

`POST /v1/auth/tokens`

## Request

- Base URL: `https://api.winnr.app`
- URL: `https://api.winnr.app/v1/auth/tokens`
- Auth: HTTP bearer

Create a new API token. The full token is only returned once at creation time.
Store it securely as it cannot be retrieved again.

## Request body

- CreateTokenRequest
  - `name` string, required: Human-readable name for the token
  - `permissions` string[]

## Response `201`

Token created

- TokenCreatedResponse
  - `data` object
    - `id` string
    - `name` string
    - `token` string: Full token value (only shown once)
    - `permissions` string[]
    - `created_at` string, date-time
  - `meta` Meta
    - `request_id` string
    - `timestamp` string, date-time

## Other responses

- `400`: Validation error
- `401`: Authentication required or token invalid

---

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