Skip to content
Testsigma DOCS

Update an environment

PUT/environments/:env_id

Base URL  https://app.testsigma.com/api/v1

Update an existing environment's name, description, or variable values.

Authenticate with your API key as a Bearer token in the Authorization header. Generate a key →
env_idThe ID of the environment to update.
nameUpdated environment name.
descriptionUpdated description.
idEnvironment ID (must match the path parameter).
projectIdProject ID the environment belongs to.
variablesFull array of variables. Include id for existing variables to update them.
idEnvironment identifier.
nameUpdated environment name.
variablesUpdated variables array.
updatedDateEpoch 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()
RESPONSE200OK
{
  "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
    }
  ]
}