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

# Update a user

`PATCH /v1/users/{id}`

## Request

- Base URL: `https://api.capacity.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.capacity.com/v1/users/{id}`
- Auth: one of:
  - API key in header `x-capacity-id`
  - HTTP bearer

Update a user record. If groups are provided, the user's groups will be replaced with the new set.

## Path parameters

- `id` string, required

## Request body

- UserPatchSchema
  - `email` string
  - `groups` string[], required: Ids of groups of which the user will be a member
  - `first_name` string
  - `last_name` string
  - `custom1` string, nullable: Field for storing custom user data
  - `custom2` string, nullable: Field for storing custom user data

## Response `200`

The updated user

- UserGetSchema
  - `id` string
  - `first_name` string
  - `last_name` string
  - `email` string
  - `is_deleted` unknown
  - `custom1` string, nullable
  - `custom2` string, nullable
  - `groups` GroupGetSchema[]
    - `id` string: ID of a group record
    - `name` string: The group's name
  - `attributes` UserAttributeGetSchema[]
    - `key` string: Attribute key
    - `value` string: Attribute value

## Other responses

- `404`: The requested resource could not be found

---

[API](https://skmtc.dev/capacity/apis/capacity-api-docs.md) - [All operations](https://skmtc.dev/capacity/apis/capacity-api-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/capacity/apis/capacity-api-docs/revisions/74c85bb61004?raw)
