SCIM PATCH requests: safely change selected user or group attributes
SCIM PATCH is the RFC 7644 procedure for applying ordered `add`, `remove`, or `replace` operations to part of an existing User or Group resource. Confirm that the target supports PATCH, and validate the `schemas` and `Operations` envelope, schema mutability rules, and atomic failure behavior. SCIM PATCH is not JSON Patch: do not send JSON Patch syntax such as array indexes or `move`.
SCIM PATCH requests: safely change selected user or group attributes
SCIM PATCH is the RFC 7644 procedure for applying ordered add, remove, or replace operations to part of an existing User or Group resource. Confirm that the target supports PATCH, and validate the schemas and Operations envelope, schema mutability rules, and atomic failure behavior. SCIM PATCH is not JSON Patch: do not send JSON Patch syntax such as array indexes or move.
Request structure
A SCIM PATCH request contains:
`schemas`: `urn:ietf:params:scim:api:messages:2.0:PatchOp`
`Operations`: an array of one or more operations. Each has `op`, an optional `path`, and a `value` when needed.
A URL identifying the SCIM resource to change, such as `/Users/{id}` or `/Groups/{id}`.
PATCH /Groups/group-123 HTTP/1.1
Content-Type: application/scim+json
If-Match: W/"version-from-get"
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [
{
"op": "remove",
"path": "members[value eq \"user-456\"]"
}
]
}This illustrates the structure; the ID and version are not values returned by a real service. RFC 7644 supports conditional updates with If-Match; obtain the current meta.version/ETag first. Check the target's documentation and /ServiceProviderConfig for feature support.
Operations and path interpretation
| Operation | Purpose | Caution |
|---|---|---|
add | Add an attribute or a value to a multi-valued attribute | For a single-valued attribute that already has a value, the existing value may be replaced under schema and server rules. |
remove | Remove an attribute or matching multi-valued item | Requires path; no matching target can produce an error. |
replace | Replace an existing attribute or value | Without path, the request may replace specified attributes in the body; other unspecified attributes are not affected. |
Paths can name an attribute such as name.familyName, a value filter such as members[value eq "…"], or a filtered subattribute such as addresses[type eq "work"].streetAddress. SCIM does not define JSON array-index addressing. An attribute declared readOnly in the schema cannot be changed. An immutable attribute can be added only when it has no existing value; once set, it cannot be changed. Do not modify extensions the target does not allow.
Handle failures and concurrent changes
RFC 7644 applies multiple PATCH operations in order, but the request as a whole is atomic. If any operation fails, the server must restore the original resource state and return an error. A successful response may be 200 with the full resource or, depending on the response preference, 204; integrations should not assume one success code.
Distinguish `noTarget` (a filter found no match), `invalidPath`, and schema or value errors in diagnostics.
Do not infer the final state from a success code alone. After an important group change, compare with a GET or the next synchronization result.
If a source system and an administrator may update concurrently, use ETag/`If-Match`. After a version conflict such as 412, read the latest resource and reapply only the approved difference.
If a network timeout leaves the outcome unknown, do not blindly repeat the same PATCH. Read the resource and retry toward the desired state.
If PATCH is unsupported, check the product's documented alternative, such as PUT. PUT may replace the entire resource representation and is not interchangeable with PATCH.
References
IETF, [RFC 7644 §3.5.2: Modifying with PATCH](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2)
IETF, [RFC 7643: SCIM Core Schema](https://www.rfc-editor.org/rfc/rfc7643.html)