project
Update an environment
Updates the name of an existing environment within a project.
PUT
/
v1
/
workspace
/
{ws}
/
project
/
{prj}
/
environment
/
{environmentId}
cURL
curl -X PUT 'http://localhost:8080/v1/workspace/ws_example/project/prj_example/environment/env_example' \
-H 'Authorization: Bearer ek_live_xxxxx' \
-H 'Content-Type: application/json' \
-d '{ // request body fields, see schema }'const response = await fetch('http://localhost:8080/v1/workspace/ws_example/project/prj_example/environment/env_example', {
method: 'PUT',
headers: {
Authorization: 'Bearer ek_live_xxxxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
// request body fields, see schema
}),
});
const data = await response.json();import requests
response = requests.put(
'http://localhost:8080/v1/workspace/ws_example/project/prj_example/environment/env_example',
headers={
'Authorization': 'Bearer ek_live_xxxxx',
'Content-Type': 'application/json',
},
json={
# request body fields, see schema
},
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}",
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([
'name' => '<string>',
'hasPersonalOverrides' => 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 := "http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"hasPersonalOverrides\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"hasPersonalOverrides\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"hasPersonalOverrides\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Authorizations
API key authentication. Pass Authorization: Bearer ek_live_xxxxx on every request.
Path Parameters
Required string length:
2 - 48Pattern:
^[a-z0-9-]+$Required string length:
2 - 48Pattern:
^[a-z0-9-]+$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
200 - application/json
Default Response
Previous
Delete an environmentPermanently deletes an environment, all of its secrets and any associated syncs. This action cannot be undone.
Next
⌘I
cURL
curl -X PUT 'http://localhost:8080/v1/workspace/ws_example/project/prj_example/environment/env_example' \
-H 'Authorization: Bearer ek_live_xxxxx' \
-H 'Content-Type: application/json' \
-d '{ // request body fields, see schema }'const response = await fetch('http://localhost:8080/v1/workspace/ws_example/project/prj_example/environment/env_example', {
method: 'PUT',
headers: {
Authorization: 'Bearer ek_live_xxxxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
// request body fields, see schema
}),
});
const data = await response.json();import requests
response = requests.put(
'http://localhost:8080/v1/workspace/ws_example/project/prj_example/environment/env_example',
headers={
'Authorization': 'Bearer ek_live_xxxxx',
'Content-Type': 'application/json',
},
json={
# request body fields, see schema
},
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}",
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([
'name' => '<string>',
'hasPersonalOverrides' => 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 := "http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"hasPersonalOverrides\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"hasPersonalOverrides\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/workspace/{ws}/project/{prj}/environment/{environmentId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"hasPersonalOverrides\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true
}