curl --request PATCH \
--url https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"isProduction": true,
"applicationBuildShortId": "<string>",
"otherApplicationBuildShortIds": [
"<string>"
],
"projectShortId": "<string>"
}
'import requests
url = "https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}"
payload = {
"name": "<string>",
"url": "<string>",
"isProduction": True,
"applicationBuildShortId": "<string>",
"otherApplicationBuildShortIds": ["<string>"],
"projectShortId": "<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({
name: '<string>',
url: '<string>',
isProduction: true,
applicationBuildShortId: '<string>',
otherApplicationBuildShortIds: ['<string>'],
projectShortId: '<string>'
})
};
fetch('https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}', 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.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}",
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([
'name' => '<string>',
'url' => '<string>',
'isProduction' => true,
'applicationBuildShortId' => '<string>',
'otherApplicationBuildShortIds' => [
'<string>'
],
'projectShortId' => '<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.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"isProduction\": true,\n \"applicationBuildShortId\": \"<string>\",\n \"otherApplicationBuildShortIds\": [\n \"<string>\"\n ],\n \"projectShortId\": \"<string>\"\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.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"isProduction\": true,\n \"applicationBuildShortId\": \"<string>\",\n \"otherApplicationBuildShortIds\": [\n \"<string>\"\n ],\n \"projectShortId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}")
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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"isProduction\": true,\n \"applicationBuildShortId\": \"<string>\",\n \"otherApplicationBuildShortIds\": [\n \"<string>\"\n ],\n \"projectShortId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"environment": {
"shortId": "<string>",
"name": "<string>",
"url": "<string>",
"isProduction": true,
"applicationBuildShortId": "<string>",
"otherApplicationBuildShortIds": [
"<string>"
],
"customHeaders": [
{
"domains": [
"<string>"
],
"headers": {}
}
],
"basicAuth": [
{
"domains": [
"<string>"
],
"username": "<string>"
}
]
}
}Update environment
Rename an environment, change its start URL, flip its production flag, or set the mobile build it launches by default, as Settings → Applications & Envs does.
Only the fields you pass change. url applies to web and API applications; applicationBuildShortId and otherApplicationBuildShortIds apply to mobile applications. GitHub App runs, scheduled runs, chats, and runs without a build override use the environment’s build, so call this after create_application_build on merges to your default branch to track the latest merged code.
curl --request PATCH \
--url https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"isProduction": true,
"applicationBuildShortId": "<string>",
"otherApplicationBuildShortIds": [
"<string>"
],
"projectShortId": "<string>"
}
'import requests
url = "https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}"
payload = {
"name": "<string>",
"url": "<string>",
"isProduction": True,
"applicationBuildShortId": "<string>",
"otherApplicationBuildShortIds": ["<string>"],
"projectShortId": "<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({
name: '<string>',
url: '<string>',
isProduction: true,
applicationBuildShortId: '<string>',
otherApplicationBuildShortIds: ['<string>'],
projectShortId: '<string>'
})
};
fetch('https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}', 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.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}",
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([
'name' => '<string>',
'url' => '<string>',
'isProduction' => true,
'applicationBuildShortId' => '<string>',
'otherApplicationBuildShortIds' => [
'<string>'
],
'projectShortId' => '<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.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"isProduction\": true,\n \"applicationBuildShortId\": \"<string>\",\n \"otherApplicationBuildShortIds\": [\n \"<string>\"\n ],\n \"projectShortId\": \"<string>\"\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.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"isProduction\": true,\n \"applicationBuildShortId\": \"<string>\",\n \"otherApplicationBuildShortIds\": [\n \"<string>\"\n ],\n \"projectShortId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qa.tech/v1/applications/{applicationShortId}/environments/{environmentShortId}")
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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"isProduction\": true,\n \"applicationBuildShortId\": \"<string>\",\n \"otherApplicationBuildShortIds\": [\n \"<string>\"\n ],\n \"projectShortId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"environment": {
"shortId": "<string>",
"name": "<string>",
"url": "<string>",
"isProduction": true,
"applicationBuildShortId": "<string>",
"otherApplicationBuildShortIds": [
"<string>"
],
"customHeaders": [
{
"domains": [
"<string>"
],
"headers": {}
}
],
"basicAuth": [
{
"domains": [
"<string>"
],
"username": "<string>"
}
]
}
}Path Parameters
Body
Fields to change on an environment. Omitted fields keep their current value; pass at least one.
Mobile only, together with applicationBuildShortId. Companion apps installed next to the primary build, replacing the current list. Omit to keep the current list; pass [] to clear it. Every build must belong to the same application, use the same platform, and have a distinct bundle ID. At most 3.
^build(-.+_.+|_.+)$Was this page helpful?