---
title: "Edit Token"
method: POST
path: "/auth/{token}/edit"
tags: ["🔑 Securing lnx"]
---

# Edit Token

`POST /auth/{token}/edit`

Edits a given token's permissions and metadata.
The payload will replace **ALL** fields which will either set or unset the
fields.

## Request body

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

## Response `200`

A payload containing the response token and other metadata.

- BasicResponse
  - `status` integer, required
  - `data` union, required
    - string
    - object

## Other responses

- `400` — The token you provided in the url does not exist.
- `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)
