---
title: Retrieve SSH Key Pair
slug: kron-pam-api-collection-381-patch3/retrieve-ssh-key-pair
docTags: 
createdAt: 2026-10-21T06:07:16.182Z
---

{
  "id": "zwrySau8yDU7d7x8YH-mB",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair",
    "name": "",
    "description": "<h3>Request Overview</h3>\n<p>The <strong>Retrieve SSH Key Pair</strong> method retrieves the public SSH key that is authorized for the currently logged-in user.</p>\n<h4>Usage:</h4>\n<ul>\n<li>No parameters are needed; simply use the GET request to retrieve the SSH key.</li>\n</ul>\n<p>This method is used to obtain the public SSH key associated with the user's account, which can be used for secure access to resources.</p>",
    "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": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Retrieve Ssh Key Pair",
        "jsonExample": "{\n    \"dbId\": 404706,\n    \"userId\": \"a177be61-8850-4f03-be1c-3ce275f02c1f\",\n    \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrlwdMY1idLMS6RRONNSBeIm7WR66CogWL3+x3UEh6ORlOCUbEFKPXTN8AhEZLB20qUxm/PZ8pw7/d2hpyW2DDq4XvMNzpspZXVLmJGDsKhuXNqxCx8lVJ1/9cZ1i7eyXqa6xfij+yxICzUvsi5T3JMUfXOm5KLDvoG9hBbLTcHOzIAls0cSO+IXVelbFkfERBHz2IBXbJXPRyjVaaB+kLo9BmVCL4TYcxdU/GGCe/BDWYpzy24k4FedhfyXAes/JujE+Edyc8EwERoCOms2K6RafmzbwrLjJIbTvt6mxiJKWmplSN/cn/BLEUt+us1hECoULLIoDj9VUKTqRbanmb testuser\",\n    \"privateKey\": null,\n    \"creationTime\": 1548419866491,\n    \"expirationTime\": null\n}"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "ZQKLbzXowWBO5sYiVi_FA",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair \\\n     --header 'accept: application/json' \\\n     --cookie {{netrightCookie}} \\\n     --header 'x-xsrf-token: {{csrftoken}}'"
        },
        {
          "id": "1vkrQEE367FFWEDNeyRQX",
          "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 requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Q4JQnR92vokoquav-nks5",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"cookie\"] = \"{{netrightCookie}}\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ncNoNUrDPZxIg7xH6hJ5S",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'cookie': '{{netrightCookie}}',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "ZQKLbzXowWBO5sYiVi_FA"
    },
    "results": {
      "languages": [
        {
          "id": "VpwFUzrtVo6UzUSlb53mi",
          "language": "200",
          "code": "{\n    \"dbId\": 404706,\n    \"userId\": \"a177be61-8850-4f03-be1c-3ce275f02c1f\",\n    \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrlwdMY1idLMS6RRONNSBeIm7WR66CogWL3+x3UEh6ORlOCUbEFKPXTN8AhEZLB20qUxm/PZ8pw7/d2hpyW2DDq4XvMNzpspZXVLmJGDsKhuXNqxCx8lVJ1/9cZ1i7eyXqa6xfij+yxICzUvsi5T3JMUfXOm5KLDvoG9hBbLTcHOzIAls0cSO+IXVelbFkfERBHz2IBXbJXPRyjVaaB+kLo9BmVCL4TYcxdU/GGCe/BDWYpzy24k4FedhfyXAes/JujE+Edyc8EwERoCOms2K6RafmzbwrLjJIbTvt6mxiJKWmplSN/cn/BLEUt+us1hECoULLIoDj9VUKTqRbanmb testuser\",\n    \"privateKey\": null,\n    \"creationTime\": 1548419866491,\n    \"expirationTime\": null\n}"
        }
      ],
      "selectedLanguageId": "VpwFUzrtVo6UzUSlb53mi"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}