Skip to content
You're viewing the v2 docs. Looking for v1?Go to v1 docs
Docs
Testsigma
Popular questions
↑↓ to navigate↵ to selectesc to close
Book a demo

Update an environment

PUT/environments/{env_id}
Base URL https://app.testsigma.com/api/v1Region

Update 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 →
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()
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?