---
title: Modify a SCIM user by ID
slug: opti-id/api/modify-a-scim-user-by-id
docTags: 
createdAt: 2026-10-01T19:58:50.958Z
---

{
  "id": "Thu6Ge2xX4AseXSSMOTjX",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://identity-api.optimizely.com/api/scim/v2/users/{id}",
    "servers": [
      {
        "url": "https://identity-api.optimizely.com/api/scim/v2/users/{id}"
      }
    ],
    "name": "Modify a SCIM user by ID",
    "description": "SCIM endpoint for modifying a user by their ID.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "ID of the user to modify."
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Details used to modify an existing user.",
          "customType": "patchRequest2",
          "schema": [
            {
              "name": "operations",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/patchOperation2Combined",
              "customType": "patchOperation2Combined[]",
              "schema": [
                {
                  "name": "value",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "integer<int32>",
                  "description": "",
                  "default": 0,
                  "format": "int32",
                  "enum": [
                    "0",
                    "1",
                    "2"
                  ]
                },
                {
                  "name": "op",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "path",
                  "kind": "optional",
                  "type": "object",
                  "description": "",
                  "modelRef": "#/components/schemas/iPath",
                  "customType": "iPath",
                  "schema": [
                    {
                      "name": "attributePath",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "schemaIdentifier",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "subAttributes",
                      "kind": "optional",
                      "type": "array",
                      "description": "",
                      "modelRef": "#/components/schemas/iFilter",
                      "customType": "iFilter[]",
                      "schema": [
                        {
                          "name": "attributePath",
                          "kind": "optional",
                          "type": "string",
                          "description": ""
                        },
                        {
                          "name": "comparisonValue",
                          "kind": "optional",
                          "type": "string",
                          "description": ""
                        },
                        {
                          "name": "comparisonValueEncoded",
                          "kind": "optional",
                          "type": "string",
                          "description": ""
                        },
                        {
                          "name": "dataType",
                          "kind": "optional",
                          "type": "integer<int32>",
                          "nullable": true,
                          "description": "",
                          "default": 0,
                          "format": "int32",
                          "enum": [
                            "0",
                            "1",
                            "2",
                            "3",
                            "4",
                            "5",
                            "6",
                            "7"
                          ]
                        },
                        {
                          "name": "filterOperator",
                          "kind": "optional",
                          "type": "integer<int32>",
                          "description": "",
                          "default": 0,
                          "format": "int32",
                          "enum": [
                            "0",
                            "1",
                            "2",
                            "3",
                            "4",
                            "5",
                            "6",
                            "7",
                            "8",
                            "9",
                            "10",
                            "11",
                            "12"
                          ]
                        },
                        {
                          "name": "additionalFilter",
                          "kind": "optional",
                          "type": "object",
                          "description": "",
                          "modelRef": "#/components/schemas/iFilter",
                          "customType": "iFilter",
                          "schema": [
                            {
                              "name": "",
                              "description": "",
                              "customType": "Circular-Reference"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "valuePath",
                      "kind": "optional",
                      "type": "object",
                      "description": "",
                      "modelRef": "#/components/schemas/iPath",
                      "customType": "iPath",
                      "schema": [
                        {
                          "name": "",
                          "description": "",
                          "customType": "Circular-Reference"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name": "schemas",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            }
          ],
          "modelRef": "#/components/schemas/patchRequest2",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiToken_auth",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The modified user.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "optiUser",
            "schema": [
              {
                "name": "name",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/optiName",
                "customType": "optiName",
                "schema": [
                  {
                    "name": "familyName",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "givenName",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  }
                ]
              },
              {
                "name": "active",
                "kind": "optional",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "meta",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/core2Metadata",
                "customType": "core2Metadata",
                "schema": [
                  {
                    "name": "resourceType",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "created",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "format": "date-time"
                  },
                  {
                    "name": "lastModified",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "format": "date-time"
                  },
                  {
                    "name": "version",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "location",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  }
                ]
              },
              {
                "name": "customExtension",
                "kind": "optional",
                "type": "map",
                "description": "",
                "example": "",
                "customType": "map<string, iDictionary_object>",
                "schema": []
              },
              {
                "name": "userName",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "externalId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "schemas",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/optiUser",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "The request was invalid or cannot be otherwise served. An accompanying error message will explain further.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "core2Error",
            "schema": [
              {
                "name": "scimType",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "",
                "format": "int32"
              },
              {
                "name": "schemas",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/core2Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized access to endpoint.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "The requested resource was not found.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "core2Error",
            "schema": [
              {
                "name": "scimType",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "",
                "format": "int32"
              },
              {
                "name": "schemas",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/core2Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "<p>A server error occurred, please try again</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "core2Error",
            "schema": [
              {
                "name": "scimType",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "",
                "format": "int32"
              },
              {
                "name": "schemas",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/core2Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "MFV4y7RLntLTqIveiw-if",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://identity-api.optimizely.com/api/scim/v2/users/{id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "YL85dPy22NBNm6R78XFsi",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://identity-api.optimizely.com/api/scim/v2/users/{id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "QFMAGym9d5x0Wu_pT_fgD",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://identity-api.optimizely.com/api/scim/v2/users/{id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "VPojTSpqXYfhD8W5WwJN6",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://identity-api.optimizely.com/api/scim/v2/users/{id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "MFV4y7RLntLTqIveiw-if"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The modified user.\n{\n  \"name\": {\n    \"familyName\": \"\",\n    \"givenName\": \"\"\n  },\n  \"active\": false,\n  \"meta\": {\n    \"resourceType\": \"\",\n    \"created\": \"\",\n    \"lastModified\": \"\",\n    \"version\": \"\",\n    \"location\": \"\"\n  },\n  \"customExtension\": \"\",\n  \"userName\": \"\",\n  \"externalId\": \"\",\n  \"id\": \"\",\n  \"schemas\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The request was invalid or cannot be otherwise served. An accompanying error message will explain further.\n{\n  \"scimType\": \"\",\n  \"detail\": \"\",\n  \"status\": \"\",\n  \"schemas\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized access to endpoint.\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// The requested resource was not found.\n{\n  \"scimType\": \"\",\n  \"detail\": \"\",\n  \"status\": \"\",\n  \"schemas\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// A server error occurred, please try again\n{\n  \"scimType\": \"\",\n  \"detail\": \"\",\n  \"status\": \"\",\n  \"schemas\": [\n    \"\"\n  ]\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}