curl --request PUT \
--url https://app.miget.com/api/v1/services/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"public_access": true,
"backup_enabled": true,
"scheduled_backup": "<string>",
"project_id": "<string>"
}
'import requests
url = "https://app.miget.com/api/v1/services/{id}"
payload = {
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"public_access": True,
"backup_enabled": True,
"scheduled_backup": "<string>",
"project_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
ram_size: 123,
disk_size: 123,
cpu_size: 123,
public_access: true,
backup_enabled: true,
scheduled_backup: '<string>',
project_id: '<string>'
})
};
fetch('https://app.miget.com/api/v1/services/{id}', 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://app.miget.com/api/v1/services/{id}",
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([
'label' => '<string>',
'ram_size' => 123,
'disk_size' => 123,
'cpu_size' => 123,
'public_access' => true,
'backup_enabled' => true,
'scheduled_backup' => '<string>',
'project_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.miget.com/api/v1/services/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://app.miget.com/api/v1/services/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/services/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"project_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"label": "<string>",
"service_type": "<string>",
"state": "<string>",
"project_id": "<string>",
"resource_id": "<string>",
"miget_id": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"public_access": true,
"instances": 123,
"postgres_version": "<string>",
"mount_point": "<string>",
"mounts": [
{
"app_id": "0190f2c4-0000-7000-8000-000000000000",
"addon_uuid": "0190f2c4-0000-7000-8000-000000000001",
"mount_point": "/data",
"sub_path": "media/uploads",
"label": "Storage #1 for shared-storage-service"
}
],
"backup_enabled": true,
"scheduled_backup": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connection_details": {
"internal": {
"hostname": "my-service-xxx.internal",
"database": "db_name",
"port": 5432,
"username": "db_user",
"password": "db_password",
"connection_url": "postgres://db_user:db_password@my-service-xxx.internal:5432/db_name"
},
"external": {
"external_connection_url": "postgres://db_user:db_password@my-service-xxx.external:5432/db_name",
"psql_command": "PGPASSWORD=db_password psql -h my-service-xxx.external -U db_user db_name"
}
}
}Update a service
Modifies the configuration of a standalone service. You can adjust resource allocation without data loss.
curl --request PUT \
--url https://app.miget.com/api/v1/services/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"public_access": true,
"backup_enabled": true,
"scheduled_backup": "<string>",
"project_id": "<string>"
}
'import requests
url = "https://app.miget.com/api/v1/services/{id}"
payload = {
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"public_access": True,
"backup_enabled": True,
"scheduled_backup": "<string>",
"project_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
ram_size: 123,
disk_size: 123,
cpu_size: 123,
public_access: true,
backup_enabled: true,
scheduled_backup: '<string>',
project_id: '<string>'
})
};
fetch('https://app.miget.com/api/v1/services/{id}', 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://app.miget.com/api/v1/services/{id}",
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([
'label' => '<string>',
'ram_size' => 123,
'disk_size' => 123,
'cpu_size' => 123,
'public_access' => true,
'backup_enabled' => true,
'scheduled_backup' => '<string>',
'project_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.miget.com/api/v1/services/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://app.miget.com/api/v1/services/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/services/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"project_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"label": "<string>",
"service_type": "<string>",
"state": "<string>",
"project_id": "<string>",
"resource_id": "<string>",
"miget_id": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"public_access": true,
"instances": 123,
"postgres_version": "<string>",
"mount_point": "<string>",
"mounts": [
{
"app_id": "0190f2c4-0000-7000-8000-000000000000",
"addon_uuid": "0190f2c4-0000-7000-8000-000000000001",
"mount_point": "/data",
"sub_path": "media/uploads",
"label": "Storage #1 for shared-storage-service"
}
],
"backup_enabled": true,
"scheduled_backup": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connection_details": {
"internal": {
"hostname": "my-service-xxx.internal",
"database": "db_name",
"port": 5432,
"username": "db_user",
"password": "db_password",
"connection_url": "postgres://db_user:db_password@my-service-xxx.internal:5432/db_name"
},
"external": {
"external_connection_url": "postgres://db_user:db_password@my-service-xxx.external:5432/db_name",
"psql_command": "PGPASSWORD=db_password psql -h my-service-xxx.external -U db_user db_name"
}
}
}Authorizations
Bearer token for authentication. Format: 'Bearer {token}'
Headers
Workspace ID (uses default workspace if not provided)
Path Parameters
Service ID
Body
Update a service
Human-readable display name for the service
RAM allocation in MiB (e.g., 64, 128, 256)
Disk storage in GiB (e.g., 1, 5, 10)
CPU allocation in cores (e.g., 0.1, 0.25, 0.5)
Enable public internet access. Accepts true/false or '1'/'0'. For postgres type.
Enable automatic backups. Accepts true/false or '1'/'0'. Applied to the cluster asynchronously: GET backups reports backup_active once it takes effect. For postgres type.
Cron expression for backup schedule (6-field: second minute hour day month weekday). For postgres type.
Number of database instances (1 for standalone, 3/5/7 for HA cluster). For postgres type.
1, 3, 5, 7 Move the service to another project. Requires services:manage. Refused when the service's resource is assigned to projects that do not include the target.
Response
Update a service
Api_V1_Entities_Service model
Service UUID
Service name
Display name
Service type (postgres, shared_storage)
Current state. While provisioning: pending, processing, creating, stopped. Once running, the live Kubernetes status: healthy (postgres/mysql/valkey), bound (storage), or running when the status is unavailable. Unhealthy: degraded, degradated, failing, lost, crashloopbackoff, failed
Associated project UUID
Assigned resource UUID, the value POST /services accepts as resource_id
DEPRECATED: use resource_id instead
RAM allocation in MiB, the unit POST and PUT /services accept, rounded to 6 decimal places. Read from the service add-on's quota. Null when the service has no add-on
Disk allocation in GiB, the unit POST and PUT /services accept, rounded to 6 decimal places. Read from the service add-on's quota. Null when the service has no add-on
CPU allocation in cores, the unit POST and PUT /services accept. Read from the service add-on's quota. On a free plan, creating a postgres service stores 0.1 whatever cpu_size was sent; PUT stores the value sent. Null when the service has no add-on
Whether public internet access is enabled, as stored on the add-on and accepted by POST and PUT /services. Null for service types without the setting (shared_storage) or when the service has no add-on
Number of database instances (1 for standalone, 3, 5 or 7 for an HA cluster). Postgres only, null for other service types
PostgreSQL major version, as accepted by POST /services. Null for other service types
Container mount path of the shared volume. shared_storage only, null for other service types
Applications mounting this shared storage service, one entry per mount created by POST /services/{id}/mount_app, limited to apps in projects you can access. Empty for other service types
[
{
"app_id": "0190f2c4-0000-7000-8000-000000000000",
"addon_uuid": "0190f2c4-0000-7000-8000-000000000001",
"mount_point": "/data",
"sub_path": "media/uploads",
"label": "Storage #1 for shared-storage-service"
}
]
Postgres only, null for other service types or when the service has no add-on. The effective value the platform applies, as accepted by PUT /services: false on a free plan whatever was stored, otherwise the stored value, true when never set
Postgres only, null for other service types or when the service has no add-on. The effective backup schedule as a 6-field cron expression, as accepted by PUT /services: the stored schedule, or 0 0 3 * * * when none was set
Creation timestamp
Last update timestamp
Connection details for the service
{
"internal": {
"hostname": "my-service-xxx.internal",
"database": "db_name",
"port": 5432,
"username": "db_user",
"password": "db_password",
"connection_url": "postgres://db_user:db_password@my-service-xxx.internal:5432/db_name"
},
"external": {
"external_connection_url": "postgres://db_user:db_password@my-service-xxx.external:5432/db_name",
"psql_command": "PGPASSWORD=db_password psql -h my-service-xxx.external -U db_user db_name"
}
}

