Batch Delete Environments
curl --request DELETE \
--url https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"environment_ids": [
"d4e5f6a7-b8c9-0123-def1-234567890123",
"e5f6a7b8-c9d0-1234-ef12-345678901234"
]
}
'import requests
url = "https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments"
payload = { "environment_ids": ["d4e5f6a7-b8c9-0123-def1-234567890123", "e5f6a7b8-c9d0-1234-ef12-345678901234"] }
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment_ids: ['d4e5f6a7-b8c9-0123-def1-234567890123', 'e5f6a7b8-c9d0-1234-ef12-345678901234']
})
};
fetch('https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments', 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.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'environment_ids' => [
'd4e5f6a7-b8c9-0123-def1-234567890123',
'e5f6a7b8-c9d0-1234-ef12-345678901234'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Key: <api-key>"
],
]);
$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.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments"
payload := strings.NewReader("{\n \"environment_ids\": [\n \"d4e5f6a7-b8c9-0123-def1-234567890123\",\n \"e5f6a7b8-c9d0-1234-ef12-345678901234\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-Access-Key", "<api-key>")
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.delete("https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments")
.header("X-Access-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"environment_ids\": [\n \"d4e5f6a7-b8c9-0123-def1-234567890123\",\n \"e5f6a7b8-c9d0-1234-ef12-345678901234\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Access-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"environment_ids\": [\n \"d4e5f6a7-b8c9-0123-def1-234567890123\",\n \"e5f6a7b8-c9d0-1234-ef12-345678901234\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Virtual Environments
Batch Delete Environments
Permanently delete multiple environments by ID
DELETE
/
public
/
v1
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
environments
Batch Delete Environments
curl --request DELETE \
--url https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"environment_ids": [
"d4e5f6a7-b8c9-0123-def1-234567890123",
"e5f6a7b8-c9d0-1234-ef12-345678901234"
]
}
'import requests
url = "https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments"
payload = { "environment_ids": ["d4e5f6a7-b8c9-0123-def1-234567890123", "e5f6a7b8-c9d0-1234-ef12-345678901234"] }
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment_ids: ['d4e5f6a7-b8c9-0123-def1-234567890123', 'e5f6a7b8-c9d0-1234-ef12-345678901234']
})
};
fetch('https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments', 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.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'environment_ids' => [
'd4e5f6a7-b8c9-0123-def1-234567890123',
'e5f6a7b8-c9d0-1234-ef12-345678901234'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Key: <api-key>"
],
]);
$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.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments"
payload := strings.NewReader("{\n \"environment_ids\": [\n \"d4e5f6a7-b8c9-0123-def1-234567890123\",\n \"e5f6a7b8-c9d0-1234-ef12-345678901234\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-Access-Key", "<api-key>")
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.delete("https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments")
.header("X-Access-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"environment_ids\": [\n \"d4e5f6a7-b8c9-0123-def1-234567890123\",\n \"e5f6a7b8-c9d0-1234-ef12-345678901234\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Access-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"environment_ids\": [\n \"d4e5f6a7-b8c9-0123-def1-234567890123\",\n \"e5f6a7b8-c9d0-1234-ef12-345678901234\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Authorizations
ApiKeyAuthBearerAuth
An API key is a token that a client provides when making API calls. Send it as the X-Access-Key request header on any endpoint:
curl '<API_ENDPOINT>' \ -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \ ...
Learn how to generate API access tokens at Tenderly Docs.
Path Parameters
Account ID or slug
Project ID or slug
Body
application/json
List of environment IDs to delete
Request body for batch-deleting environments
List of environment IDs to delete
Example:
[ "d4e5f6a7-b8c9-0123-def1-234567890123", "e5f6a7b8-c9d0-1234-ef12-345678901234" ]
Response
Environments deleted successfully
Was this page helpful?
⌘I