cURL
curl --request PUT \
--url https://api.camposcloud.com/v1/databases/{databaseId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"memoryMB": 1024
}
'import requests
url = "https://api.camposcloud.com/v1/databases/{databaseId}"
payload = { "memoryMB": 1024 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({memoryMB: 1024})
};
fetch('https://api.camposcloud.com/v1/databases/{databaseId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'memoryMB' => 1024
]),
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}"
payload := strings.NewReader("{\n \"memoryMB\": 1024\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.camposcloud.com/v1/databases/{databaseId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"memoryMB\": 1024\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.camposcloud.com/v1/databases/{databaseId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memoryMB\": 1024\n}"
response = http.request(request)
puts response.read_body{
"message": "Database instance 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": "the total memory exceeds the user's plan limit."
}{
"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": "Database change limit reached, please try again later"
}{
"error": "Internal server error. Please try again later."
}Databases
/v1/databases/{databaseId}
This endpoint changes the name or the memory of a database.
PUT
/
v1
/
databases
/
{databaseId}
cURL
curl --request PUT \
--url https://api.camposcloud.com/v1/databases/{databaseId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"memoryMB": 1024
}
'import requests
url = "https://api.camposcloud.com/v1/databases/{databaseId}"
payload = { "memoryMB": 1024 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({memoryMB: 1024})
};
fetch('https://api.camposcloud.com/v1/databases/{databaseId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'memoryMB' => 1024
]),
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}"
payload := strings.NewReader("{\n \"memoryMB\": 1024\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.camposcloud.com/v1/databases/{databaseId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"memoryMB\": 1024\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.camposcloud.com/v1/databases/{databaseId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memoryMB\": 1024\n}"
response = http.request(request)
puts response.read_body{
"message": "Database instance 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": "the total memory exceeds the user's plan limit."
}{
"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": "Database change limit reached, please try again later"
}{
"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).
A memory change is only applied the next time the database is started, stopped or restarted.
Authorizations
Body
application/json