PATCH /v1/users/{id}
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}")
import static org.openmetadata.sdk.fluent.Users.*;
// Retrieve, modify, and update
var user = Users.retrieve("77655e6e-ad33-49da-bbca-db4ba4d4e2cd");
user.setDescription("Senior data analyst in the Sales team");
var updated = Users.update(user);
# 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"}
]'
{
"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": []
}
Update a User
Update user properties using JSON Patch
PATCH
/
v1
/
users
/
{id}
PATCH /v1/users/{id}
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}")
import static org.openmetadata.sdk.fluent.Users.*;
// Retrieve, modify, and update
var user = Users.retrieve("77655e6e-ad33-49da-bbca-db4ba4d4e2cd");
user.setDescription("Senior data analyst in the Sales team");
var updated = Users.update(user);
# 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"}
]'
{
"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": []
}
Update a User
Update a user’s properties using JSON Merge Patch. You can update by ID or by fully qualified name.Update by ID
UUID of the user to update.
Update by Name
UsePATCH /v1/users/name/{fqn} to update by fully qualified name.
Fully qualified name of the user (e.g.,
aaron_johnson0).Body Parameters
Send a JSON object with the fields to update. Only provided fields are changed.Updated display name.
Updated description in Markdown format.
Updated email address.
Updated admin status.
Updated domain FQN.
Updated profile information.
PATCH /v1/users/{id}
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}")
import static org.openmetadata.sdk.fluent.Users.*;
// Retrieve, modify, and update
var user = Users.retrieve("77655e6e-ad33-49da-bbca-db4ba4d4e2cd");
user.setDescription("Senior data analyst in the Sales team");
var updated = Users.update(user);
# 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"}
]'
{
"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
Unique identifier for the user (UUID format).
Username.
Fully qualified name (same as
name for users).Updated description.
Incremented version number.
Error Handling
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid JSON patch or malformed request |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to update this user |
404 | NOT_FOUND | User with given ID or FQN does not exist |
409 | CONFLICT | Concurrent modification detected |
Was this page helpful?
⌘I