---
title: Add Vault Account to Vault Group
slug: kronpam-api-collection-3-6-0/add-vault-account-to-vault-group
docTags: 
createdAt: 2025-01-20T13:35:40.976Z
---

{
  "id": "CwSIdo0fC6q7QLrrrO6-g",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountToSapmGroup",
    "name": "",
    "description": "<h3>Request Overview</h3>\n<p>This API adds a Vault account to the specified Vault group.</p>\n<ul>\n<li>\n<p><strong>sapmUserName</strong>: Username of the SAPM account to be added.</p>\n</li>\n<li>\n<p><strong>password</strong>: Password for the SAPM account.</p>\n</li>\n<li>\n<p><strong>sapmConfigId</strong>: ID of the SAPM configuration.</p>\n</li>\n<li>\n<p><strong>deviceId</strong>: ID of the device associated with the Vault group.</p>\n</li>\n<li>\n<p><strong>passwordChangePeriod</strong>: Period for changing the password.</p>\n</li>\n<li>\n<p><strong>permissions</strong>: Permissions assigned to the account.</p>\n</li>\n</ul>",
    "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\":85613,\n\t\"sapmGroupDbId\":85220\n}",
          "value": "{\t\n\t\"sapmDbId\":85613,\n\t\"sapmGroupDbId\":85220\n}",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>sapm/addSapmAccount</p>",
        "jsonExample": "{\n    \"dbId\": 608679,\n    \"device\": {\n        \"dbId\": 602107,\n        \"id\": \"4b144118-2505-43a9-908a-b6fab60f296f\",\n        \"name\": \"10.20.40.184\",\n        \"accessProtocol\": \"SSHv2\",\n        \"managementIp\": \"10.20.40.184\",\n        \"elementType\": {\n            \"dbId\": -1256593,\n            \"elementTypeId\": \"linux\",\n            \"elementTypeName\": \"Linux Server\",\n            \"vendor\": null,\n            \"category\": null,\n            \"elementTypeProperties\": [\n                {\n                    \"dbId\": 279310,\n                    \"elementTypePropertyValue\": \"hostname\",\n                    \"elementTypePropertyKey\": \"discovery.commands.hostname\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": 279363,\n                    \"elementTypePropertyValue\": \"uname\",\n                    \"elementTypePropertyKey\": \"discovery.commands.version.command\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -224107345,\n                    \"elementTypePropertyValue\": \"abort\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.ctrl_c\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328321729,\n                    \"elementTypePropertyValue\": \"^Enter the date.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328317181,\n                    \"elementTypePropertyValue\": \"^Are you sure.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328318769,\n                    \"elementTypePropertyValue\": \".*(?i)password[:|&gt].*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -224107346,\n                    \"elementTypePropertyValue\": \"do_nothing\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.ctrl_z\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -224107347,\n                    \"elementTypePropertyValue\": \".*?(&gt|\\\\$|#|%)\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.prompt_pattern\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -316330256,\n                    \"elementTypePropertyValue\": \"-1\",\n                    \"elementTypePropertyKey\": \"shell.terminal.config.fixed_pty_columns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328315408,\n                    \"elementTypePropertyValue\": \"^Quit.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -355141703,\n                    \"elementTypePropertyValue\": \"^Select choice.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": 279374,\n                    \"elementTypePropertyValue\": \"Linux\",\n                    \"elementTypePropertyKey\": \"discovery.model.match.regex\",\n                    \"elementTypePropertyType\": null\n                }\n            ]\n        },\n        \"discoveryTime\": 1548839906588,\n        \"properties\": {\n            \"pseudoDevice\": \"true\"\n        },\n        \"deviceGroups\": [\n            \"4dd39f0b-2cb1-4089-8281-3912e7b904e0\"\n        ],\n        \"availability\": null,\n        \"currentMaintenanceWindow\": null,\n        \"interfaceName\": null,\n        \"nameManagementIp\": \"10.20.40.184-10.20.40.184\",\n        \"regionName\": null,\n        \"pseudoDevice\": true,\n        \"domainController\": null,\n        \"portNum\": null,\n        \"discoverySource\": null\n    },\n    \"config\": {\n        \"configId\": -9077,\n        \"name\": \"Linux\",\n        \"description\": \"Linux\",\n        \"strategy\": \"SSH\",\n        \"properties\": {\n            \"username.parser\": \"(.*?):.*\",\n            \"new.user.found.action\": \"LOG\",\n            \"user.list.command\": \"cat /etc/passwd\",\n            \"check.password.validation\": \"true\",\n            \"change.password.command.template\": \"passwd\\\\n${oldPassword}\\\\n${newPassword}\\\\n${newPassword}\\\\nlogout\"\n        },\n        \"exactMatch4Search\": false,\n        \"recordLimit4Search\": null\n    },\n    \"changePeriod\": 7200,\n    \"username\": \"sapm2\",\n    \"password\": \"5B5bycR3kOdleJw0UI86BQ==\",\n    \"previousPassword\": \"IGrfdOMqFwhnVxTYOTFVKA==\",\n    \"lastChangeTime\": 1548853978693,\n    \"nextChangeTime\": 1549285978693,\n    \"nextChangeTimeStart4Search\": null,\n    \"nextChangeTimeEnd4Search\": null,\n    \"passwordSeenStatus\": \"UNSEEN\",\n    \"validationStatus\": \"VALID\",\n    \"changeStatus\": null,\n    \"lastAttemptStatus\": true,\n    \"masterAccountId\": null,\n    \"permissions\": {},\n    \"identicalSapmAccounts\": [],\n    \"recordLimit4Search\": null,\n    \"validationStatus4Search\": null,\n    \"checkPermission4Search\": true,\n    \"exactMatch4Search\": false,\n    \"acceptedSapmConfigList\": null,\n    \"masterAccountId4Search\": null,\n    \"searchOnlyMasterAccounts\": false,\n    \"searchOnlyOwnRegion\": false,\n    \"deviceIp4Search\": null,\n    \"secondPartSeenUsername\": null,\n    \"firstPartSeenUsername\": null,\n    \"changePeriodFormatted\": \"05d 00h 00m\"\n}"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "z-MpZJzMS97cmlbLyP7jW",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountToSapmGroup \\\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\\\":85613,\\n\\t\\\"sapmGroupDbId\\\":85220\\n}\"'"
        },
        {
          "id": "tTX_SUmOuW99J-lIzv1Vj",
          "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\\\":85613,\\n\\t\\\"sapmGroupDbId\\\":85220\\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/addSapmAccountToSapmGroup\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "7liLsLcxlfL_MVCENs-vJ",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountToSapmGroup\")\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\\\":85613,\\n\\t\\\"sapmGroupDbId\\\":85220\\n}\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "NH5V3ChrVJ7DOHaWchKWt",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountToSapmGroup\"\n\npayload = json.dumps(\"{\\t\\n\\t\\\"sapmDbId\\\":85613,\\n\\t\\\"sapmGroupDbId\\\":85220\\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": "z-MpZJzMS97cmlbLyP7jW"
    },
    "results": {
      "languages": [
        {
          "id": "11soN5CN5is8keZShRwmr",
          "language": "200",
          "code": "{\n    \"dbId\": 608679,\n    \"device\": {\n        \"dbId\": 602107,\n        \"id\": \"4b144118-2505-43a9-908a-b6fab60f296f\",\n        \"name\": \"10.20.40.184\",\n        \"accessProtocol\": \"SSHv2\",\n        \"managementIp\": \"10.20.40.184\",\n        \"elementType\": {\n            \"dbId\": -1256593,\n            \"elementTypeId\": \"linux\",\n            \"elementTypeName\": \"Linux Server\",\n            \"vendor\": null,\n            \"category\": null,\n            \"elementTypeProperties\": [\n                {\n                    \"dbId\": 279310,\n                    \"elementTypePropertyValue\": \"hostname\",\n                    \"elementTypePropertyKey\": \"discovery.commands.hostname\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": 279363,\n                    \"elementTypePropertyValue\": \"uname\",\n                    \"elementTypePropertyKey\": \"discovery.commands.version.command\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -224107345,\n                    \"elementTypePropertyValue\": \"abort\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.ctrl_c\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328321729,\n                    \"elementTypePropertyValue\": \"^Enter the date.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328317181,\n                    \"elementTypePropertyValue\": \"^Are you sure.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328318769,\n                    \"elementTypePropertyValue\": \".*(?i)password[:|&gt].*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -224107346,\n                    \"elementTypePropertyValue\": \"do_nothing\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.ctrl_z\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -224107347,\n                    \"elementTypePropertyValue\": \".*?(&gt|\\\\$|#|%)\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.prompt_pattern\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -316330256,\n                    \"elementTypePropertyValue\": \"-1\",\n                    \"elementTypePropertyKey\": \"shell.terminal.config.fixed_pty_columns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -328315408,\n                    \"elementTypePropertyValue\": \"^Quit.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": -355141703,\n                    \"elementTypePropertyValue\": \"^Select choice.*\",\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\n                    \"elementTypePropertyType\": null\n                },\n                {\n                    \"dbId\": 279374,\n                    \"elementTypePropertyValue\": \"Linux\",\n                    \"elementTypePropertyKey\": \"discovery.model.match.regex\",\n                    \"elementTypePropertyType\": null\n                }\n            ]\n        },\n        \"discoveryTime\": 1548839906588,\n        \"properties\": {\n            \"pseudoDevice\": \"true\"\n        },\n        \"deviceGroups\": [\n            \"4dd39f0b-2cb1-4089-8281-3912e7b904e0\"\n        ],\n        \"availability\": null,\n        \"currentMaintenanceWindow\": null,\n        \"interfaceName\": null,\n        \"nameManagementIp\": \"10.20.40.184-10.20.40.184\",\n        \"regionName\": null,\n        \"pseudoDevice\": true,\n        \"domainController\": null,\n        \"portNum\": null,\n        \"discoverySource\": null\n    },\n    \"config\": {\n        \"configId\": -9077,\n        \"name\": \"Linux\",\n        \"description\": \"Linux\",\n        \"strategy\": \"SSH\",\n        \"properties\": {\n            \"username.parser\": \"(.*?):.*\",\n            \"new.user.found.action\": \"LOG\",\n            \"user.list.command\": \"cat /etc/passwd\",\n            \"check.password.validation\": \"true\",\n            \"change.password.command.template\": \"passwd\\\\n${oldPassword}\\\\n${newPassword}\\\\n${newPassword}\\\\nlogout\"\n        },\n        \"exactMatch4Search\": false,\n        \"recordLimit4Search\": null\n    },\n    \"changePeriod\": 7200,\n    \"username\": \"sapm2\",\n    \"password\": \"5B5bycR3kOdleJw0UI86BQ==\",\n    \"previousPassword\": \"IGrfdOMqFwhnVxTYOTFVKA==\",\n    \"lastChangeTime\": 1548853978693,\n    \"nextChangeTime\": 1549285978693,\n    \"nextChangeTimeStart4Search\": null,\n    \"nextChangeTimeEnd4Search\": null,\n    \"passwordSeenStatus\": \"UNSEEN\",\n    \"validationStatus\": \"VALID\",\n    \"changeStatus\": null,\n    \"lastAttemptStatus\": true,\n    \"masterAccountId\": null,\n    \"permissions\": {},\n    \"identicalSapmAccounts\": [],\n    \"recordLimit4Search\": null,\n    \"validationStatus4Search\": null,\n    \"checkPermission4Search\": true,\n    \"exactMatch4Search\": false,\n    \"acceptedSapmConfigList\": null,\n    \"masterAccountId4Search\": null,\n    \"searchOnlyMasterAccounts\": false,\n    \"searchOnlyOwnRegion\": false,\n    \"deviceIp4Search\": null,\n    \"secondPartSeenUsername\": null,\n    \"firstPartSeenUsername\": null,\n    \"changePeriodFormatted\": \"05d 00h 00m\"\n}"
        }
      ],
      "selectedLanguageId": "11soN5CN5is8keZShRwmr"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}