---
title: "Edit a user"
method: PUT
path: "/users/{userId}"
tags: ["users"]
---

# Edit a user

`PUT /users/{userId}`

## Request

- Base URL: `https://pmp-demo.privateplatform.mendix.com/userservice/v1`
- URL: `https://pmp-demo.privateplatform.mendix.com/userservice/v1/users/{userId}`
- Auth: API key in header `Authorization`

## Use this operation to edit a user

- If a field is omitted in the request body, it is not updated. To set field to empty specify with empty string.

## Path parameters

- `userId` string, required

## Request body

- UserInput: User creation request
  - `name` string, required: User name.
  - `fullName` string, required: User full name.
  - `email` string, email, required: User's Email.
  - `company` string: The company that use belongs to.
  - `department` string: The department that use belongs to.
  - `unit` string: The unit that use belongs to.
  - `team` string: The team that use belongs to.
  - `aux1` string: User's auxiliar info 1.
  - `aux2` string: User's auxiliar info 2.
  - `userRoles` object[], required: User roles.
    - `role` 'User' | 'SystemAdmin' | 'CompanyAdmin', required: User role.
  - `blocked` boolean: User is blocked (can not login).

## Response `200`

User

- object
  - `id` string
  - `name` string
  - `fullName` string
  - `email` string
  - `isLocalUser` boolean
  - `active` boolean
  - `firstLoginTime` string
  - `lastLogin` string
  - `approved` boolean
  - `emailVerified` boolean
  - `onboarded` boolean
  - `roles` object[]
    - `role` string
  - `blocked` boolean

## Other responses

- `400`: Invalid input parameter or request body
- `401`: Authentication information is missing or invalid
- `403`: User has no permission for this operation
- `404`: Resource not found

---

[API](https://skmtc.dev/mendix/apis/user-service.md) - [All operations](https://skmtc.dev/mendix/apis/user-service/llms.txt) - [OpenAPI document](https://skmtc.dev/mendix/apis/user-service/revisions/eec46375b41a?raw)
