Skip to content

Environments

Manage environment variable sets that are injected into test runs.

View as Markdown

Environments are named sets of key-value variables injected into a test run. They're useful for running the same test against different configurations (e.g. staging vs production credentials).

Sensitive values — such as passwords and API tokens — are encrypted at rest and never returned by the API after creation. Only the key name and a flag indicating sensitivity are exposed.

The web app also supports attaching a saved logged-in browser session to an environment. Browser-session capture and management are app-only in this release; /v1 environment endpoints continue to expose variables only.

The environment object

JSON
{
  "id": "018edddd-abcd-7000-8000-abc123456789",
  "workspaceId": "018e1234-abcd-7000-8000-abc123456789",
  "projectId": "018e5678-abcd-7000-8000-abc123456789",
  "name": "Staging",
  "variables": [
    {
      "id": "018eeeee-abcd-7000-8000-abc123456789",
      "key": "BASE_URL",
      "isSensitive": false
    },
    {
      "id": "018effff-abcd-7000-8000-abc123456789",
      "key": "ADMIN_PASSWORD",
      "isSensitive": true
    }
  ],
  "createdAt": "2026-04-01T08:00:00.000Z",
  "updatedAt": "2026-05-20T12:00:00.000Z"
}
FieldTypeDescription
idUUIDUnique identifier
workspaceIdUUIDWorkspace this environment belongs to
projectIdUUIDProject this environment belongs to
namestringDisplay name — must be unique per project
variablesarrayList of variable metadata (values are not returned)
variables[].keystringVariable name
variables[].isSensitivebooleanWhether the value is encrypted; sensitive values are never returned
createdAtISO 8601Creation timestamp
updatedAtISO 8601Last updated timestamp

List environments

GEThttps://api.smoketest.sh/v1/projects/:projectId/environmentsscope: read

Path parameters

projectId
UUIDrequired
Project ID
Shell
curl "https://api.smoketest.sh/v1/projects/018e5678-abcd-7000-8000-abc123456789/environments" \
  -H "Authorization: Bearer $SMOKETEST_API_KEY"

Sample response

JSON
[
  {
    "id": "018edddd-abcd-7000-8000-abc123456789",
    "workspaceId": "018e1234-abcd-7000-8000-abc123456789",
    "projectId": "018e5678-abcd-7000-8000-abc123456789",
    "name": "Staging",
    "variables": [
      { "id": "018eeeee-abcd-7000-8000-abc123456789", "key": "BASE_URL", "isSensitive": false },
      { "id": "018effff-abcd-7000-8000-abc123456789", "key": "ADMIN_PASSWORD", "isSensitive": true }
    ],
    "createdAt": "2026-04-01T08:00:00.000Z",
    "updatedAt": "2026-05-20T12:00:00.000Z"
  }
]

Create an environment

POSThttps://api.smoketest.sh/v1/projects/:projectId/environmentsscope: write

Path parameters

projectId
UUIDrequired
Project ID

Body

name
stringrequired
Display name, unique within the project
variables
arrayrequired
Variable definitions
variables[].key
stringrequired
Variable name
variables[].isSensitive
booleanrequired
Mark true for passwords, tokens, secrets
variables[].value
stringoptional
Variable value; omit to create a blank placeholder
Shell
curl -X POST "https://api.smoketest.sh/v1/projects/018e5678-abcd-7000-8000-abc123456789/environments" \
  -H "Authorization: Bearer $SMOKETEST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Staging",
    "variables": [
      { "key": "BASE_URL", "isSensitive": false, "value": "https://staging.acme.com" },
      { "key": "ADMIN_PASSWORD", "isSensitive": true, "value": "s3cr3t!" }
    ]
  }'

Get an environment

GEThttps://api.smoketest.sh/v1/environments/:idscope: read

Path parameters

id
UUIDrequired
Environment ID
Shell
curl https://api.smoketest.sh/v1/environments/018edddd-abcd-7000-8000-abc123456789 \
  -H "Authorization: Bearer $SMOKETEST_API_KEY"

On this page