---
title: "POST /core/tokens/{identifier}/set_key/"
method: POST
path: "/core/tokens/{identifier}/set_key/"
tags: ["core"]
---

# POST /core/tokens/{identifier}/set_key/

`POST /core/tokens/{identifier}/set_key/`

Set token key. Action is logged as event. `authentik_core.set_token_key` permission
is required.

## Path parameters

- `identifier` string, required

## Request body

- TokenSetKeyRequest — Set token's key
  - `key` string, required

## Response `204`

Successfully changed key

## Other responses

- `400` — Missing key
- `403`
- `404` — Token not found or expired

---

[API](https://skmtc.dev/goauthentik/apis/authentik.md) · [All operations](https://skmtc.dev/goauthentik/apis/authentik/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goauthentik/authentik/revisions/4e42e86021d7/schema)
