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

{
  "id": "MRTxe080aXBPHcGYQKAl1",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/sc/ssh/updateSshKeyPair",
    "name": "",
    "description": "<h3>Request Overview</h3>\n<p>The <strong>Update SSH Key Pair</strong> method updates the public SSH key of the logged-in user.</p>\n<h4>Usage:</h4>\n<ul>\n<li>Enter the new public key in the <code>\"Body\"</code> field.</li>\n</ul>\n<p>This method is used to update the existing public SSH key for the user currently logged into the system.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "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": [
        {
          "name": "body",
          "description": "",
          "default": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCT0z1soO5j6g4mYJM2E79hjGRAiUWC2E8/On8dj/8TU/A+LDQvtXAiCE878uk0QHcugQGJ6tju4UKJMZc59Cs44t68/J0pcrWRi8wWyx5MALPULhEeDQ29d5540ihI9hsSDTKBcYj0VzPtFlaLEWL/EZdJWVbGUYNAzNXb92odCGpicQAagykXqzzi6a7Fk77jNl7hK4eUeyXZRxM6GAfk7HPzYZvoX+EsfAQXF3BeV2dQUTVt1Wx+mGUDoD9SopuxNg5Io1pDcklhQwt33Ts2HgdbQAzy+69DSi/D5bMjtbAVFVtZk9Uf3LA7g3sLVQ1lDKAnRPqdIdrT0DgSoPFX admin",
          "value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCT0z1soO5j6g4mYJM2E79hjGRAiUWC2E8/On8dj/8TU/A+LDQvtXAiCE878uk0QHcugQGJ6tju4UKJMZc59Cs44t68/J0pcrWRi8wWyx5MALPULhEeDQ29d5540ihI9hsSDTKBcYj0VzPtFlaLEWL/EZdJWVbGUYNAzNXb92odCGpicQAagykXqzzi6a7Fk77jNl7hK4eUeyXZRxM6GAfk7HPzYZvoX+EsfAQXF3BeV2dQUTVt1Wx+mGUDoD9SopuxNg5Io1pDcklhQwt33Ts2HgdbQAzy+69DSi/D5bMjtbAVFVtZk9Uf3LA7g3sLVQ1lDKAnRPqdIdrT0DgSoPFX admin",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "updateSshKeyPair",
        "jsonExample": "true"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "WImj9mQXKodNX9A7sCOCr",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/ssh/updateSshKeyPair \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --cookie {{netrightCookie}} \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --data '\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCT0z1soO5j6g4mYJM2E79hjGRAiUWC2E8/On8dj/8TU/A+LDQvtXAiCE878uk0QHcugQGJ6tju4UKJMZc59Cs44t68/J0pcrWRi8wWyx5MALPULhEeDQ29d5540ihI9hsSDTKBcYj0VzPtFlaLEWL/EZdJWVbGUYNAzNXb92odCGpicQAagykXqzzi6a7Fk77jNl7hK4eUeyXZRxM6GAfk7HPzYZvoX+EsfAQXF3BeV2dQUTVt1Wx+mGUDoD9SopuxNg5Io1pDcklhQwt33Ts2HgdbQAzy+69DSi/D5bMjtbAVFVtZk9Uf3LA7g3sLVQ1lDKAnRPqdIdrT0DgSoPFX admin\"'"
        },
        {
          "id": "OK0F07PU1BqeQtiqxtk3_",
          "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 raw = JSON.stringify(\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCT0z1soO5j6g4mYJM2E79hjGRAiUWC2E8/On8dj/8TU/A+LDQvtXAiCE878uk0QHcugQGJ6tju4UKJMZc59Cs44t68/J0pcrWRi8wWyx5MALPULhEeDQ29d5540ihI9hsSDTKBcYj0VzPtFlaLEWL/EZdJWVbGUYNAzNXb92odCGpicQAagykXqzzi6a7Fk77jNl7hK4eUeyXZRxM6GAfk7HPzYZvoX+EsfAQXF3BeV2dQUTVt1Wx+mGUDoD9SopuxNg5Io1pDcklhQwt33Ts2HgdbQAzy+69DSi/D5bMjtbAVFVtZk9Uf3LA7g3sLVQ1lDKAnRPqdIdrT0DgSoPFX admin\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/ssh/updateSshKeyPair\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "mr1IV_yxRJszSCmjDU8VS",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/ssh/updateSshKeyPair\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"cookie\"] = \"{{netrightCookie}}\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nrequest.body = JSON.dump(\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCT0z1soO5j6g4mYJM2E79hjGRAiUWC2E8/On8dj/8TU/A+LDQvtXAiCE878uk0QHcugQGJ6tju4UKJMZc59Cs44t68/J0pcrWRi8wWyx5MALPULhEeDQ29d5540ihI9hsSDTKBcYj0VzPtFlaLEWL/EZdJWVbGUYNAzNXb92odCGpicQAagykXqzzi6a7Fk77jNl7hK4eUeyXZRxM6GAfk7HPzYZvoX+EsfAQXF3BeV2dQUTVt1Wx+mGUDoD9SopuxNg5Io1pDcklhQwt33Ts2HgdbQAzy+69DSi/D5bMjtbAVFVtZk9Uf3LA7g3sLVQ1lDKAnRPqdIdrT0DgSoPFX admin\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "tMY6dYm4jMHpX7cFLJQxa",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/ssh/updateSshKeyPair\"\n\npayload = json.dumps(\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCT0z1soO5j6g4mYJM2E79hjGRAiUWC2E8/On8dj/8TU/A+LDQvtXAiCE878uk0QHcugQGJ6tju4UKJMZc59Cs44t68/J0pcrWRi8wWyx5MALPULhEeDQ29d5540ihI9hsSDTKBcYj0VzPtFlaLEWL/EZdJWVbGUYNAzNXb92odCGpicQAagykXqzzi6a7Fk77jNl7hK4eUeyXZRxM6GAfk7HPzYZvoX+EsfAQXF3BeV2dQUTVt1Wx+mGUDoD9SopuxNg5Io1pDcklhQwt33Ts2HgdbQAzy+69DSi/D5bMjtbAVFVtZk9Uf3LA7g3sLVQ1lDKAnRPqdIdrT0DgSoPFX admin\")\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'cookie': '{{netrightCookie}}',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "WImj9mQXKodNX9A7sCOCr"
    },
    "results": {
      "languages": [
        {
          "id": "7AyC_smmO7mCxG6WAtYYi",
          "language": "200",
          "code": "true"
        }
      ],
      "selectedLanguageId": "7AyC_smmO7mCxG6WAtYYi"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}