---
title: "Modify a user by id"
method: PATCH
path: "/api/v1/users/:id"
tags: ["user"]
---

# Modify a user by id

`PATCH /api/v1/users/:id`

This can only be done by a logged in user who has the required privileges.

## Path parameters

- `id` string, required

## Request body

- UserObject
  - `id` string — User Id
  - `username` string, required — Username as an email address
  - `firstname` string, required — firstname
  - `lastname` string, required — lastname
  - `status` 'active' | 'pending' | 'disabled'
  - `tenant` string
  - `roles` Role[]
    - `name` string
    - `permissions` Permissions[]
    - `scope` string
  - `permissions` Permissions[]
  - `confirmed` boolean — true, if the confirmation link/email has been triggered
  - `img` string — url to user image

## Response `200`

successful operation

## Changes

- **2021-08-06** `e366ae458db2` — 1 warning, 1 info
  - removed the request property `roles/items/description`
  - added the new optional request property `roles/items/scope`
- **2021-08-05** `bf593e163365` — 1 warning, 1 info
  - removed the request property `roles/items/scope`
  - added the new optional request property `roles/items/description`
- **2019-08-15** `42619b8ccbbe` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/openintegrationhub/apis/iam-api-for-oih/changes/api/v1/users/:id/patch.md)

---

[API](https://skmtc.dev/openintegrationhub/apis/iam-api-for-oih.md) · [All operations](https://skmtc.dev/openintegrationhub/apis/iam-api-for-oih/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openintegrationhub/iam-api-for-oih/revisions/e366ae458db2/schema)
