---
title: "Generate User Key Endpoint"
method: POST
path: "/admin/generate-user-key"
tags: ["admin"]
---

# Generate User Key Endpoint

`POST /admin/generate-user-key`

## Request body

- UserKey — The decrypted X-Tenzir-UserKey header
  - `user_id` string, required
  - `expires` integer
  - `tenant_ids` string[], required

## Response `200`

Successful Response

- KeyResponse
  - `key` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/tenzir/apis/tenzir-platform-api.md) · [All operations](https://skmtc.dev/tenzir/apis/tenzir-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tenzir/tenzir-platform-api/revisions/1c6c33bb8ba3/schema)
