Update service source
curl --request PATCH \
--url https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>",
"rootDir": "<string>",
"autoDeploy": true,
"buildCommand": "<string>",
"startCommand": "<string>",
"watchPaths": [
"<string>"
]
}
'import requests
url = "https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source"
payload = {
"branch": "<string>",
"rootDir": "<string>",
"autoDeploy": True,
"buildCommand": "<string>",
"startCommand": "<string>",
"watchPaths": ["<string>"]
}
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({
branch: '<string>',
rootDir: '<string>',
autoDeploy: true,
buildCommand: '<string>',
startCommand: '<string>',
watchPaths: ['<string>']
})
};
fetch('https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source', 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}/source",
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([
'branch' => '<string>',
'rootDir' => '<string>',
'autoDeploy' => true,
'buildCommand' => '<string>',
'startCommand' => '<string>',
'watchPaths' => [
'<string>'
]
]),
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}/source"
payload := strings.NewReader("{\n \"branch\": \"<string>\",\n \"rootDir\": \"<string>\",\n \"autoDeploy\": true,\n \"buildCommand\": \"<string>\",\n \"startCommand\": \"<string>\",\n \"watchPaths\": [\n \"<string>\"\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/projects/{projectId}/services/{serviceId}/source")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"<string>\",\n \"rootDir\": \"<string>\",\n \"autoDeploy\": true,\n \"buildCommand\": \"<string>\",\n \"startCommand\": \"<string>\",\n \"watchPaths\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source")
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 \"branch\": \"<string>\",\n \"rootDir\": \"<string>\",\n \"autoDeploy\": true,\n \"buildCommand\": \"<string>\",\n \"startCommand\": \"<string>\",\n \"watchPaths\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"source": {
"type": "image",
"image": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"repo": "<string>",
"branch": "<string>",
"root_dir": "<string>",
"watch_paths": [
"<string>"
],
"auto_deploy": true,
"public": true,
"installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_id": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_build": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_binding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commit_sha": "<string>",
"status": "queued",
"image_ref": "<string>",
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
"build": {
"buildId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queued": true,
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"status": "<string>",
"approvalId": "<string>",
"action": "<string>",
"actions": [
"<string>"
],
"message": "<string>",
"url": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Services
Update service source
Token scope: account · org · project — read-only tokens refused (not a GET).
Change how a connected service builds (admin+): the tracked branch, root directory, auto-deploy, build/start commands. A branch, root-directory or command change deploys the new configuration now (even at the same commit).
PATCH
/
projects
/
{projectId}
/
services
/
{serviceId}
/
source
Update service source
curl --request PATCH \
--url https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>",
"rootDir": "<string>",
"autoDeploy": true,
"buildCommand": "<string>",
"startCommand": "<string>",
"watchPaths": [
"<string>"
]
}
'import requests
url = "https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source"
payload = {
"branch": "<string>",
"rootDir": "<string>",
"autoDeploy": True,
"buildCommand": "<string>",
"startCommand": "<string>",
"watchPaths": ["<string>"]
}
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({
branch: '<string>',
rootDir: '<string>',
autoDeploy: true,
buildCommand: '<string>',
startCommand: '<string>',
watchPaths: ['<string>']
})
};
fetch('https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source', 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}/source",
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([
'branch' => '<string>',
'rootDir' => '<string>',
'autoDeploy' => true,
'buildCommand' => '<string>',
'startCommand' => '<string>',
'watchPaths' => [
'<string>'
]
]),
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}/source"
payload := strings.NewReader("{\n \"branch\": \"<string>\",\n \"rootDir\": \"<string>\",\n \"autoDeploy\": true,\n \"buildCommand\": \"<string>\",\n \"startCommand\": \"<string>\",\n \"watchPaths\": [\n \"<string>\"\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/projects/{projectId}/services/{serviceId}/source")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"<string>\",\n \"rootDir\": \"<string>\",\n \"autoDeploy\": true,\n \"buildCommand\": \"<string>\",\n \"startCommand\": \"<string>\",\n \"watchPaths\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/projects/{projectId}/services/{serviceId}/source")
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 \"branch\": \"<string>\",\n \"rootDir\": \"<string>\",\n \"autoDeploy\": true,\n \"buildCommand\": \"<string>\",\n \"startCommand\": \"<string>\",\n \"watchPaths\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"source": {
"type": "image",
"image": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"repo": "<string>",
"branch": "<string>",
"root_dir": "<string>",
"watch_paths": [
"<string>"
],
"auto_deploy": true,
"public": true,
"installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_id": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_build": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_binding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commit_sha": "<string>",
"status": "queued",
"image_ref": "<string>",
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
"build": {
"buildId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queued": true,
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"status": "<string>",
"approvalId": "<string>",
"action": "<string>",
"actions": [
"<string>"
],
"message": "<string>",
"url": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Session access JWT or an API token (insta_<prefix>_<secret>).
Body
application/json