Skip to content
Testsigma DOCS

Get an environment

GET/environments/:env_id

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

Retrieve a specific environment and its variables by ID.

Authenticate with your API key as a Bearer token in the Authorization header. Generate a key →
env_idThe ID of the environment to retrieve. Found in the URL of the environment's detail page.
idUnique environment identifier.
nameEnvironment name.
descriptionDescription of the environment.
variablesArray of key-value variables. Each has id, key, value, isEncrypted, projectId.
createdByIdID of the user who created the environment.
updatedByIdID of the user who last updated it.
createdDateEpoch timestamp of creation.
updatedDateEpoch timestamp of the last update.
REQUEST
curl -X GET \
  'https://app.testsigma.com/api/v1/environments/:env_id' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json'
const response = await fetch('https://app.testsigma.com/api/v1/environments/:env_id', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  }
});
const data = await response.json();
import requests

response = requests.get(
  'https://app.testsigma.com/api/v1/environments/:env_id',
  headers={
    'Authorization': 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  }
)
data = response.json()
RESPONSE200OK
{
  "id": 10,
  "name": "Staging",
  "description": "Staging environment",
  "createdById": 9,
  "updatedById": 9,
  "createdDate": 1732176819137,
  "updatedDate": 1732176819137,
  "variables": [
    {
      "id": 8,
      "key": "Url",
      "value": "https://staging.testsigma.com",
      "isEncrypted": false,
      "projectId": 9
    }
  ]
}