Updates an existing user's information
Supported Fields
name (object)
- Onlyreplace
op supportedgivenName (string)
- requiredfamilyName (string)
- required
active (bool)
- Onlyreplace
op supportedroles (list[string])
- All three ops(add, remove, replace)
are supported. For the full list of supported role values, please refer to the List Roles endpoint.
Patching Multiple Attributes
Patching Multiple Attributes in a Single Request
When updating multiple attributes of a resource in SCIM, you can choose between different approaches. Each approach has its advantages depending on the nature of the updates and the operation to be performed.
Approach 1: Provide Each Attribute as a Separate Op
In this approach, each attribute update is treated as an independent operation. Each "op" (operation)
targets a specific attribute and performs the update independently of other attributes. This method is useful when the updates are not related or need to be executed separately.
Sample Request Payload:
{
"schemas": "urn:ietf:params:scim:api:messages:2.0:PatchOp",
"Operations": [
{
"op": "replace",
"path": "name",
"value": {
"givenName": "John",
"familyName": "Doe"
}
},
{
"op": "replace",
"path": "active",
"value": false
},
{
"op": "replace",
"path": "roles",
"value": [
"hiring_manager",
"project_manager"
]
}
]
}
Approach 2: Provide All Attributes in a Single Op
In this approach, you bundle all the updates to different attributes into a single operation, which must be processed together as a single unit. In this case, all attributes follow the same operation type, for instance, using a replace
operation for all attributes.
Sample Request Payload:
{
"schemas": "urn:ietf:params:scim:api:messages:2.0:PatchOp",
"Operations": [
{
"op": "replace",
"value": {
"name": {
"givenName": "John",
"familyName": "Doe"
},
"active": false,
"roles": [
"hiring_manager",
"project_manager"
]
}
}
]
}
Remove Operation
The "remove"
operation is used to remove specific values from multi-valued attributes, such as roles. The behavior of this operation depends on whether a filter is applied to the path.
No Filter Present
If no filter is applied in the path, the operation will remove all values associated with the multi-valued attribute (e.g., all roles associated with the user).
Sample Request Payload (No Filter):
{
"schemas": "urn:ietf:params:scim:api:messages:2.0:PatchOp",
"Operations": [
{
"op": "remove",
"path": "roles"
}
]
}
Filter Present
If a filter is applied to the path, only the values that match the filter criteria will be removed. This is useful when you need to remove specific roles or other multi-valued attributes.
Sample Request Payload (With Filter):
{
"schemas": "urn:ietf:params:scim:api:messages:2.0:PatchOp",
"Operations": [
{
"op": "remove",
"path": "roles[value eq \"recruiter\" or value eq \"project_manager\"]"
}
]
}