curl --request PATCH \
--url https://api.instacloud.com/orgs/{orgId}/templates/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedUpdatedAt": "2023-11-07T05:31:56Z",
"code": "<string>",
"name": "<string>",
"tagline": "<string>",
"category": "<string>",
"readme": "<string>",
"logoUrl": "<string>",
"variables": [
{
"service": "<string>",
"name": "<string>",
"choice": {
"kind": "required",
"description": "<string>"
},
"newName": "<string>",
"add": true,
"delete": true
}
],
"services": [
{
"name": "<string>",
"removed": true,
"settings": {
"public": true,
"image": "<string>",
"port": 123,
"alwaysOn": true,
"mountPath": "<string>",
"pgVersion": 123,
"healthcheck": "<string>",
"command": "<string>"
},
"add": {
"type": "compute",
"image": "<string>",
"port": 123
},
"delete": true
}
]
}
'import requests
url = "https://api.instacloud.com/orgs/{orgId}/templates/{code}"
payload = {
"expectedUpdatedAt": "2023-11-07T05:31:56Z",
"code": "<string>",
"name": "<string>",
"tagline": "<string>",
"category": "<string>",
"readme": "<string>",
"logoUrl": "<string>",
"variables": [
{
"service": "<string>",
"name": "<string>",
"choice": {
"kind": "required",
"description": "<string>"
},
"newName": "<string>",
"add": True,
"delete": True
}
],
"services": [
{
"name": "<string>",
"removed": True,
"settings": {
"public": True,
"image": "<string>",
"port": 123,
"alwaysOn": True,
"mountPath": "<string>",
"pgVersion": 123,
"healthcheck": "<string>",
"command": "<string>"
},
"add": {
"type": "compute",
"image": "<string>",
"port": 123
},
"delete": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedUpdatedAt: '2023-11-07T05:31:56Z',
code: '<string>',
name: '<string>',
tagline: '<string>',
category: '<string>',
readme: '<string>',
logoUrl: '<string>',
variables: [
{
service: '<string>',
name: '<string>',
choice: {kind: 'required', description: '<string>'},
newName: '<string>',
add: true,
delete: true
}
],
services: [
{
name: '<string>',
removed: true,
settings: {
public: true,
image: '<string>',
port: 123,
alwaysOn: true,
mountPath: '<string>',
pgVersion: 123,
healthcheck: '<string>',
command: '<string>'
},
add: {type: 'compute', image: '<string>', port: 123},
delete: true
}
]
})
};
fetch('https://api.instacloud.com/orgs/{orgId}/templates/{code}', 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/orgs/{orgId}/templates/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expectedUpdatedAt' => '2023-11-07T05:31:56Z',
'code' => '<string>',
'name' => '<string>',
'tagline' => '<string>',
'category' => '<string>',
'readme' => '<string>',
'logoUrl' => '<string>',
'variables' => [
[
'service' => '<string>',
'name' => '<string>',
'choice' => [
'kind' => 'required',
'description' => '<string>'
],
'newName' => '<string>',
'add' => true,
'delete' => true
]
],
'services' => [
[
'name' => '<string>',
'removed' => true,
'settings' => [
'public' => true,
'image' => '<string>',
'port' => 123,
'alwaysOn' => true,
'mountPath' => '<string>',
'pgVersion' => 123,
'healthcheck' => '<string>',
'command' => '<string>'
],
'add' => [
'type' => 'compute',
'image' => '<string>',
'port' => 123
],
'delete' => true
]
]
]),
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/orgs/{orgId}/templates/{code}"
payload := strings.NewReader("{\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\",\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"tagline\": \"<string>\",\n \"category\": \"<string>\",\n \"readme\": \"<string>\",\n \"logoUrl\": \"<string>\",\n \"variables\": [\n {\n \"service\": \"<string>\",\n \"name\": \"<string>\",\n \"choice\": {\n \"kind\": \"required\",\n \"description\": \"<string>\"\n },\n \"newName\": \"<string>\",\n \"add\": true,\n \"delete\": true\n }\n ],\n \"services\": [\n {\n \"name\": \"<string>\",\n \"removed\": true,\n \"settings\": {\n \"public\": true,\n \"image\": \"<string>\",\n \"port\": 123,\n \"alwaysOn\": true,\n \"mountPath\": \"<string>\",\n \"pgVersion\": 123,\n \"healthcheck\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"add\": {\n \"type\": \"compute\",\n \"image\": \"<string>\",\n \"port\": 123\n },\n \"delete\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.instacloud.com/orgs/{orgId}/templates/{code}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\",\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"tagline\": \"<string>\",\n \"category\": \"<string>\",\n \"readme\": \"<string>\",\n \"logoUrl\": \"<string>\",\n \"variables\": [\n {\n \"service\": \"<string>\",\n \"name\": \"<string>\",\n \"choice\": {\n \"kind\": \"required\",\n \"description\": \"<string>\"\n },\n \"newName\": \"<string>\",\n \"add\": true,\n \"delete\": true\n }\n ],\n \"services\": [\n {\n \"name\": \"<string>\",\n \"removed\": true,\n \"settings\": {\n \"public\": true,\n \"image\": \"<string>\",\n \"port\": 123,\n \"alwaysOn\": true,\n \"mountPath\": \"<string>\",\n \"pgVersion\": 123,\n \"healthcheck\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"add\": {\n \"type\": \"compute\",\n \"image\": \"<string>\",\n \"port\": 123\n },\n \"delete\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/orgs/{orgId}/templates/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\",\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"tagline\": \"<string>\",\n \"category\": \"<string>\",\n \"readme\": \"<string>\",\n \"logoUrl\": \"<string>\",\n \"variables\": [\n {\n \"service\": \"<string>\",\n \"name\": \"<string>\",\n \"choice\": {\n \"kind\": \"required\",\n \"description\": \"<string>\"\n },\n \"newName\": \"<string>\",\n \"add\": true,\n \"delete\": true\n }\n ],\n \"services\": [\n {\n \"name\": \"<string>\",\n \"removed\": true,\n \"settings\": {\n \"public\": true,\n \"image\": \"<string>\",\n \"port\": 123,\n \"alwaysOn\": true,\n \"mountPath\": \"<string>\",\n \"pgVersion\": 123,\n \"healthcheck\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"add\": {\n \"type\": \"compute\",\n \"image\": \"<string>\",\n \"port\": 123\n },\n \"delete\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceProjectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"blank": true,
"status": "draft",
"publishedVersion": "<string>",
"hasUnpublishedChanges": true,
"name": "<string>",
"tagline": "<string>",
"category": "<string>",
"readme": "<string>",
"defaultReadme": "<string>",
"logoUrl": "<string>",
"services": [
{
"name": "<string>",
"type": "<string>",
"image": "<string>",
"port": 123,
"healthcheck": "<string>",
"volume": true,
"mountPath": "<string>",
"command": "<string>",
"alwaysOn": true,
"removed": true,
"variables": [
{
"name": "<string>",
"kind": "required",
"value": "<string>",
"description": "<string>",
"brokenReference": "<string>",
"originalName": "<string>",
"added": true
}
],
"public": true,
"pgVersion": 123,
"added": true
}
],
"referenceOptions": [
{
"token": "<string>",
"service": "<string>",
"key": "<string>"
}
],
"editableFields": {
"web": [
"image"
],
"worker": [
"image"
],
"postgres": [
"pgVersion"
],
"redis": [
"<string>"
],
"mysql": [
"<string>"
],
"mongodb": [
"<string>"
],
"storage": [
"public"
]
},
"referenceKeys": {
"postgres": [
"<string>"
],
"redis": [
"<string>"
],
"mysql": [
"<string>"
],
"mongodb": [
"<string>"
],
"storage": [
"<string>"
]
},
"publishRequirements": [
{
"code": "has_service",
"ok": true,
"items": [
"<string>"
]
}
],
"report": {
"skipped": [
{
"reason": "<string>",
"service": "<string>",
"variable": "<string>",
"fix": "<string>"
}
],
"blocked": [
{
"reason": "<string>",
"service": "<string>",
"variable": "<string>",
"fix": "<string>"
}
],
"notices": [
{
"reason": "<string>",
"service": "<string>",
"variable": "<string>",
"fix": "<string>"
}
]
},
"updatedAt": "<string>",
"takenDown": true,
"deployCount": 123,
"totalProjects": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>"
}Edit a community template draft
Token scope: account · org — read-only tokens refused (not a GET).
curl --request PATCH \
--url https://api.instacloud.com/orgs/{orgId}/templates/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedUpdatedAt": "2023-11-07T05:31:56Z",
"code": "<string>",
"name": "<string>",
"tagline": "<string>",
"category": "<string>",
"readme": "<string>",
"logoUrl": "<string>",
"variables": [
{
"service": "<string>",
"name": "<string>",
"choice": {
"kind": "required",
"description": "<string>"
},
"newName": "<string>",
"add": true,
"delete": true
}
],
"services": [
{
"name": "<string>",
"removed": true,
"settings": {
"public": true,
"image": "<string>",
"port": 123,
"alwaysOn": true,
"mountPath": "<string>",
"pgVersion": 123,
"healthcheck": "<string>",
"command": "<string>"
},
"add": {
"type": "compute",
"image": "<string>",
"port": 123
},
"delete": true
}
]
}
'import requests
url = "https://api.instacloud.com/orgs/{orgId}/templates/{code}"
payload = {
"expectedUpdatedAt": "2023-11-07T05:31:56Z",
"code": "<string>",
"name": "<string>",
"tagline": "<string>",
"category": "<string>",
"readme": "<string>",
"logoUrl": "<string>",
"variables": [
{
"service": "<string>",
"name": "<string>",
"choice": {
"kind": "required",
"description": "<string>"
},
"newName": "<string>",
"add": True,
"delete": True
}
],
"services": [
{
"name": "<string>",
"removed": True,
"settings": {
"public": True,
"image": "<string>",
"port": 123,
"alwaysOn": True,
"mountPath": "<string>",
"pgVersion": 123,
"healthcheck": "<string>",
"command": "<string>"
},
"add": {
"type": "compute",
"image": "<string>",
"port": 123
},
"delete": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedUpdatedAt: '2023-11-07T05:31:56Z',
code: '<string>',
name: '<string>',
tagline: '<string>',
category: '<string>',
readme: '<string>',
logoUrl: '<string>',
variables: [
{
service: '<string>',
name: '<string>',
choice: {kind: 'required', description: '<string>'},
newName: '<string>',
add: true,
delete: true
}
],
services: [
{
name: '<string>',
removed: true,
settings: {
public: true,
image: '<string>',
port: 123,
alwaysOn: true,
mountPath: '<string>',
pgVersion: 123,
healthcheck: '<string>',
command: '<string>'
},
add: {type: 'compute', image: '<string>', port: 123},
delete: true
}
]
})
};
fetch('https://api.instacloud.com/orgs/{orgId}/templates/{code}', 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/orgs/{orgId}/templates/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expectedUpdatedAt' => '2023-11-07T05:31:56Z',
'code' => '<string>',
'name' => '<string>',
'tagline' => '<string>',
'category' => '<string>',
'readme' => '<string>',
'logoUrl' => '<string>',
'variables' => [
[
'service' => '<string>',
'name' => '<string>',
'choice' => [
'kind' => 'required',
'description' => '<string>'
],
'newName' => '<string>',
'add' => true,
'delete' => true
]
],
'services' => [
[
'name' => '<string>',
'removed' => true,
'settings' => [
'public' => true,
'image' => '<string>',
'port' => 123,
'alwaysOn' => true,
'mountPath' => '<string>',
'pgVersion' => 123,
'healthcheck' => '<string>',
'command' => '<string>'
],
'add' => [
'type' => 'compute',
'image' => '<string>',
'port' => 123
],
'delete' => true
]
]
]),
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/orgs/{orgId}/templates/{code}"
payload := strings.NewReader("{\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\",\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"tagline\": \"<string>\",\n \"category\": \"<string>\",\n \"readme\": \"<string>\",\n \"logoUrl\": \"<string>\",\n \"variables\": [\n {\n \"service\": \"<string>\",\n \"name\": \"<string>\",\n \"choice\": {\n \"kind\": \"required\",\n \"description\": \"<string>\"\n },\n \"newName\": \"<string>\",\n \"add\": true,\n \"delete\": true\n }\n ],\n \"services\": [\n {\n \"name\": \"<string>\",\n \"removed\": true,\n \"settings\": {\n \"public\": true,\n \"image\": \"<string>\",\n \"port\": 123,\n \"alwaysOn\": true,\n \"mountPath\": \"<string>\",\n \"pgVersion\": 123,\n \"healthcheck\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"add\": {\n \"type\": \"compute\",\n \"image\": \"<string>\",\n \"port\": 123\n },\n \"delete\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.instacloud.com/orgs/{orgId}/templates/{code}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\",\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"tagline\": \"<string>\",\n \"category\": \"<string>\",\n \"readme\": \"<string>\",\n \"logoUrl\": \"<string>\",\n \"variables\": [\n {\n \"service\": \"<string>\",\n \"name\": \"<string>\",\n \"choice\": {\n \"kind\": \"required\",\n \"description\": \"<string>\"\n },\n \"newName\": \"<string>\",\n \"add\": true,\n \"delete\": true\n }\n ],\n \"services\": [\n {\n \"name\": \"<string>\",\n \"removed\": true,\n \"settings\": {\n \"public\": true,\n \"image\": \"<string>\",\n \"port\": 123,\n \"alwaysOn\": true,\n \"mountPath\": \"<string>\",\n \"pgVersion\": 123,\n \"healthcheck\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"add\": {\n \"type\": \"compute\",\n \"image\": \"<string>\",\n \"port\": 123\n },\n \"delete\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/orgs/{orgId}/templates/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\",\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"tagline\": \"<string>\",\n \"category\": \"<string>\",\n \"readme\": \"<string>\",\n \"logoUrl\": \"<string>\",\n \"variables\": [\n {\n \"service\": \"<string>\",\n \"name\": \"<string>\",\n \"choice\": {\n \"kind\": \"required\",\n \"description\": \"<string>\"\n },\n \"newName\": \"<string>\",\n \"add\": true,\n \"delete\": true\n }\n ],\n \"services\": [\n {\n \"name\": \"<string>\",\n \"removed\": true,\n \"settings\": {\n \"public\": true,\n \"image\": \"<string>\",\n \"port\": 123,\n \"alwaysOn\": true,\n \"mountPath\": \"<string>\",\n \"pgVersion\": 123,\n \"healthcheck\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"add\": {\n \"type\": \"compute\",\n \"image\": \"<string>\",\n \"port\": 123\n },\n \"delete\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceProjectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"blank": true,
"status": "draft",
"publishedVersion": "<string>",
"hasUnpublishedChanges": true,
"name": "<string>",
"tagline": "<string>",
"category": "<string>",
"readme": "<string>",
"defaultReadme": "<string>",
"logoUrl": "<string>",
"services": [
{
"name": "<string>",
"type": "<string>",
"image": "<string>",
"port": 123,
"healthcheck": "<string>",
"volume": true,
"mountPath": "<string>",
"command": "<string>",
"alwaysOn": true,
"removed": true,
"variables": [
{
"name": "<string>",
"kind": "required",
"value": "<string>",
"description": "<string>",
"brokenReference": "<string>",
"originalName": "<string>",
"added": true
}
],
"public": true,
"pgVersion": 123,
"added": true
}
],
"referenceOptions": [
{
"token": "<string>",
"service": "<string>",
"key": "<string>"
}
],
"editableFields": {
"web": [
"image"
],
"worker": [
"image"
],
"postgres": [
"pgVersion"
],
"redis": [
"<string>"
],
"mysql": [
"<string>"
],
"mongodb": [
"<string>"
],
"storage": [
"public"
]
},
"referenceKeys": {
"postgres": [
"<string>"
],
"redis": [
"<string>"
],
"mysql": [
"<string>"
],
"mongodb": [
"<string>"
],
"storage": [
"<string>"
]
},
"publishRequirements": [
{
"code": "has_service",
"ok": true,
"items": [
"<string>"
]
}
],
"report": {
"skipped": [
{
"reason": "<string>",
"service": "<string>",
"variable": "<string>",
"fix": "<string>"
}
],
"blocked": [
{
"reason": "<string>",
"service": "<string>",
"variable": "<string>",
"fix": "<string>"
}
],
"notices": [
{
"reason": "<string>",
"service": "<string>",
"variable": "<string>",
"fix": "<string>"
}
]
},
"updatedAt": "<string>",
"takenDown": true,
"deployCount": 123,
"totalProjects": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>"
}Authorizations
Session access JWT or an API token (insta_<prefix>_<secret>).
Body
The draft's updatedAt as the client rendered it. A different current value answers 409 template_draft_changed.
Rename. Only before the first publish.
1 - 80160An https:// image link. The link and its percent-encoded form are each at most 2048 characters. null clears it.
Only the variables that changed, at most 600, the cap a project apply has. A name deleted in this PATCH can be added again only in a later PATCH. One invalid entry answers 400 and nothing is saved.
600Show child attributes
Show child attributes
Only the services that changed, at most 100. An add or a delete entry carries nothing else. Service adds run first and deletes run after every other entry. A template holds at most 50 services. A name deleted in this PATCH can be added again only in a later PATCH. One invalid entry answers 400 and nothing is saved.
100Show child attributes
Show child attributes
Response
Default Response
Show child attributes
Show child attributes