---
title: "Create Token"
method: POST
path: "/auth"
tags: ["🔑 Securing lnx"]
---

# Create Token

`POST /auth`

Creates a new access token with a given set of metadata.

## Request body

- CreateTokenPayload
  - `permissions` integer, required
  - `user` string
  - `description` string
  - `allowed_indexes` string[]

## Response `200`

A payload containing the response token and other metadata.

- TokenResponse
  - `status` integer, required
  - `data` TokenData, required
    - `permissions` integer, required
    - `user` string
    - `description` string
    - `allowed_indexes` string[]
    - `created` string, date-time, required
    - `token` string, required

## Other responses

- `401` — You lack the permissions to run this operation.
- `422` — The server was unable to deserialize the payload given.

---

[API](https://skmtc.dev/lnx-search/apis/lnx-docs.md) · [All operations](https://skmtc.dev/lnx-search/apis/lnx-docs/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lnx-search/lnx-docs/revisions/3ff2d4054379/schema)
