---
title: "user role"
method: PATCH
path: "/v1/users/{usernames}/role"
tags: ["v1", "users"]
---

# user role

`PATCH /v1/users/{usernames}/role`

#### Controller: 

`github.com/ubccr/grendel/internal/api.(*Handler).UserRole`

#### Middlewares:

- `github.com/go-fuego/fuego.defaultLogger.middleware`
- `github.com/ubccr/grendel/internal/api.(*Handler).authMiddleware`

---

Update users role

## Path parameters

- `usernames` string, required

## Headers

- `Accept` string

## Request body

- UserRoleRequest — UserRoleRequest schema
  - `role` string — type of model.Role, valid options: disabled, user, admin

## Response `200`

OK

- GenericResponse — GenericResponse schema
  - `changed` integer
  - `detail` string
  - `title` string

## Other responses

- `default` — Default Error

---

[API](https://skmtc.net/ubccr/apis/grendel-api.md) · [All operations](https://skmtc.net/ubccr/apis/grendel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ubccr/grendel-api/versions/cd871b115a7b/schema)
