---
title: "Update the user account. This can only affect Username, Email (will require confirming), Roles, and Library access."
method: POST
path: "/api/Account/update"
tags: ["Account"]
---

# Update the user account. This can only affect Username, Email (will require confirming), Roles, and Library access.

`POST /api/Account/update`

## Request

- Base URL: `http://localhost:5000`
- URL: `http://localhost:5000/api/Account/update`
- Auth: API key in header `x-api-key`

Users who's Kavita.Models.Entities.User.AppUser.IdentityProvider is not Kavita.Models.Entities.Enums.IdentityProvider.Kavita cannot be edited if Kavita.Models.DTOs.Settings.OidcConfigDto.SyncUserSettings is true

## Request body

- UpdateUserDto
  - `userId` integer
  - `username` string, nullable
  - `roles` string[], nullable
  - `libraries` integer[], nullable
  - `ageRestriction` AgeRestrictionDto
    - `ageRating` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -1, required: Members: - `0` — Unknown - `1` — Rating Pending (RatingPending) - `2` — Early Childhood (EarlyChildhood) - `3` — Everyone - `4` — G - `5` — Everyone 10+ (Everyone10Plus) - `6` — PG - `7` — Kids to Adults (KidsToAdults) - `8` — Teen - `9` — MA15+ (Mature15Plus) - `10` — Mature 17+ (Mature17Plus) - `11` — M (Mature) - `12` — R18+ (R18Plus) - `13` — Adults Only 18+ (AdultsOnly) - `14` — X18+ (X18Plus) - `-1` — Not Applicable (NotApplicable)
    - `includeUnknowns` boolean, required
  - `email` string, nullable
  - `identityProvider` 0 | 1: Members: - `0` — Kavita - `1` — OpenID Connect (OpenIdConnect)

## Response `200`

OK

## Changes

- **2025-08-03** `8d18e89366d9`: 3 info
  - added the new optional request property `identityProvider` (media type: application/json)
  - added the new optional request property `identityProvider` (media type: text/json)
  - added the new optional request property `identityProvider` (media type: application/*+json)

[Operation history](https://skmtc.dev/kareadita/apis/kavita/changes/api/Account/update/post.md)

---

[API](https://skmtc.dev/kareadita/apis/kavita.md) - [All operations](https://skmtc.dev/kareadita/apis/kavita/llms.txt) - [OpenAPI document](https://skmtc.dev/kareadita/apis/kavita/revisions/d266465eeb67?raw)
