---
title: Update a User object
slug: update-a-user-object
docTags: 
createdAt: 2023-11-07T15:25:31.944Z
---

{
  "id": "VsUw7b2vZ5P__1SW1Sw_2",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://example.com/scim/v2/Users/{urn}",
    "servers": [
      {
        "url": "https://example.com/scim/v2/Users/{urn}",
        "description": "Jobylon Staging"
      }
    ],
    "name": "Update a User object",
    "description": "<p>Update a User, replacing all editable fields. Can be used for deprovisioning and reprovisioning users using the <code>active</code> field.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "urn",
          "type": "string",
          "description": "<p>User's URN in the \"urn:jobylon:scim:&#x3C;customer_id>:users:&#x3C;user_id>\" format</p>"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "User with editable attributes",
          "customType": "BaseUser",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "string",
              "description": "User's URN in the \"urn:jobylon:scim:<customer_id>:users:<user_id>\" format",
              "example": ""
            },
            {
              "name": "schemas",
              "kind": "optional",
              "type": "array",
              "description": "Schemas",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": ""
            },
            {
              "name": "externalId",
              "kind": "optional",
              "type": "string",
              "description": "The IdP's identifier",
              "example": ""
            },
            {
              "name": "userName",
              "kind": "optional",
              "type": "string",
              "description": "User's username",
              "example": ""
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "object",
              "description": "User name",
              "example": "{\"givenName\":\"Anna\",\"familyName\":\"Svensson\",\"formatted\":\"Anna Svensson\"}",
              "modelRef": "#/components/schemas/Name",
              "customType": "Name",
              "schema": [
                {
                  "name": "givenName",
                  "kind": "optional",
                  "type": "string",
                  "description": "User's given name",
                  "example": ""
                },
                {
                  "name": "familyName",
                  "kind": "optional",
                  "type": "string",
                  "description": "User's family name",
                  "example": ""
                },
                {
                  "name": "formatted",
                  "kind": "optional",
                  "type": "string",
                  "description": "User's formatted name, including family and given names",
                  "example": ""
                }
              ]
            },
            {
              "name": "emails",
              "kind": "optional",
              "type": "array",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "value",
                  "kind": "optional",
                  "type": "string",
                  "description": "User's email address",
                  "example": ""
                },
                {
                  "name": "primary",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "Indicates if this is the user's main email. Only one of the emails can be set to true.",
                  "example": ""
                }
              ]
            },
            {
              "name": "active",
              "kind": "optional",
              "type": "boolean",
              "description": "Indicates if the user is active (provisioned) or not (deprovisioned). Deprovisioned users still exist in Jobylon, but aren't able to login.",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/BaseUser",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "ZyrIEi3UaOLwNoNG6j1C9",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://example.com/scim/v2/Users/{urn} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "SaLrhjsoQA_YzHC7M7TpT",
          "language": "go",
          "label": "Go",
          "code": "package main\n\nimport (\n   \"fmt\"\n   \"net/http\"\n   \"io/ioutil\"\n)\n\nfunc main() {\n\n   url := \"https://example.com/scim/v2/Users/{urn}\"\n   method := \"PUT\"\n\n   client := &http.Client {\n   }\n   req, err := http.NewRequest(method, url, nil)\n\n   if err != nil {\n      fmt.Println(err)\n      return\n   }\n   req.Header.Add(\"accept\", \"application/json\")\n   req.Header.Add(\"content-type\", \"application/json\")\n\n   res, err := client.Do(req)\n   if err != nil {\n      fmt.Println(err)\n      return\n   }\n   defer res.Body.Close()\n\n   body, err := ioutil.ReadAll(res.Body)\n   if err != nil {\n      fmt.Println(err)\n      return\n   }\n   fmt.Println(string(body))\n}"
        },
        {
          "id": "fUeZa7QEhYA9VdliEajF8",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://example.com/scim/v2/Users/{urn}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        },
        {
          "id": "gIB_K7NUWzTdFvb8tjOHM",
          "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: 'PUT',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://example.com/scim/v2/Users/{urn}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "GU1h0zF6S1MD9jafC5BaW",
          "language": "java",
          "label": "Java",
          "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n   .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n   .url(\"https://example.com/scim/v2/Users/{urn}\")\n   .method(\"PUT\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "ZyrIEi3UaOLwNoNG6j1C9"
    },
    "results": {
      "languages": [
        {
          "id": "8NBVhVoGTGx_xabdu82FE",
          "language": "200",
          "code": "// OK\n"
        }
      ],
      "selectedLanguageId": "8NBVhVoGTGx_xabdu82FE"
    }
  },
  "children": [
    {
      "id": "1ABULrid2iBt09LmG8702",
      "type": "paragraph",
      "children": [
        {
          "text": "Update a User, replacing all editable fields. Can be used for deprovisioning and reprovisioning users using the "
        },
        {
          "text": "active",
          "highlight": true
        },
        {
          "text": " field."
        }
      ]
    }
  ]
}