---
title: "Update User"
method: PATCH
path: "/v4/organizations/{organizationId}/users/{userId}"
tags: ["Users"]
---

# Update User

`PATCH /v4/organizations/{organizationId}/users/{userId}`

Updates organizationRole and resources of the user.

In order to access this endpoint, the provided API key must have at least one of the following roles:
- Organization Owner
- Project Owner

An Organization Owner API key can be utilized to update organizational-level roles and project-level roles for all projects within the organization.

The Project Owner API key allows for updating project-level roles, solely within the projects where the API key holds the Project Owner role.

The modification of any personal information related to a user, such as password updates, can only be performed by the respective user through the user interface (UI).

The results are always limited by the role and scope of the caller's privileges.
To learn more about the roles, see [Organization Roles](https://docs.couchbase.com/cloud/organizations/organization-user-roles.html) and [Project Roles](https://docs.couchbase.com/cloud/projects/project-roles.html).

## Request body

- PatchEntry[]
  - `op` 'add' | 'remove', required — Type of operation.
  - `path` string, required — Path of resource that needs to be updated. Organization Roles: `/organizationRoles` Resources: `/resources/{resourceId}` Resource Roles: `/resources/{resourceId}/roles`
  - `value` union
    - OrganizationRoles[]
    - ProjectRoles[]
    - Resource
      - `type` 'project' — Type of the resource.
      - `id` string, uuid, required — Id of the project.
      - `roles` ProjectRoles[], required

## Response `200`

Successfully updated the user metadata.

- GetUserResponse
  - `id` string, required — The UUID of the user created.
  - `name` string, required — The name of the user.
  - `email` string, required — Email of the user.
  - `status` 'verified' | 'not-verified' | 'pending-primary', required — Depicts user status whether they are verified or not. - verified: It reflects a verified state for an email address where the user has proven that they have access to the email account. - not-verified: It reflects an unverified or pending verification state. - pending-primary: It reflects an unverified primary email address
  - `inactive` boolean, required — Depicts whether the user has accepted the invite for the organization.
  - `organizationId` string, required — A GUID4 identifier of the tenant.
  - `organizationRoles` OrganizationRoles[], required
  - `lastLogin` string, date-time — Time(UTC) at which user last logged in.
  - `region` string — Region of the user.
  - `timeZone` string — Time zone of the user.
  - `enableNotifications` boolean — After enabling email notifications for your account, you will start receiving email notification alerts from all databases in projects you are a part of.
  - `expiresAt` string, date-time — Time at which user expires.
  - `resources` Resource[]
    - `type` 'project' — Type of the resource.
    - `id` string, uuid, required — Id of the project.
    - `roles` ProjectRoles[], required
  - `audit` CouchbaseAuditData, required
    - `createdBy` string, required — The user who created the resource; this will be a UUID4 ID for standard users and will be a string such as "internal-support" for internal Couchbase support users.
    - `createdAt` string, date-time, required — The RFC3339 timestamp associated with when the resource was initially created.
    - `modifiedBy` string, required — The user who last modified the resource; this will be a UUID4 ID for standard users and wilmal be a string such as "internal-support" for internal Couchbase support users.
    - `modifiedAt` string, date-time, required — The RFC3339 timestamp associated with when the resource was last modified.
    - `version` integer, required — The version of the document. This value is incremented each time the resource is modified.

## Other responses

- `403` — The client does not have the necessary permissions to access this resource.
- `404` — The requested resource was not found.
- `422` — Request validation error.
- `429` — Returned when the client exceeds the rate limit for the given APIKey.
- `500` — An unexpected error occurred in the server while processing this request.

---

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