---
title: Delete Permission From SAPM Account
slug: kron-pam-api-collection-340/delete-permission-from-sapm-account
docTags: 
createdAt: 2024-07-12T13:38:00.279Z
---

{
  "id": "ct7bfBbb-agw2I87Lm9cC",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/deletePermissionFromAccount",
    "name": "",
    "description": "<h3>Overview</h3>\n<p>This API allows for the revocation of specific permissions from a designated SAPM account in KRON PAM. By providing the <code>sapmDbId</code> of the SAPM account, you can determine which permissions are to be removed from either individual users or user groups.</p>\n<h3>Parameters</h3>\n<ul>\n<li>\n<p><strong>sapmDbId</strong>:</p>\n<ul>\n<li>Description: The unique identifier of the SAPM account in KRON PAM.</li>\n</ul>\n</li>\n<li>\n<p><strong>permissionToDelete</strong>:</p>\n<ul>\n<li>\n<p>Description: An array of objects, each detailing a permission to be revoked.</p>\n</li>\n<li>\n<p>Components:</p>\n<ul>\n<li>\n<p><strong>eid</strong>: External identifier for the user or user group.</p>\n</li>\n<li>\n<p><strong>permission</strong>: Defines the access level to be removed. Permissions include:</p>\n<ul>\n<li>\n<p><code>LIST_ONLY</code>: View-only access.</p>\n</li>\n<li>\n<p><code>MANAGE_PASSWORD</code>: Password management capability.</p>\n</li>\n<li>\n<p><code>READ_ONLY</code>: Read-only access.</p>\n</li>\n<li>\n<p><code>READ_ONLY_SECOND_PART</code>: Limited read-only access to the latter part of data.</p>\n</li>\n<li>\n<p><code>FULL_CONTROL</code>: Full access and control.</p>\n</li>\n<li>\n<p><code>READ_WRITE</code>: Ability to read and modify.</p>\n</li>\n<li>\n<p><code>READ_ONLY_FIRST_PART</code>: Limited read-only access to the initial part of data.</p>\n</li>\n</ul>\n</li>\n<li>\n<p><strong>type</strong>: Indicates if the permission is for a user or a user group, with possible values being <code>USER</code> or <code>USER_GROUP</code>.</p>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "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": "{\r\n    \"sapmDbId\": 384810,\r\n    \"permissionToDelete\": [\r\n        {\r\n            \"id\": \"DEFAULT_GROUP_SYSYEM_ADMINS\",\r\n            \"eid\": \"esc1l1\",\r\n            \"permission\": \"LIST_ONLY\",\r\n            \"type\": \"USER_GROUP\"\r\n        }\r\n    ]\r\n}\r\n",
          "value": "{\r\n    \"sapmDbId\": 384810,\r\n    \"permissionToDelete\": [\r\n        {\r\n            \"id\": \"DEFAULT_GROUP_SYSYEM_ADMINS\",\r\n            \"eid\": \"esc1l1\",\r\n            \"permission\": \"LIST_ONLY\",\r\n            \"type\": \"USER_GROUP\"\r\n        }\r\n    ]\r\n}\r\n",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Delete Permission From SAPM Account",
        "jsonExample": "SUCCESS"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "f4QT_9sO7qE0lbTkPQKaW",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/deletePermissionFromAccount \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --data '\"{\\r\\n    \\\"sapmDbId\\\": 384810,\\r\\n    \\\"permissionToDelete\\\": [\\r\\n        {\\r\\n            \\\"id\\\": \\\"DEFAULT_GROUP_SYSYEM_ADMINS\\\",\\r\\n            \\\"eid\\\": \\\"esc1l1\\\",\\r\\n            \\\"permission\\\": \\\"LIST_ONLY\\\",\\r\\n            \\\"type\\\": \\\"USER_GROUP\\\"\\r\\n        }\\r\\n    ]\\r\\n}\\r\\n\"'"
        },
        {
          "id": "XgDhNz9M5afFxSG75J0uo",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar raw = JSON.stringify(\"{\\r\\n    \\\"sapmDbId\\\": 384810,\\r\\n    \\\"permissionToDelete\\\": [\\r\\n        {\\r\\n            \\\"id\\\": \\\"DEFAULT_GROUP_SYSYEM_ADMINS\\\",\\r\\n            \\\"eid\\\": \\\"esc1l1\\\",\\r\\n            \\\"permission\\\": \\\"LIST_ONLY\\\",\\r\\n            \\\"type\\\": \\\"USER_GROUP\\\"\\r\\n        }\\r\\n    ]\\r\\n}\\r\\n\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/sapm/deletePermissionFromAccount\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "0zvUDh4W1qsu-quXwpReB",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/deletePermissionFromAccount\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nrequest.body = JSON.dump(\"{\\r\\n    \\\"sapmDbId\\\": 384810,\\r\\n    \\\"permissionToDelete\\\": [\\r\\n        {\\r\\n            \\\"id\\\": \\\"DEFAULT_GROUP_SYSYEM_ADMINS\\\",\\r\\n            \\\"eid\\\": \\\"esc1l1\\\",\\r\\n            \\\"permission\\\": \\\"LIST_ONLY\\\",\\r\\n            \\\"type\\\": \\\"USER_GROUP\\\"\\r\\n        }\\r\\n    ]\\r\\n}\\r\\n\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "TibFlG5J1WgAmDIeIdwx9",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/deletePermissionFromAccount\"\n\npayload = json.dumps(\"{\\r\\n    \\\"sapmDbId\\\": 384810,\\r\\n    \\\"permissionToDelete\\\": [\\r\\n        {\\r\\n            \\\"id\\\": \\\"DEFAULT_GROUP_SYSYEM_ADMINS\\\",\\r\\n            \\\"eid\\\": \\\"esc1l1\\\",\\r\\n            \\\"permission\\\": \\\"LIST_ONLY\\\",\\r\\n            \\\"type\\\": \\\"USER_GROUP\\\"\\r\\n        }\\r\\n    ]\\r\\n}\\r\\n\")\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "f4QT_9sO7qE0lbTkPQKaW"
    },
    "results": {
      "languages": [
        {
          "id": "vpPbl0XOnYoqSyeeiiZIR",
          "language": "200",
          "code": "SUCCESS"
        }
      ],
      "selectedLanguageId": "vpPbl0XOnYoqSyeeiiZIR"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}