curl --request PUT \
--url https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mountPath": "<string>",
"sizeGib": 2
}
'import requests
url = "https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume"
payload = {
"mountPath": "<string>",
"sizeGib": 2
}
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({mountPath: '<string>', sizeGib: 2})
};
fetch('https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume', 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.instacloud.com/projects/{projectId}/services/{serviceId}/volume",
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([
'mountPath' => '<string>',
'sizeGib' => 2
]),
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.instacloud.com/projects/{projectId}/services/{serviceId}/volume"
payload := strings.NewReader("{\n \"mountPath\": \"<string>\",\n \"sizeGib\": 2\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.instacloud.com/projects/{projectId}/services/{serviceId}/volume")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mountPath\": \"<string>\",\n \"sizeGib\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume")
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 \"mountPath\": \"<string>\",\n \"sizeGib\": 2\n}"
response = http.request(request)
puts response.read_body{
"volume": {
"sizeGib": 123,
"mountPath": "<string>",
"id": "<string>",
"appliedMountPath": "<string>",
"pending": true
},
"cap": {
"volumeGib": 123
},
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "postgres",
"name": "<string>",
"spec": {},
"machine_count": 123,
"desired_state": "running",
"always_on": true,
"websocket": true,
"region": "<string>",
"domain": "<string>",
"public": true,
"image": "<string>",
"port": 123,
"start_command": "<string>",
"volume_applied_mount_path": "<string>",
"volume_mount_path": "<string>",
"volume_gib": 123,
"pg_version": 123,
"template_deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_modified": true,
"template_code": "<string>",
"template_logo_url": "<string>",
"source": {
"type": "image",
"owner": "<string>",
"repo": "<string>",
"branch": "<string>",
"auto_deploy": true
},
"status": "creating",
"created_at": "2023-11-07T05:31:56Z"
},
"changed": true,
"attached": true
}{
"status": "approval_required",
"approvalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"actions": [
"<string>"
],
"message": "<string>",
"url": "<string>",
"nextActions": [
{
"op": "<string>",
"reason": "<string>",
"args": {},
"gated": true
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Set service volume
Token scope: account · org · project — read-only tokens refused (not a GET).
Attach or grow a compute service’s persistent volume, or grow a managed database’s data volume (always present). No volume yet: attaches one (sizeGib omitted = the org’s OWN plan volume cap — 10Gi free, 50Gi paid by default, env-overridable per deployment; any plan may name a size up to the free cap; larger is paid and capped at the plan cap; machineCount must be 1; the disk is created and mounted on the NEXT deploy). Volume present: grows it (paid plans; grow-only — a provisioned disk cannot shrink; ≤ the plan’s volume cap); sizeGib omitted never resizes; mountPath alone stages a path change for the next deploy (restarts the application), otherwise the request is a no-op read-back. Application configuration is not rewritten. Billing is actual data stored, so the size is a cap, not a price.
curl --request PUT \
--url https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mountPath": "<string>",
"sizeGib": 2
}
'import requests
url = "https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume"
payload = {
"mountPath": "<string>",
"sizeGib": 2
}
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({mountPath: '<string>', sizeGib: 2})
};
fetch('https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume', 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.instacloud.com/projects/{projectId}/services/{serviceId}/volume",
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([
'mountPath' => '<string>',
'sizeGib' => 2
]),
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.instacloud.com/projects/{projectId}/services/{serviceId}/volume"
payload := strings.NewReader("{\n \"mountPath\": \"<string>\",\n \"sizeGib\": 2\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.instacloud.com/projects/{projectId}/services/{serviceId}/volume")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mountPath\": \"<string>\",\n \"sizeGib\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/projects/{projectId}/services/{serviceId}/volume")
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 \"mountPath\": \"<string>\",\n \"sizeGib\": 2\n}"
response = http.request(request)
puts response.read_body{
"volume": {
"sizeGib": 123,
"mountPath": "<string>",
"id": "<string>",
"appliedMountPath": "<string>",
"pending": true
},
"cap": {
"volumeGib": 123
},
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "postgres",
"name": "<string>",
"spec": {},
"machine_count": 123,
"desired_state": "running",
"always_on": true,
"websocket": true,
"region": "<string>",
"domain": "<string>",
"public": true,
"image": "<string>",
"port": 123,
"start_command": "<string>",
"volume_applied_mount_path": "<string>",
"volume_mount_path": "<string>",
"volume_gib": 123,
"pg_version": 123,
"template_deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_modified": true,
"template_code": "<string>",
"template_logo_url": "<string>",
"source": {
"type": "image",
"owner": "<string>",
"repo": "<string>",
"branch": "<string>",
"auto_deploy": true
},
"status": "creating",
"created_at": "2023-11-07T05:31:56Z"
},
"changed": true,
"attached": true
}{
"status": "approval_required",
"approvalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"actions": [
"<string>"
],
"message": "<string>",
"url": "<string>",
"nextActions": [
{
"op": "<string>",
"reason": "<string>",
"args": {},
"gated": true
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Session access JWT or an API token (insta_<prefix>_<secret>).
Body
Compute only: container mount path chosen on attachment; defaults to /data. Omit to preserve an existing path; path changes apply on the next deploy.
volume size in whole Gi — when a volume exists, must be ≥ its current size; omit to attach at the plan volume cap of the calling org (10Gi free / 50Gi paid by default, env-overridable per deployment) — or, when one exists, read it back unchanged
x >= 1Response
Default Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A project-level service (postgres | storage | compute | redis | mysql | mongodb).
Show child attributes
Show child attributes
true when this call attached a NEW volume (it mounts at mountPath on the next deploy); false/absent when it grew an existing one