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

# Update user

`PATCH /api/v1/users/{id}`

Update a user's attributes.

        Setting the "terminated" field to "true" will mark this user as terminated, preventing them from logging into the application.

        This action can be undone by setting the "terminated" field to "false".

        Terminating a user will cancel any active reviews. Archived reviews will not be affected. 

        Users who are assigned as managers cannot be terminated, please reassign their direct reports first.

        Users who are assigned as managers and have direct reports cannot have their manager role removed, please reassign their direct reports first.
        
        Users with API keys will have their keys invalidated when terminated.

## Path parameters

- `id` string, required

## Query parameters

- `include` string

## Headers

- `Content-Type` string, required

## Request body

- object
  - `data` object
    - `type` string, required
    - `id` string, required
    - `attributes` object
      - `first_name` string
      - `last_name` string
      - `employee_number` string — employee_number must be present and unique amongst all employees within your organization.
      - `username` string — username must be present and unique amongst all employees within your organization.
      - `email` string — email must be present if organization has Mitratech HQ integration enabled.
      - `hire_date` string — Please use the format YYYY-MM-DD when providing dates.
      - `base_date` string — The base date for this user's review set. Please use the format YYYY-MM-DD when providing dates.
      - `password` string
      - `must_reset_password` boolean — If this option is set to true, the user will be required to change their password on the next login regardless of whether or not you're also passing along a password.
      - `form_name` string
      - `unrecognized_form_name_action` string — Optional attribute to be included to specify what action to take if the provided 'form_name' is not found. This can be either 'blank', or 'copy'. 'blank' will create a new, empty form with the 'form_name' provided. 'copy' will require the 'form_name_for_copy' attribute to be provided and a valid existing from to use as the basis for a copy while using the 'form_name' attribute for the copied forms new name.
      - `form_name_for_copy` string — When the 'unrecognized_form_name_action' attribute is provided and set to 'copy', this field will specify the existing form to lookup and copy while using the 'form_name' attribute as the new form's name.
      - `process_name` string
      - `manager_user_id` string — This is the user id of the person who will be assigned as the manager. This can be found by searching via our index routes and referencing the `id` field that gets returned. NOTE: this person must have the manager role in order to be assigned.
      - `review_archive_date` string — Primary Review Set Archive by date.
      - `terminated` boolean — If this option is included, setting the value to true will preform any other requested updates to the user and then mark them as terminated. If the option is set to false, the system will attempt to revive a user from the terminated state to being active and then preform any other requested updates. NOTE: if you're not trying to terminate or revive a user, please leave out this option.
      - `termination_date` string — This option is only necessary and useful when including the terminated attribute and setting it to true. The results from that will mark the user as terminated and set their termination date to the one provided instead of defaulting to today's date.
      - `group_ids` unknown[] — A list of any / all group ids a user should belong to. NOTE: when updating a user, any ids that a user is currently associated with that is not included in this list will remove the user from those groups.
        - unknown
      - `group_names` unknown[] — A list of group names a user should belong to. NOTE: when updating a user, any groups that a user is currently associated with that is not included in this list will remove the user from those groups.
        - unknown
      - `roles` unknown[] — A list of any / all roles that can be attributed to a user. All users have the role of "employee" by default and that role cannot be stripped. NOTE: when updating a user, any roles that a user is currently associated with that is not included in this list will be removed.
        - unknown
      - `locale_format` string — The user's format locale. Accepted values: 'auto' (resets to default), 'en', 'en_GB', 'en_CA', 'en_AU'.
      - `locale_lang` string — The user's language locale. Accepted values: 'auto' (resets to default), 'en', 'fr_CA'.

## Response `200`

user updated

## Other responses

- `400` — missing required attributes
- `404` — user not found

---

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