---
title: Update Password
slug: single-connect-api-3-0-3/update-password
description: Learn how to use the CURL command to make a POST request and effortlessly update passwords with this code example. Our comprehensive document includes all the necessary headers and data that must be included to ensure a successful request. Enhance your pr
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "KFxPdN1YSsfMnJ6ZVt9k9",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/updatePassword",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\n\t\"sapmDbId\":85287\n\t,\"newPassword\":\"f6DaSH8x\"\n\t,\"comment\":\"xxx\"\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Update Password",
        "jsonExample": "SUCCESS"
      }
    ],
    "contentType": "application/json",
    "description": "<p>Using this API, you can reset the password of a dynamic account that is already registered if it is changed by hand. You should give new password of the account and add comments. Single Connect will connect using this password and reset the password. Then it will store that password on the same SAPM account.</p>",
    "examples": {
      "languages": [
        {
          "id": "_xdjZD9CMJLbypUYWLaoN",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/updatePassword \\\n     --header 'accept: application/json'"
        },
        {
          "id": "xteRQQdhwgS4KD9XU2CGq",
          "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/sc/sapm/updatePassword\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "dPzkcvz6tlcgxoDb-50ii",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/updatePassword\")\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": "hbDZDaqLQtG6DTbnGlcJa",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/updatePassword\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "_xdjZD9CMJLbypUYWLaoN"
    },
    "results": {
      "languages": [
        {
          "id": "F95UZdEknhtkUHX4Q9RnS",
          "language": "200",
          "code": "SUCCESS"
        }
      ],
      "selectedLanguageId": "F95UZdEknhtkUHX4Q9RnS"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}