# Update a user

Partially updates a user. Only provided fields are modified.
**Note:** Password can be changed via this endpoint. Same RGPD requirements apply.

Endpoint: PATCH /users/{userId}
Version: 1.6.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer opaque

## Path parameters:

  - `userId` (integer, required)
    Unique identifier of the user to update.

## Request fields (application/json):

  - `firstname` (string | null)

  - `lastname` (string | null)

  - `email` (string | null)

  - `password` (string | null)
    New password (same RGPD requirements as create).

  - `status` (integer | null)
    1 = Active, 0 = Archived

  - `agency_id` (integer | null)
    Change primary agency.

  - `agencies_list` (array | null)

  - `group_id` (integer | null)

  - `delegation` (boolean | null)

  - `phone` (string | null)

  - `mobile_phone` (string | null)

  - `gender` (string | null)

  - `user_types` (array | null)

## Response 204:

  - `204` (unknown)
    Updated successfully

## Response 403:

  - `403` (unknown)
    Access denied. The error `code` is always `FORBIDDEN`; the `message` gives the cause:
- `You do not have permission to perform this action.`
 — the access does not

hold the API pack / right required by the endpoint.
- `Insufficient scope for this request.`
 — the resource targeted by the request

(user, customer, product, agency, transaction, ...) is outside the scope of

the authenticated access.
- `Access denied for this editor.`
 /
`Your IP address has been blocked.`
 —

editor or IP restriction.

## Response 403 fields (application/json):

  - `error` (object)

  - `error.code` (string, required)

  - `error.message` (string, required)

## Response 422:

  - `422` (unknown)
    Validation failed

## Response 422 fields (application/json):

  - `error` (object)

  - `error.code` (string)
    Enum: "VALIDATION_ERROR"

  - `error.message` (string)

  - `error.details` (array)

  - `error.details.field` (string)

  - `error.details.message` (string)

## Response 403 examples:

  - `Missing API pack / right` (unknown)

  - `Resource outside the scope of the access` (unknown)

