---
title: Edit Sapm Account
slug: kron-pam-api-collection-340/edit-sapm-account
docTags: 
createdAt: 2024-07-12T13:38:00.279Z
---

{
  "id": "DpAGIljnDqAwVdADKPgDW",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/editSapmAccount",
    "name": "",
    "description": "<p>Using this API, you can edit any SAPM account you are allowed to edit. You should send the new value of the desired parameter. There are several examples.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "Content-Type",
          "description": "",
          "default": "application/json",
          "value": "application/json",
          "type": "string"
        },
        {
          "name": "Cookie",
          "description": "",
          "default": "{{netrightCookie}} ",
          "value": "{{netrightCookie}} ",
          "type": "string"
        },
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "description": "",
          "default": "{\t\n\t\"sapmDbId\":85623,\n\t\"secretName\":\"new sapm-dynamic-type\",\n\t\"passwordChangePeriod\":\"50\",\n\t\"sapmGroupDbId\":85220\n}\n\n",
          "value": "{\t\n\t\"sapmDbId\":85623,\n\t\"secretName\":\"new sapm-dynamic-type\",\n\t\"passwordChangePeriod\":\"50\",\n\t\"sapmGroupDbId\":85220\n}\n\n",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Edit Sapm Account (Static Strategy SSL Cert)</p>",
        "jsonExample": ""
      },
      {
        "statusCode": "200",
        "description": "<p>Edit Sapm Account (dynamic-type)</p>",
        "jsonExample": ""
      },
      {
        "statusCode": "200",
        "description": "<p>Edit Sapm Account(Static Type Dynamic Strategy)</p>",
        "jsonExample": ""
      },
      {
        "statusCode": "200",
        "description": "<p>Edit Sapm Account (Static Strategy SSH key)</p>",
        "jsonExample": ""
      },
      {
        "statusCode": "200",
        "description": "<p>Edit Sapm Account (Static Type User Credential)</p>",
        "jsonExample": ""
      },
      {
        "statusCode": "200",
        "description": "<p>Edit Sapm Account(Static Strategy Other)</p>",
        "jsonExample": ""
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "Nk6O3MMqMDY5iiPq3WAQ6",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/editSapmAccount \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --cookie {{netrightCookie}}  \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --data '\"{\\t\\n\\t\\\"sapmDbId\\\":85623,\\n\\t\\\"secretName\\\":\\\"new sapm-dynamic-type\\\",\\n\\t\\\"passwordChangePeriod\\\":\\\"50\\\",\\n\\t\\\"sapmGroupDbId\\\":85220\\n}\\n\\n\"'"
        },
        {
          "id": "tMQkT2E5DmP6puyN4OaE-",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"cookie\", \"{{netrightCookie}} \");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar raw = JSON.stringify(\"{\\t\\n\\t\\\"sapmDbId\\\":85623,\\n\\t\\\"secretName\\\":\\\"new sapm-dynamic-type\\\",\\n\\t\\\"passwordChangePeriod\\\":\\\"50\\\",\\n\\t\\\"sapmGroupDbId\\\":85220\\n}\\n\\n\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/sapm/editSapmAccount\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "s0d-ainZ9EmDQfUlbgr34",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/editSapmAccount\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"cookie\"] = \"{{netrightCookie}} \"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nrequest.body = JSON.dump(\"{\\t\\n\\t\\\"sapmDbId\\\":85623,\\n\\t\\\"secretName\\\":\\\"new sapm-dynamic-type\\\",\\n\\t\\\"passwordChangePeriod\\\":\\\"50\\\",\\n\\t\\\"sapmGroupDbId\\\":85220\\n}\\n\\n\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "VDP8pFmbsqjKPMEY4C7vx",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/editSapmAccount\"\n\npayload = json.dumps(\"{\\t\\n\\t\\\"sapmDbId\\\":85623,\\n\\t\\\"secretName\\\":\\\"new sapm-dynamic-type\\\",\\n\\t\\\"passwordChangePeriod\\\":\\\"50\\\",\\n\\t\\\"sapmGroupDbId\\\":85220\\n}\\n\\n\")\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'cookie': '{{netrightCookie}} ',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Nk6O3MMqMDY5iiPq3WAQ6"
    },
    "results": {
      "languages": [
        {
          "id": "-sYmxwboacecEaHeegtoF",
          "language": "200",
          "code": "// Edit Sapm Account (Static Strategy SSL Cert)\n"
        },
        {
          "id": "LMhadKdhXV2WIQ_Q5EK2A",
          "language": "200",
          "code": "// Edit Sapm Account (dynamic-type)\n"
        },
        {
          "id": "-xC3_QIxhAcJHwrcw5u5o",
          "language": "200",
          "code": "// Edit Sapm Account(Static Type Dynamic Strategy)\n"
        },
        {
          "id": "SnCWakA1oGhH414x5cGZW",
          "language": "200",
          "code": "// Edit Sapm Account (Static Strategy SSH key)\n"
        },
        {
          "id": "zPecB5a4Ujy9Vvt6xGxrQ",
          "language": "200",
          "code": "// Edit Sapm Account (Static Type User Credential)\n"
        },
        {
          "id": "iuCE07s_iAhawzDSoU_lo",
          "language": "200",
          "code": "// Edit Sapm Account(Static Strategy Other)\n"
        }
      ],
      "selectedLanguageId": "-sYmxwboacecEaHeegtoF"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}