curl --request POST \
--url https://rdp.sh/api/v1/servers/{server}/password/reset \
--header 'Authorization: <api-key>'import requests
url = "https://rdp.sh/api/v1/servers/{server}/password/reset"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://rdp.sh/api/v1/servers/{server}/password/reset', 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://rdp.sh/api/v1/servers/{server}/password/reset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rdp.sh/api/v1/servers/{server}/password/reset"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://rdp.sh/api/v1/servers/{server}/password/reset")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rdp.sh/api/v1/servers/{server}/password/reset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": true,
"outcome": "changed_restart",
"message": "Password has been changed. Please restart your server before you change it to a password of your own choice.",
"username": "Administrator",
"password": "Pv93xK2mQ8sL"
}{
"status": false,
"error": "This action is unauthorized"
}{
"status": false,
"outcome": "no_answer",
"error": "Your server did not respond, so its password was not changed. Please make sure it is running and try again."
}Reset Password
Sets a new random password on the server, as “Reset Password” in the panel does,
and answers with it. GET /servers/{server} shows the same password from then on.
The password is random and goes through your systems, so have your customer
choose one of their own.
What is left to do depends on outcome:
changed: nothing. The server already runs on the new password.changed_restart: restart the server. A Linux server takes the new password when it restarts. A Windows server already runs on it and sets it again at its next start, so restart it before choosing another password.changed_stop_start: stop the server and start it again. It takes the new password at its next start, and a restart is not enough.
curl --request POST \
--url https://rdp.sh/api/v1/servers/{server}/password/reset \
--header 'Authorization: <api-key>'import requests
url = "https://rdp.sh/api/v1/servers/{server}/password/reset"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://rdp.sh/api/v1/servers/{server}/password/reset', 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://rdp.sh/api/v1/servers/{server}/password/reset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rdp.sh/api/v1/servers/{server}/password/reset"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://rdp.sh/api/v1/servers/{server}/password/reset")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rdp.sh/api/v1/servers/{server}/password/reset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": true,
"outcome": "changed_restart",
"message": "Password has been changed. Please restart your server before you change it to a password of your own choice.",
"username": "Administrator",
"password": "Pv93xK2mQ8sL"
}{
"status": false,
"error": "This action is unauthorized"
}{
"status": false,
"outcome": "no_answer",
"error": "Your server did not respond, so its password was not changed. Please make sure it is running and try again."
}Authorizations
Your API key as it is, without Bearer. API access is off for new
accounts: until it is turned on under Settings > API, every request
answers 403 with API access is turned off for this account. Turn it on under Settings > API. If the account lists allowed IPs, a request
from any other address answers 403 with This API key is not allowed from <address>.
Path Parameters
Response
The password was changed.
true
What is left to do, see above.
changed, changed_restart, changed_stop_start "changed_restart"
"Password has been changed. Please restart your server before you change it to a password of your own choice."
"Administrator"
"Pv93xK2mQ8sL"