---
title: "Update User Role"
method: PATCH
path: "/api/v1/admin/users/{user_id}/role"
tags: ["admin"]
---

# Update User Role

`PATCH /api/v1/admin/users/{user_id}/role`

Update user role

## Path parameters

- `user_id` string, uuid, required — User UUID

## Request body

- UserRoleUpdate — Request body for role update
  - `role` 'admin' | 'user' | 'bot' | 'pending', required — User roles for access control

## Response `200`

Successful Response

- UserResponse — Full user information response
  - `id` string, uuid, required
  - `username` string, required
  - `avatar_url` string, nullable
  - `email` string, nullable
  - `role` string, required
  - `created_at` string, date-time, required
  - `last_login` string, date-time, nullable
  - `permissions` string[], required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/pypsa/apis/pypsa-app.md) · [All operations](https://skmtc.dev/pypsa/apis/pypsa-app/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pypsa/pypsa-app/revisions/a9fc864817c3/schema)
