---
title: "Creates a new Auth Key for a user."
method: POST
path: "/api/Account/create-auth-key"
tags: ["Account"]
---

# Creates a new Auth Key for a user.

`POST /api/Account/create-auth-key`

## Request body

- RotateAuthKeyRequestDto
  - `keyLength` integer, required
  - `name` string, required
  - `expiresUtc` string, nullable

## Response `200`

OK

- AuthKeyDto
  - `id` integer
  - `key` string, nullable, required
  - `name` string, nullable, required
  - `createdAtUtc` string, date-time
  - `expiresAtUtc` string, date-time, nullable
  - `lastAccessedAtUtc` string, date-time, nullable
  - `provider` 0 | 1 — Members: - `0` — User - `1` — System

---

[API](https://skmtc.net/kareadita/apis/kavita.md) · [All operations](https://skmtc.net/kareadita/apis/kavita/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kareadita/kavita/revisions/a092f0284f3e/schema)
