---
title: Delete Ssh Key Pair
slug: kron-pam-api-collection-340/delete-ssh-key-pair
docTags: 
createdAt: 2024-07-12T13:38:00.278Z
---

{
  "id": "9sW4gZIuejNI9ynhK8m-L",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "{{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/USERID",
    "name": "",
    "description": "<p>This method deletes the public SSH of the logged in user.</p>\n<p>Put \"user id\" to end of get url\n<a href=\"http://hostname/aioc-rest-web/rest/user/detail/USERID\" target=\"_blank\">http://hostname/aioc-rest-web/rest/user/detail/USERID</a></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"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Delete Ssh Key Pair",
        "jsonExample": "true"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "hMkL54C6f5NeEQtRFLFC8",
          "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": "vwE0XJX-no-NYBL2SHW-g",
          "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": "iaRnot-WCRY2bNXtbWDcg",
          "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": "4we2-XrSakzl5yXv6xaVz",
          "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": "hMkL54C6f5NeEQtRFLFC8"
    },
    "results": {
      "languages": [
        {
          "id": "sy1dTKfIzULDB6cUK0vdY",
          "language": "200",
          "code": "true"
        }
      ],
      "selectedLanguageId": "sy1dTKfIzULDB6cUK0vdY"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}