---
title: "Edit User"
method: PATCH
path: "/users/{userId}"
tags: ["Users"]
---

# Edit User

`PATCH /users/{userId}`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/users/{userId}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/docs/users/:userId/patch.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `user` (Read and Write).

## Path parameters

- `userId` integer, required

## Request body

- UserOperation[]: A JSON Patch document as defined by <a href="https://tools.ietf.org/html/rfc6902#section-3" target="_blank">RFC 6902</a>
  - `value` string, required
  - `op` 'replace', required: Patch operation to perform
  - `path` '/firstName' | '/lastName' | '/timezone' | '/status' | '/adminAccess' | '/avatarStorageId', json-pointer, required: A JSON Pointer as defined by <a href="https://tools.ietf.org/html/rfc6901" target="_blank">RFC 6901</a>

## Response `200`

User was successfully updated

- UserResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` EnterpriseUserAdminContextResponseModel, required
    - `id` integer: User Identifier
    - `username` string
    - `firstName` string, nullable: First Name
    - `lastName` string, nullable: Last Name
    - `avatarUrl` string: User Avatar
    - `fields` EnterpriseAdditionalFields: Fields. Keys get via [List Fields](#operation/api.fields.getMany)
    - `isAdmin` boolean
    - `status` 'active' | 'pending' | 'blocked': User Status
    - `createdAt` string, date-time
    - `lastSeen` string, date-time, nullable
    - `email` string
    - `emailVerified` boolean
    - `twoFactor` 'enabled' | 'disabled'
    - `timezone` string, nullable
    - `joinDetails` object, nullable
      - `type` string
      - `invitedBy` object, nullable
        - `id` integer
        - `username` string
        - `fullName` string
        - `avatarUrl` string
    - `deviceVerification` 'enabled' | 'disabled'
    - `trustedDevicesCount` integer
    - `apiTokensCount` integer
    - `loginMethods` string[]
    - `mfaMethods` string[]

## Other responses

- `400`: Invalid Request Body
- `401`: Unauthorized
- `403`: Forbidden
- `404`: User with specified id was not found
- `405`: Method Not Allowed
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/revisions/dc68744c5384?raw)
