---
title: Delete SSH Key Pair
slug: kron-pam-api-collection-3-9-0/delete-ssh-key-pair
docTags: 
createdAt: 2026-10-21T06:10:28.166Z
---

{
  "id": "XHJt6UEwd5AhTHFNNa0dc",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "{{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/{{userId}}",
    "name": "",
    "description": "<h3>Request Overview</h3>\n<p>The <strong>Delete SSH Key Pair</strong> method deletes the public SSH key of the logged-in user.</p>\n<h4>Usage:</h4>\n<ul>\n<li>Append the <code>\"user id\"</code> to the end of the request URL.</li>\n</ul>\n<p>This method is used to remove the SSH key associated with the specific user in the KRON PAM system.</p>",
    "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"
        },
        {
          "name": "userId",
          "description": "",
          "default": "userId",
          "value": "userId",
          "type": "string"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Delete Ssh Key Pair",
        "jsonExample": "true"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "XPyoK29bf8Dl5SroApa78",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url {{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/{{userId}} \\\n     --header 'accept: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}'"
        },
        {
          "id": "PRHwjZLq4qidIssIPIj6f",
          "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 requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/{{userId}}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "qk8NvLApVi0P_tOXUQhcB",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/{{userId}}\")\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}}\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "bSNyw3QnoUUuLX-qWaSO5",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/{{userId}}\"\n\npayload = {}\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": "XPyoK29bf8Dl5SroApa78"
    },
    "results": {
      "languages": [
        {
          "id": "TryqziqBdJfX0dKCQS6U6",
          "language": "200",
          "code": "true"
        }
      ],
      "selectedLanguageId": "TryqziqBdJfX0dKCQS6U6"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}