> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a User

> Create or update a user with a full request body

# Update a User

Create a user or update it if it already exists, using `PUT /v1/users` with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use `PATCH` with a JSON Patch array and the `application/json-patch+json` content type, as shown in the PATCH examples below.

## Permissions

Starting in OpenMetadata 2.0.3, updating another user's profile requires `EditAll` on that user. A request without the required permission returns `403 Forbidden`.

Adding a user to a closed team (`isJoinable: false`) requires an administrator. OpenMetadata 2.0.3 also enforces this for create-or-update (`PUT /v1/users`) requests. Keeping an existing closed-team membership in a PUT request does not count as adding a new membership. Other authorization requirements still apply.

## Body Parameters

**name** `string` *required*

Username for the user. Must be unique across the organization.

**email** `string` *required*

Email address of the user. Must be unique across the organization.

**displayName** `string`

Human-readable display name for the user.

**description** `string`

Description of the user in Markdown format.

**isBot** `boolean` (default: false)

Whether this user is a bot account.

**isAdmin** `boolean` (default: false)

Whether this user has admin privileges.

**teams** `array`

Array of team UUIDs, as strings, to assign the user to.

**roles** `array`

Array of role UUIDs, as strings, to assign to the user.

**personas** `array`

Array of persona references to assign to the user.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**profile** `object`

Profile information for the user.

**properties**

**images** `object`

Profile images for the user.

**timezone** `string`

Timezone of the user, for example `America/New_York`.

```bash PUT /v1/users theme={null}
curl -X PUT "{base_url}/api/v1/users" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "aaron_johnson0",
    "displayName": "Aaron Johnson",
    "email": "aaron_johnson0@gmail.com",
    "description": "Data analyst in the Sales team",
    "teams": ["7a2b921b-f623-4eb5-9736-649788ad842c"],
    "roles": ["761c2bb2-0b77-4bc5-9af9-cf89536d6a12"]
  }'
```

```python PATCH /v1/users/{id} theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import Users

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)

# Retrieve, modify, and update
user = Users.retrieve("77655e6e-ad33-49da-bbca-db4ba4d4e2cd")
user.description = "Senior data analyst in the Sales team"
user.displayName = "Aaron M. Johnson"
updated = Users.update(user)

print(f"Updated to version {updated.version.root}")
```

```java PATCH /v1/users/{id} theme={null}
// client is an initialized OpenMetadataClient.
var userId = "77655e6e-ad33-49da-bbca-db4ba4d4e2cd";
var user = client.users().get(userId);
user.setDescription("Senior data analyst in the Sales team");

var updated = client.users().update(userId, user);
```

```bash PATCH /v1/users/{id} theme={null}
# Update by ID
curl -X PATCH "{base_url}/api/v1/users/77655e6e-ad33-49da-bbca-db4ba4d4e2cd" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Senior data analyst in the Sales team"},
    {"op": "replace", "path": "/displayName", "value": "Aaron M. Johnson"}
  ]'

# Update by name
curl -X PATCH "{base_url}/api/v1/users/name/aaron_johnson0" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Senior data analyst in the Sales team"}
  ]'
```

```json Response theme={null}
{
  "id": "77655e6e-ad33-49da-bbca-db4ba4d4e2cd",
  "name": "aaron_johnson0",
  "fullyQualifiedName": "aaron_johnson0",
  "displayName": "Aaron M. Johnson",
  "description": "Senior data analyst in the Sales team",
  "version": 0.2,
  "updatedAt": 1769982624214,
  "updatedBy": "admin",
  "email": "aaron_johnson0@gmail.com",
  "href": "http://localhost:8585/api/v1/users/77655e6e-ad33-49da-bbca-db4ba4d4e2cd",
  "isBot": false,
  "isAdmin": false,
  "allowImpersonation": false,
  "teams": [
    {
      "id": "7a2b921b-f623-4eb5-9736-649788ad842c",
      "type": "team",
      "name": "Sales",
      "fullyQualifiedName": "Sales",
      "displayName": "Sales",
      "deleted": false
    }
  ],
  "personas": [],
  "deleted": false,
  "roles": [
    {
      "id": "761c2bb2-0b77-4bc5-9af9-cf89536d6a12",
      "type": "role",
      "name": "DataSteward",
      "fullyQualifiedName": "DataSteward",
      "displayName": "Data Steward",
      "deleted": false
    }
  ],
  "domains": []
}
```

***

## Returns

Returns the updated user object with the new version number.

## Response

**id** `string`

Unique identifier for the user (UUID format).

**name** `string`

Username.

**fullyQualifiedName** `string`

Fully qualified name (same as `name` for users).

**description** `string`

Updated description.

**version** `number`

Incremented version number.

***

## Changing Domains

Only administrators can change a user's `domains`, through `PATCH` on `/domains`, a root-level patch, or `PUT`. Other callers, including bots, get `403`.

* **Re-sending**: Sending the domains the user already holds, or none, still works for any caller with edit access.
* **Inherited domains**: Domains a user inherits from a team do not count as held. A non-admin cannot send them back.
* **Other self-edits**: Users can still update their own other fields, including `defaultDomain`.

## Listing a Team Twice

A `PATCH` request that leaves the user's `teams` list with the same team more than once is refused with a `400` error, for example `User 'jdoe' is already part of the team 'Sales'`. This is the same error that adding a team the user already belongs to returns. Remove the duplicate entry and send the request again.

## Email Address

Updates are never checked against the allowed email domains. You cannot change a user's email address with PATCH or PUT.

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid or malformed request body |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to update this user |
| `409` | `CONFLICT` | Concurrent modification detected |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.