cURL
curl --request POST \
--url https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "Tr0ub4dor.Zebra-Lamp=91"
}
'import requests
url = "https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials"
payload = { "password": "Tr0ub4dor.Zebra-Lamp=91" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({password: 'Tr0ub4dor.Zebra-Lamp=91'})
};
fetch('https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials', 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.camposcloud.com/v1/databases/{databaseId}/update-credentials",
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([
'password' => 'Tr0ub4dor.Zebra-Lamp=91'
]),
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://api.camposcloud.com/v1/databases/{databaseId}/update-credentials"
payload := strings.NewReader("{\n \"password\": \"Tr0ub4dor.Zebra-Lamp=91\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"Tr0ub4dor.Zebra-Lamp=91\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"Tr0ub4dor.Zebra-Lamp=91\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Credentials updated successfully.",
"database": {
"_id": "64b7f0c2a1b2c3d4e5f60718",
"name": "main-db",
"type": "postgresql",
"status": "active",
"restartRequired": false,
"userId": "64b7f0c2a1b2c3d4e5f60700",
"teamId": null,
"workerNodeId": {
"_id": "64b7f0c2a1b2c3d4e5f60799",
"nodeName": "node-1"
},
"allocatedMemoryMB": 512,
"allocatedVCpu": 1,
"diskLimitBytes": 10737418240,
"diskUsageBytes": 52428800,
"containerImage": "postgres:trixie",
"connection": {
"host": "db.camposcloud.com",
"port": 30001,
"username": "app_user",
"database": "app_db"
},
"currentResourceMetrics": {
"timestamp": "2025-01-01T12:00:00.000Z",
"online": true,
"uptime": 35980,
"startedAt": "2025-01-01T12:00:00.000Z",
"cpuUsagePercent": 0.42,
"memoryUsageBytes": 43671552,
"memoryLimitBytes": 268435456,
"networkRxBytes": 228961,
"networkTxBytes": 228190
},
"createdAt": "2025-01-01T12:00:00.000Z",
"updatedAt": "2025-01-01T12:00:00.000Z"
}
}{
"error": "password too weak. use a stronger password"
}{
"error": "Invalid developer token"
}{
"error": "You do not have permission to perform this action on this application."
}{
"error": "Application not found or you do not have permission to access it."
}{
"error": "The credentials are already being changed. Please wait until it is completed before initiating a new one."
}{
"error": "Internal server error. Please try again later."
}Databases
/v1/databases/{databaseId}/update-credentials
This endpoint replaces the password of a database.
POST
/
v1
/
databases
/
{databaseId}
/
update-credentials
cURL
curl --request POST \
--url https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "Tr0ub4dor.Zebra-Lamp=91"
}
'import requests
url = "https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials"
payload = { "password": "Tr0ub4dor.Zebra-Lamp=91" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({password: 'Tr0ub4dor.Zebra-Lamp=91'})
};
fetch('https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials', 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.camposcloud.com/v1/databases/{databaseId}/update-credentials",
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([
'password' => 'Tr0ub4dor.Zebra-Lamp=91'
]),
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://api.camposcloud.com/v1/databases/{databaseId}/update-credentials"
payload := strings.NewReader("{\n \"password\": \"Tr0ub4dor.Zebra-Lamp=91\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"Tr0ub4dor.Zebra-Lamp=91\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.camposcloud.com/v1/databases/{databaseId}/update-credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"Tr0ub4dor.Zebra-Lamp=91\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Credentials updated successfully.",
"database": {
"_id": "64b7f0c2a1b2c3d4e5f60718",
"name": "main-db",
"type": "postgresql",
"status": "active",
"restartRequired": false,
"userId": "64b7f0c2a1b2c3d4e5f60700",
"teamId": null,
"workerNodeId": {
"_id": "64b7f0c2a1b2c3d4e5f60799",
"nodeName": "node-1"
},
"allocatedMemoryMB": 512,
"allocatedVCpu": 1,
"diskLimitBytes": 10737418240,
"diskUsageBytes": 52428800,
"containerImage": "postgres:trixie",
"connection": {
"host": "db.camposcloud.com",
"port": 30001,
"username": "app_user",
"database": "app_db"
},
"currentResourceMetrics": {
"timestamp": "2025-01-01T12:00:00.000Z",
"online": true,
"uptime": 35980,
"startedAt": "2025-01-01T12:00:00.000Z",
"cpuUsagePercent": 0.42,
"memoryUsageBytes": 43671552,
"memoryLimitBytes": 268435456,
"networkRxBytes": 228961,
"networkTxBytes": 228190
},
"createdAt": "2025-01-01T12:00:00.000Z",
"updatedAt": "2025-01-01T12:00:00.000Z"
}
}{
"error": "password too weak. use a stronger password"
}{
"error": "Invalid developer token"
}{
"error": "You do not have permission to perform this action on this application."
}{
"error": "Application not found or you do not have permission to access it."
}{
"error": "The credentials are already being changed. Please wait until it is completed before initiating a new one."
}{
"error": "Internal server error. Please try again later."
}This endpoint has a rate limit of 1 request every 3 seconds, shared with the other endpoints that change databases (create, update, update credentials and delete).
Applications that use the old password stop connecting until you update them.
Authorizations
Body
application/json
Password of the database. 12 to 72 characters, only letters, numbers and _ . @ % + = -, starting with a letter or number. It must also be strong enough (zxcvbn score 3 or higher), otherwise the request is refused with password too weak. use a stronger password.
Required string length:
12 - 72Pattern:
^[A-Za-z0-9][A-Za-z0-9_.@%+=-]*$Example:
"Tr0ub4dor.Zebra-Lamp=91"