Update SSH key
curl --request PATCH \
--url https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"default_host": "<string>",
"default_port": 32768,
"default_username": "<string>",
"name": "<string>",
"password": "<string>"
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}"
payload = {
"default_host": "<string>",
"default_port": 32768,
"default_username": "<string>",
"name": "<string>",
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
default_host: '<string>',
default_port: 32768,
default_username: '<string>',
name: '<string>',
password: '<string>'
})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'default_host' => '<string>',
'default_port' => 32768,
'default_username' => '<string>',
'name' => '<string>',
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}"
payload := strings.NewReader("{\n \"default_host\": \"<string>\",\n \"default_port\": 32768,\n \"default_username\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"default_host\": \"<string>\",\n \"default_port\": 32768,\n \"default_username\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"default_host\": \"<string>\",\n \"default_port\": 32768,\n \"default_username\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"algorithm": "ed25519",
"auth_type": "key",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"default_host": "<string>",
"default_port": 123,
"default_username": "<string>",
"fingerprint": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}SSH Keys
Update SSH key
Update SSH connection metadata. Password can only be updated for password-based SSH connections. Private keys are never returned.
PATCH
/
api
/
v1
/
ssh-keys
/
{id}
Update SSH key
curl --request PATCH \
--url https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"default_host": "<string>",
"default_port": 32768,
"default_username": "<string>",
"name": "<string>",
"password": "<string>"
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}"
payload = {
"default_host": "<string>",
"default_port": 32768,
"default_username": "<string>",
"name": "<string>",
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
default_host: '<string>',
default_port: 32768,
default_username: '<string>',
name: '<string>',
password: '<string>'
})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'default_host' => '<string>',
'default_port' => 32768,
'default_username' => '<string>',
'name' => '<string>',
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}"
payload := strings.NewReader("{\n \"default_host\": \"<string>\",\n \"default_port\": 32768,\n \"default_username\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"default_host\": \"<string>\",\n \"default_port\": 32768,\n \"default_username\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/ssh-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"default_host\": \"<string>\",\n \"default_port\": 32768,\n \"default_username\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"algorithm": "ed25519",
"auth_type": "key",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"default_host": "<string>",
"default_port": 123,
"default_username": "<string>",
"fingerprint": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}Authorizations
BearerAuthApiKeyAuth
JWT authentication token
Path Parameters
Body
application/json
Default SSH host for connections using this key
Maximum string length:
255Default SSH port
Required range:
1 <= x <= 65535Default SSH username for connections using this key
Maximum string length:
128New unique name for this SSH connection
Required string length:
1 - 128Pattern:
^[A-Za-z0-9][A-Za-z0-9_.-]*$New SSH password for password-based auth. Not accepted for generated-key auth.
Required string length:
1 - 1000Response
SSH key updated successfully
Available options:
ed25519, rsa-2048, rsa-4096, ecdsa-256, ecdsa-384, ecdsa-521, password Authentication type (key = generated key pair, password = password-based)
Available options:
key, password SHA256 fingerprint of the public key (null for password auth)
OpenSSH authorized_keys format public key (null for password auth)

