---
title: Update User
slug: single-connect-api-3-2-0/update-user
description: Learn how to use the cURL command to send a POST request to the {{url}}/aioc-rest-web/rest/user/saveUser endpoint in this comprehensive code example. Also, discover how to format the request body as a JSON object, along with the required headers for handl
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "hTCgUXiD-LmpkddRghYvL",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/user/saveUser",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        },
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\n    \"id\": \"a177be61-8850-4f03-be1c-3ce275f02c1f\",\n    \"eid\": \"testuser\",\n    \"personelId\": \"123123\",\n    \"name\": \"test\",\n    \"passwordAlgorithm\": \"SHA256\",\n    \"password\": \"123\",\n    \"email\": \"test@test.com\",\n    \"surname\": \"user\",\n    \"internal\": true,\n    \"properties\": {\n        \"phoneNumber\": \"5550000000\",\n        \"ubaThreshold\": \"50\"\n    },\n    \"groups\": [\n        \"DEFAULT_GROUP_SYSYEM_ADMINS\",\n        \"DEFAULT_GROUP_SYSYEM_USERS\"\n    ],\n    \"managerGroups\": [],\n    \"lastLogin\": null,\n    \"lastLoginIp\": null,\n    \"recordLimit4Search\": null,\n    \"passwordDirty\": true,\n    \"passwordAutoGenerated\": false,\n    \"phoneNumber\": \"5550000000\",\n    \"forceChangePasswordOnNextLogin\": false,\n    \"lockReason\": null,\n    \"unlockOnPasswordChanged\": false,\n    \"unlockTime\": null,\n    \"tempUserEndTime\": null,\n    \"tempUserStartTime\": null,\n    \"tempUser\": false,\n    \"externalDirectorySource\": null,\n    \"userPropertyKey4Search\": null,\n    \"userPropertyValue4Search\": null,\n    \"locked\": false\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Update User",
        "jsonExample": "{\n    \"id\": \"cdc00366-56b6-4874-bd8b-7862549510ab\",\n    \"eid\": \"testuser\",\n    \"personelId\": \"123123\",\n    \"name\": \"testtest\",\n    \"passwordAlgorithm\": \"MD5\",\n    \"password\": \"21232f297a57a5a743894a0e4a801fc3\",\n    \"email\": \"test@test.com\",\n    \"surname\": \"user\",\n    \"internal\": true,\n    \"properties\": {\n        \"phoneNumber\": \"5550000000\",\n        \"ubaThreshold\": \"50\"\n    },\n    \"groups\": [\n        \"DEFAULT_GROUP_SYSYEM_ADMINS\",\n        \"DEFAULT_GROUP_SYSYEM_USERS\"\n    ],\n    \"managerGroups\": null,\n    \"lastLogin\": null,\n    \"lastLoginIp\": null,\n    \"recordLimit4Search\": null,\n    \"passwordDirty\": false,\n    \"passwordAutoGenerated\": false,\n    \"phoneNumber\": \"5550000000\",\n    \"forceChangePasswordOnNextLogin\": false,\n    \"lockReason\": null,\n    \"unlockOnPasswordChanged\": false,\n    \"unlockTime\": null,\n    \"tempUserEndTime\": null,\n    \"tempUserStartTime\": null,\n    \"tempUser\": false,\n    \"externalDirectorySource\": null,\n    \"userPropertyKey4Search\": null,\n    \"userPropertyValue4Search\": null,\n    \"locked\": false\n}"
      }
    ],
    "contentType": "application/json",
    "description": "<p>This method updates user's information in Single Connect.</p>\n<p>Copy the response of \"Get User Details By Id\" request to \"Body\" field. Edit info, then send the request.</p>\n<p>Note:</p>\n<p>//Password Update//\nIf password will be changed, only change password. No need to change other fields. In addition, \"passwordDirty\" parameter must be \"true\" when password changed required.</p>\n<p>//User Info Updates//\n\"passwordDirty\" parameter must be \"false\" when user info will be changed except password info.</p>",
    "examples": {
      "languages": [
        {
          "id": "fJd5p2r9VYqY4lHiGh_pg",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/user/saveUser \\\n     --header 'accept: application/json'"
        },
        {
          "id": "_-yRYSeQN3wFvPskitrNx",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/user/saveUser\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "6lSHkUZNRhrCphyTdaD3p",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/user/saveUser\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "CzdIU3hpF6h3XmK2eIgBC",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/user/saveUser\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "fJd5p2r9VYqY4lHiGh_pg"
    },
    "results": {
      "languages": [
        {
          "id": "nIduHG6gKGveb7k4dzC8m",
          "language": "200",
          "code": "{\n    \"id\": \"cdc00366-56b6-4874-bd8b-7862549510ab\",\n    \"eid\": \"testuser\",\n    \"personelId\": \"123123\",\n    \"name\": \"testtest\",\n    \"passwordAlgorithm\": \"MD5\",\n    \"password\": \"21232f297a57a5a743894a0e4a801fc3\",\n    \"email\": \"test@test.com\",\n    \"surname\": \"user\",\n    \"internal\": true,\n    \"properties\": {\n        \"phoneNumber\": \"5550000000\",\n        \"ubaThreshold\": \"50\"\n    },\n    \"groups\": [\n        \"DEFAULT_GROUP_SYSYEM_ADMINS\",\n        \"DEFAULT_GROUP_SYSYEM_USERS\"\n    ],\n    \"managerGroups\": null,\n    \"lastLogin\": null,\n    \"lastLoginIp\": null,\n    \"recordLimit4Search\": null,\n    \"passwordDirty\": false,\n    \"passwordAutoGenerated\": false,\n    \"phoneNumber\": \"5550000000\",\n    \"forceChangePasswordOnNextLogin\": false,\n    \"lockReason\": null,\n    \"unlockOnPasswordChanged\": false,\n    \"unlockTime\": null,\n    \"tempUserEndTime\": null,\n    \"tempUserStartTime\": null,\n    \"tempUser\": false,\n    \"externalDirectorySource\": null,\n    \"userPropertyKey4Search\": null,\n    \"userPropertyValue4Search\": null,\n    \"locked\": false\n}"
        }
      ],
      "selectedLanguageId": "nIduHG6gKGveb7k4dzC8m"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}