Update an environment
PUT
/environments/{env_id}Base URL
https://app.testsigma.com/api/v1RegionUpdate an existing environment's name, description, or variable values.
Authenticate with your API key as a
Bearer token in the Authorization header. How to authenticate →Path parameters
env_id | The ID of the environment to update. |
Request body
name | Updated environment name. |
description | Updated description. |
id | Environment ID (must match the path parameter). |
projectId | Project ID the environment belongs to. |
variables | Full array of variables. Include id for existing variables to update them. |
Response attributes
id | Environment identifier. |
name | Updated environment name. |
variables | Updated variables array. |
updatedDate | Epoch timestamp of the update. |
Request
curl -X PUT \
'https://app.testsigma.com/api/v1/environments/{env_id}' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"id": 10,
"name": "Staging",
"description": "Updated staging environment",
"projectId": 9,
"variables": [
{
"id": "8",
"key": "Url",
"value": "https://new-staging.testsigma.com",
"isEncrypted": false,
"projectId": 9
}
]
}'const response = await fetch('https://app.testsigma.com/api/v1/environments/{env_id}', {
method: 'PUT',
headers: {
'Authorization': 'Bearer <API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": 10,
"name": "Staging",
"description": "Updated staging environment",
"projectId": 9,
"variables": [
{
"id": "8",
"key": "Url",
"value": "https://new-staging.testsigma.com",
"isEncrypted": false,
"projectId": 9
}
]
})
});
const data = await response.json();import requests
response = requests.put(
'https://app.testsigma.com/api/v1/environments/{env_id}',
headers={
'Authorization': 'Bearer <API_KEY>',
'Content-Type': 'application/json'
},
json={
"id": 10,
"name": "Staging",
"description": "Updated staging environment",
"projectId": 9,
"variables": [
{
"id": "8",
"key": "Url",
"value": "https://new-staging.testsigma.com",
"isEncrypted": false,
"projectId": 9
}
]
}
)
data = response.json()Response200 OK
{
"id": 10,
"name": "Staging",
"description": "Updated staging environment",
"projectId": 9,
"updatedById": 9,
"updatedDate": 1732400000000,
"variables": [
{
"id": 8,
"key": "Url",
"value": "https://new-staging.testsigma.com",
"isEncrypted": false,
"projectId": 9
}
]
}Was this page helpful?
Thanks for the feedback.