---
title: Update Password
slug: single-connect-api-3-2-0/update-password
description: Learn how to update a password using a curl command with this comprehensive code example. Discover how to include headers for accepting and sending JSON data, and effectively structure the body of the POST request with a string parameter for a seamless pa
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "Gh72OWuntnLk7lOrlFqSq",
  "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": "wqWiqmkdNmAubKZLYik08",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/updatePassword \\\n     --header 'accept: application/json'"
        },
        {
          "id": "CeQkYkCzCMwF9bSwGBt67",
          "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": "Tn-1U_2RzuWtfN5hJBvHZ",
          "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": "3gWzxlszl-j3A4TAuSSv_",
          "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": "wqWiqmkdNmAubKZLYik08"
    },
    "results": {
      "languages": [
        {
          "id": "9mllRZuF-p3e67UA355vr",
          "language": "200",
          "code": "SUCCESS"
        }
      ],
      "selectedLanguageId": "9mllRZuF-p3e67UA355vr"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}