---
title: Delete Ssh Key Pair
slug: single-connect-api-3-2-0/delete-ssh-key-pair
description: Learn how to make a DELETE request to remove an SSH key pair using cURL. This comprehensive document provides a code example that includes all the essential headers and data to send in the request for successful deletion. Enhance your programming skills a
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "qIkXAOOh98-XgEKDwCVox",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/USERID",
    "method": "DELETE",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Delete Ssh Key Pair",
        "jsonExample": "true"
      }
    ],
    "contentType": "application/json",
    "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>",
    "examples": {
      "languages": [
        {
          "id": "aPZuKYDtRPBS6TKvpmdqx",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url {{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/USERID \\\n     --header 'accept: application/json'"
        },
        {
          "id": "r7DIkhpVGRbHFHWpSQ6sc",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\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": "aNCSS2q003r-UUh1pq43f",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\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\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "hGUDORuFJpj8PPZjuaMzo",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/ssh/deleteSshKeyPair/USERID\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "aPZuKYDtRPBS6TKvpmdqx"
    },
    "results": {
      "languages": [
        {
          "id": "l2DkPGf2mUt4S5VakWggm",
          "language": "200",
          "code": "true"
        }
      ],
      "selectedLanguageId": "l2DkPGf2mUt4S5VakWggm"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}