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

# Patch a SCIM user

> Applies partial updates to a SCIM user using SCIM PatchOp operations. Returns 200 with the updated user. Returns 204 when setting `active` to `false` on a pending invite.

Required scopes: `user_management:read-write`.

<h4 style={{borderBottom:"none"}}>Authorizations</h4>

<ParamField header="Authorization" type="string" required>
  This API uses OAuth 2.0 with the authorization code grant flow.
</ParamField>

<h4 style={{borderBottom:"none"}}>Path</h4>

<ParamField path="user_id" type="string" required>
  The workspace membership ID or workspace invite ID of the user to update.
</ParamField>

<div style={{display:"flex",justifyContent:"space-between",alignItems:"center"}}><h4 style={{borderBottom:"none",margin:"0"}}>Body</h4><span style={{fontSize:"0.75rem",fontWeight:"400",color:"#9ca3af"}}>application/json</span></div>

<ParamField body="schemas" type="string[]" required>
  Must include `"urn:ietf:params:scim:api:messages:2.0:PatchOp"`.
</ParamField>

<ParamField body="Operations" type="object[]" required>
  List of patch operations to apply sequentially.

  <Expandable title="Operations[]">
    <ParamField body="op" type="string" required>
      The operation type: `"add"`, `"replace"`, or `"remove"`. `"remove"` is only supported for `"name.givenName"` and `"name.familyName"`.
    </ParamField>

    <ParamField body="path" type="string">
      The attribute to target. Supported paths: `"name.givenName"`, `"name.familyName"`, `"active"`, `"appRole"`. May be omitted when `value` contains a keyed object.
    </ParamField>

    <ParamField body="value" type="any">
      The new value for the operation.
    </ParamField>
  </Expandable>
</ParamField>

<h4 style={{borderBottom:"none"}}>Response</h4>

Returns `200` with the updated user object (same shape as [Update a SCIM user](/rest-api/scim/update-user)). Returns `204 No Content` when setting `active` to `false` on a pending invite; deprovisioning an active member returns `200`.

<RequestExample>
  ```json Update name theme={"system"}
  {
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
      {
        "op": "replace",
        "path": "name.givenName",
        "value": "Jane"
      }
    ]
  }
  ```

  ```json Deprovision user theme={"system"}
  {
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
      {
        "op": "replace",
        "path": "active",
        "value": false
      }
    ]
  }
  ```

  ```json Promote to admin theme={"system"}
  {
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
      {
        "op": "replace",
        "path": "appRole",
        "value": "admin"
      }
    ]
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "id": "3a8f5b2c-9e14-4d7a-b832-1c6f85d90e47",
    "userName": "john.doe@example.com",
    "name": {
      "givenName": "Jane",
      "familyName": "Doe"
    },
    "emails": [
      {
        "value": "john.doe@example.com",
        "primary": true,
        "type": "work"
      }
    ],
    "appRole": "member",
    "active": true,
    "meta": {
      "resourceType": "User",
      "created": "2024-01-01T00:00:00.000Z",
      "lastModified": "2024-01-02T00:00:00.000Z"
    }
  }
  ```

  ```json 204 theme={"system"}
  {}
  ```
</ResponseExample>
