---
title: "Update user"
method: PATCH
path: "/users/{id}"
tags: ["Users"]
---

# Update user

`PATCH /users/{id}`

## Path parameters

- `id` integer, required

## Query parameters

- `skipWebhook` boolean

## Headers

- `x-organization-id` integer

## Request body

- object
  - `firstName` string
  - `lastName` string
  - `email` string, nullable
  - `phoneNumber` string, nullable
  - `role` 'ADMIN' | 'MEMBER' | 'OPERATOR' | 'REQUESTER' | 'SERVICE_ACCOUNT', nullable
  - `customRole` string, nullable — Custom role name if the user has a custom role assigned
  - `authType` 'NORMAL' | 'SAML' | 'OIDC', nullable
  - `externalData` union — Extra data that can be attached to the user, for example to help reference to a matching record in an external system.
    - object
    - number
    - string
  - `extraFields` object — Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: "Department")
  - `hourlyRate` integer, nullable — Cost in cents. For example, for $1.20, put 120. Set to `null` to set the user's rate to organization default hourly rate if defined, otherwise it would set the rate to the user's hourly rate defined in any work order. If none is defined, setting `null` will set the user's hourly rate to `null`

## Response `200`

Successfully edited user

- object
  - `user` object, required
    - `id` integer, required — Global ID of the user
    - `firstName` string
    - `lastName` string
    - `role` 'ADMIN' | 'MEMBER' | 'OPERATOR' | 'REQUESTER' | 'SERVICE_ACCOUNT', nullable
    - `customRole` string, nullable — Custom role name if the user has a custom role assigned
    - `email` string, nullable
    - `phoneNumber` string, nullable
    - `removedFromOrganization` boolean
    - `authType` 'NORMAL' | 'SAML' | 'OIDC', nullable
    - `hourlyRate` integer, nullable — Cost in cents. For example, for $1.20, the value will be 120. If the hourly rate is not set specifically for the user, the API will return the default organization hourly rate, if that is also not set, it will return the hourly rate that is specifically set for the user in any work order. Otherwise, it would be `undefined`
    - `externalData` union — Extra data that can be attached to the user, for example to help reference to a matching record in an external system.
      - object
      - number
      - string
    - `extraFields` object — Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: "Department")
    - `lastVisitedAt` string, date-time, nullable — Last time the user visited this organization. Scoped to the organization the request is made against. `null` if the user has never visited (e.g. an invited user who has not yet accepted). For service accounts, returns the organization-user creation date.
    - `createdAt` string, date-time, nullable — When the user was added to this organization. Scoped to the organization the request is made against. `null` if the user is no longer part of the organization.

## Other responses

- `400` — OrganizationId was not provided
- `401` — Invalid token
- `403` — Cannot edit Auth Type
- `404` — Could not find the specified user.

---

[API](https://skmtc.net/getmaintainx/apis/maintainx-api.md) · [All operations](https://skmtc.net/getmaintainx/apis/maintainx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getmaintainx/maintainx-api/revisions/ef9153fcac7c/schema)
