Update an environment
Updates an environment by ID. The project is derived from the entity. Returns the bare updated row (no data envelope), matching the dashboard settings UI it serves.
curl --request PATCH \
--url https://api.empirical.run/api/environments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"is_disabled": true,
"playwright_projects_match": [
"<string>"
],
"playwright_projects_ignore": [
"<string>"
],
"tags": [
"<string>"
],
"exclude_tags": [
"<string>"
],
"scheduled_trigger": "<string>",
"scheduled_concurrency": {
"group": "<string>"
}
}
'import requests
url = "https://api.empirical.run/api/environments/{id}"
payload = {
"name": "<string>",
"slug": "<string>",
"is_disabled": True,
"playwright_projects_match": ["<string>"],
"playwright_projects_ignore": ["<string>"],
"tags": ["<string>"],
"exclude_tags": ["<string>"],
"scheduled_trigger": "<string>",
"scheduled_concurrency": { "group": "<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>',
slug: '<string>',
is_disabled: true,
playwright_projects_match: ['<string>'],
playwright_projects_ignore: ['<string>'],
tags: ['<string>'],
exclude_tags: ['<string>'],
scheduled_trigger: '<string>',
scheduled_concurrency: {group: '<string>'}
})
};
fetch('https://api.empirical.run/api/environments/{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://api.empirical.run/api/environments/{id}",
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>',
'slug' => '<string>',
'is_disabled' => true,
'playwright_projects_match' => [
'<string>'
],
'playwright_projects_ignore' => [
'<string>'
],
'tags' => [
'<string>'
],
'exclude_tags' => [
'<string>'
],
'scheduled_trigger' => '<string>',
'scheduled_concurrency' => [
'group' => '<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.empirical.run/api/environments/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"is_disabled\": true,\n \"playwright_projects_match\": [\n \"<string>\"\n ],\n \"playwright_projects_ignore\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"scheduled_trigger\": \"<string>\",\n \"scheduled_concurrency\": {\n \"group\": \"<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.empirical.run/api/environments/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"is_disabled\": true,\n \"playwright_projects_match\": [\n \"<string>\"\n ],\n \"playwright_projects_ignore\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"scheduled_trigger\": \"<string>\",\n \"scheduled_concurrency\": {\n \"group\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/environments/{id}")
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 \"slug\": \"<string>\",\n \"is_disabled\": true,\n \"playwright_projects_match\": [\n \"<string>\"\n ],\n \"playwright_projects_ignore\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"scheduled_trigger\": \"<string>\",\n \"scheduled_concurrency\": {\n \"group\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"project_id": 123,
"slug": "<string>",
"name": "<string>",
"playwright_projects_match": [
"<string>"
],
"playwright_projects_ignore": [
"<string>"
],
"tags": [
"<string>"
],
"exclude_tags": [
"<string>"
],
"is_disabled": true,
"env_files": [
"<string>"
],
"scheduled_trigger": "<string>",
"scheduled_concurrency": {
"group": "<string>",
"on_conflict": "cancel"
},
"reporter_config": {
"schema_version": 1,
"reporters": [
{
"reporter_type": "slack_run_status",
"slack_channel_ids": [
2
]
}
]
},
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
Tags selecting the tests to run (e.g. @smoke); a missing @ is added. A test runs when one of its tags contains any of them, so smoke also selects @smoke-nightly. A test title is not a tag: checkout flow matches no test. To run specific tests, use test_case_ids. Saved for runs in this environment; a trigger request that sends this field replaces it.
1Tags whose tests are skipped (e.g. @slow). Applied after every other selection, so it can only remove tests: with tags it runs tests matching tags but not exclude_tags; alone it runs every test except the excluded ones. Saved for runs in this environment; a trigger request that sends this field replaces it.
1Response
The updated environment row (no data envelope).
Tags selecting the tests to run (e.g. @smoke); a missing @ is added. A test runs when one of its tags contains any of them, so smoke also selects @smoke-nightly. A test title is not a tag: checkout flow matches no test. To run specific tests, use test_case_ids. Saved for runs in this environment; a trigger request that sends this field replaces it.
Tags whose tests are skipped (e.g. @slow). Applied after every other selection, so it can only remove tests: with tags it runs tests matching tags but not exclude_tags; alone it runs every test except the excluded ones. Saved for runs in this environment; a trigger request that sends this field replaces it.
Was this page helpful?
curl --request PATCH \
--url https://api.empirical.run/api/environments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"is_disabled": true,
"playwright_projects_match": [
"<string>"
],
"playwright_projects_ignore": [
"<string>"
],
"tags": [
"<string>"
],
"exclude_tags": [
"<string>"
],
"scheduled_trigger": "<string>",
"scheduled_concurrency": {
"group": "<string>"
}
}
'import requests
url = "https://api.empirical.run/api/environments/{id}"
payload = {
"name": "<string>",
"slug": "<string>",
"is_disabled": True,
"playwright_projects_match": ["<string>"],
"playwright_projects_ignore": ["<string>"],
"tags": ["<string>"],
"exclude_tags": ["<string>"],
"scheduled_trigger": "<string>",
"scheduled_concurrency": { "group": "<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>',
slug: '<string>',
is_disabled: true,
playwright_projects_match: ['<string>'],
playwright_projects_ignore: ['<string>'],
tags: ['<string>'],
exclude_tags: ['<string>'],
scheduled_trigger: '<string>',
scheduled_concurrency: {group: '<string>'}
})
};
fetch('https://api.empirical.run/api/environments/{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://api.empirical.run/api/environments/{id}",
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>',
'slug' => '<string>',
'is_disabled' => true,
'playwright_projects_match' => [
'<string>'
],
'playwright_projects_ignore' => [
'<string>'
],
'tags' => [
'<string>'
],
'exclude_tags' => [
'<string>'
],
'scheduled_trigger' => '<string>',
'scheduled_concurrency' => [
'group' => '<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.empirical.run/api/environments/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"is_disabled\": true,\n \"playwright_projects_match\": [\n \"<string>\"\n ],\n \"playwright_projects_ignore\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"scheduled_trigger\": \"<string>\",\n \"scheduled_concurrency\": {\n \"group\": \"<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.empirical.run/api/environments/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"is_disabled\": true,\n \"playwright_projects_match\": [\n \"<string>\"\n ],\n \"playwright_projects_ignore\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"scheduled_trigger\": \"<string>\",\n \"scheduled_concurrency\": {\n \"group\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/environments/{id}")
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 \"slug\": \"<string>\",\n \"is_disabled\": true,\n \"playwright_projects_match\": [\n \"<string>\"\n ],\n \"playwright_projects_ignore\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"exclude_tags\": [\n \"<string>\"\n ],\n \"scheduled_trigger\": \"<string>\",\n \"scheduled_concurrency\": {\n \"group\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"project_id": 123,
"slug": "<string>",
"name": "<string>",
"playwright_projects_match": [
"<string>"
],
"playwright_projects_ignore": [
"<string>"
],
"tags": [
"<string>"
],
"exclude_tags": [
"<string>"
],
"is_disabled": true,
"env_files": [
"<string>"
],
"scheduled_trigger": "<string>",
"scheduled_concurrency": {
"group": "<string>",
"on_conflict": "cancel"
},
"reporter_config": {
"schema_version": 1,
"reporters": [
{
"reporter_type": "slack_run_status",
"slack_channel_ids": [
2
]
}
]
},
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}