Register the network shared public key
curl --request POST \
--url https://controller.platform.simplecloud.app/v0/secrets/encryption-key \
--header 'Content-Type: application/json' \
--header 'X-Network-Credential: <x-network-credential>' \
--header 'X-Network-ID: <x-network-id>' \
--data '
{
"public_key_pem": "-----BEGIN PUBLIC KEY-----...",
"serverhost_id": "123e4567-e89b-12d3-a456-426614174000"
}
'import requests
url = "https://controller.platform.simplecloud.app/v0/secrets/encryption-key"
payload = {
"public_key_pem": "-----BEGIN PUBLIC KEY-----...",
"serverhost_id": "123e4567-e89b-12d3-a456-426614174000"
}
headers = {
"X-Network-ID": "<x-network-id>",
"X-Network-Credential": "<x-network-credential>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Network-ID': '<x-network-id>',
'X-Network-Credential': '<x-network-credential>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
public_key_pem: '-----BEGIN PUBLIC KEY-----...',
serverhost_id: '123e4567-e89b-12d3-a456-426614174000'
})
};
fetch('https://controller.platform.simplecloud.app/v0/secrets/encryption-key', 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://controller.platform.simplecloud.app/v0/secrets/encryption-key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'public_key_pem' => '-----BEGIN PUBLIC KEY-----...',
'serverhost_id' => '123e4567-e89b-12d3-a456-426614174000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Network-Credential: <x-network-credential>",
"X-Network-ID: <x-network-id>"
],
]);
$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://controller.platform.simplecloud.app/v0/secrets/encryption-key"
payload := strings.NewReader("{\n \"public_key_pem\": \"-----BEGIN PUBLIC KEY-----...\",\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Network-ID", "<x-network-id>")
req.Header.Add("X-Network-Credential", "<x-network-credential>")
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.post("https://controller.platform.simplecloud.app/v0/secrets/encryption-key")
.header("X-Network-ID", "<x-network-id>")
.header("X-Network-Credential", "<x-network-credential>")
.header("Content-Type", "application/json")
.body("{\n \"public_key_pem\": \"-----BEGIN PUBLIC KEY-----...\",\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://controller.platform.simplecloud.app/v0/secrets/encryption-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Credential"] = '<x-network-credential>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"public_key_pem\": \"-----BEGIN PUBLIC KEY-----...\",\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"key_fingerprint": "3f5a...",
"message": "Encryption key registered successfully",
"public_key_pem": "-----BEGIN PUBLIC KEY-----..."
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}secrets
Register the network shared public key
Register a shared public key for this network. The first registration wins atomically; if a key already exists, accepted is false and the canonical key is returned so the serverhost can sync the matching private key from its peers instead.
POST
/
v0
/
secrets
/
encryption-key
Register the network shared public key
curl --request POST \
--url https://controller.platform.simplecloud.app/v0/secrets/encryption-key \
--header 'Content-Type: application/json' \
--header 'X-Network-Credential: <x-network-credential>' \
--header 'X-Network-ID: <x-network-id>' \
--data '
{
"public_key_pem": "-----BEGIN PUBLIC KEY-----...",
"serverhost_id": "123e4567-e89b-12d3-a456-426614174000"
}
'import requests
url = "https://controller.platform.simplecloud.app/v0/secrets/encryption-key"
payload = {
"public_key_pem": "-----BEGIN PUBLIC KEY-----...",
"serverhost_id": "123e4567-e89b-12d3-a456-426614174000"
}
headers = {
"X-Network-ID": "<x-network-id>",
"X-Network-Credential": "<x-network-credential>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Network-ID': '<x-network-id>',
'X-Network-Credential': '<x-network-credential>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
public_key_pem: '-----BEGIN PUBLIC KEY-----...',
serverhost_id: '123e4567-e89b-12d3-a456-426614174000'
})
};
fetch('https://controller.platform.simplecloud.app/v0/secrets/encryption-key', 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://controller.platform.simplecloud.app/v0/secrets/encryption-key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'public_key_pem' => '-----BEGIN PUBLIC KEY-----...',
'serverhost_id' => '123e4567-e89b-12d3-a456-426614174000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Network-Credential: <x-network-credential>",
"X-Network-ID: <x-network-id>"
],
]);
$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://controller.platform.simplecloud.app/v0/secrets/encryption-key"
payload := strings.NewReader("{\n \"public_key_pem\": \"-----BEGIN PUBLIC KEY-----...\",\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Network-ID", "<x-network-id>")
req.Header.Add("X-Network-Credential", "<x-network-credential>")
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.post("https://controller.platform.simplecloud.app/v0/secrets/encryption-key")
.header("X-Network-ID", "<x-network-id>")
.header("X-Network-Credential", "<x-network-credential>")
.header("Content-Type", "application/json")
.body("{\n \"public_key_pem\": \"-----BEGIN PUBLIC KEY-----...\",\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://controller.platform.simplecloud.app/v0/secrets/encryption-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Credential"] = '<x-network-credential>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"public_key_pem\": \"-----BEGIN PUBLIC KEY-----...\",\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"key_fingerprint": "3f5a...",
"message": "Encryption key registered successfully",
"public_key_pem": "-----BEGIN PUBLIC KEY-----..."
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Headers
Network ID
Network Credential (network password or JWT)
Body
application/json
PEM encoded RSA public key
Was this page helpful?
⌘I