Reset password
curl --request POST \
--url https://api.example.com/api/v1/databases/{id}/reset-passwordimport requests
url = "https://api.example.com/api/v1/databases/{id}/reset-password"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/databases/{id}/reset-password', 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://api.example.com/api/v1/databases/{id}/reset-password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://api.example.com/api/v1/databases/{id}/reset-password"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/databases/{id}/reset-password")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/databases/{id}/reset-password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyDatabases
Reset password
Generate a new password for a database.
POST
/
api
/
v1
/
databases
/
{id}
/
reset-password
Reset password
curl --request POST \
--url https://api.example.com/api/v1/databases/{id}/reset-passwordimport requests
url = "https://api.example.com/api/v1/databases/{id}/reset-password"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/databases/{id}/reset-password', 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://api.example.com/api/v1/databases/{id}/reset-password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://api.example.com/api/v1/databases/{id}/reset-password"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/databases/{id}/reset-password")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/databases/{id}/reset-password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyGenerates a new password for the database. The old password stops working immediately. PgBouncer is reloaded automatically.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Database ID |
Response
200 OK
{
"password": "new-generated-password"
}
Errors
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 404 | DATABASE_NOT_FOUND | Database doesn’t exist, isn’t owned by this user, or isn’t in scope for this key |
| 500 | AGENT_ERROR | The VPS agent failed to reset the password |
All active connections using the old password will fail. Update your application’s connection string before or immediately after resetting.
⌘I