Skip to main content
GET
/
api
/
environments
/
list
List Environments
curl --request GET \
  --url https://api.example.com/api/environments/list \
  --header 'Authorization: <authorization>'
{
  "data": {
    "environments": [
      {
        "id": 1,
        "project_id": 42,
        "slug": "production",
        "name": "Production",
        "playwright_projects": ["chromium", "firefox"],
        "platform": "web",
        "is_default": true,
        "is_disabled": false,
        "created_at": "2025-01-15T10:30:00Z",
        "updated_at": "2025-02-01T14:20:00Z",
        "latest_build": {
          "id": 123,
          "project_id": 42,
          "build_url": "https://example.com/builds/123",
          "commit": "abc123def456",
          "commit_url": "https://github.com/org/repo/commit/abc123def456",
          "version": "1.2.3",
          "branch": "main",
          "environment_id": 1,
          "created_at": "2025-02-05T09:00:00Z"
        }
      },
      {
        "id": 2,
        "project_id": 42,
        "slug": "staging",
        "name": "Staging",
        "playwright_projects": ["chromium"],
        "platform": "web",
        "is_default": false,
        "is_disabled": false,
        "created_at": "2025-01-15T10:35:00Z",
        "updated_at": "2025-01-20T11:00:00Z",
        "latest_build": null
      }
    ]
  }
}
Returns all environments configured for a project, including their latest build information.

Examples

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer <your-api-key>
project_id
number
The project ID. Required if project_repo_name is not provided.
project_repo_name
string
The project repository name. Required if project_id is not provided.
is_disabled
string
Set to false to return only enabled environments.

Response

data
object
{
  "data": {
    "environments": [
      {
        "id": 1,
        "project_id": 42,
        "slug": "production",
        "name": "Production",
        "playwright_projects": ["chromium", "firefox"],
        "platform": "web",
        "is_default": true,
        "is_disabled": false,
        "created_at": "2025-01-15T10:30:00Z",
        "updated_at": "2025-02-01T14:20:00Z",
        "latest_build": {
          "id": 123,
          "project_id": 42,
          "build_url": "https://example.com/builds/123",
          "commit": "abc123def456",
          "commit_url": "https://github.com/org/repo/commit/abc123def456",
          "version": "1.2.3",
          "branch": "main",
          "environment_id": 1,
          "created_at": "2025-02-05T09:00:00Z"
        }
      },
      {
        "id": 2,
        "project_id": 42,
        "slug": "staging",
        "name": "Staging",
        "playwright_projects": ["chromium"],
        "platform": "web",
        "is_default": false,
        "is_disabled": false,
        "created_at": "2025-01-15T10:35:00Z",
        "updated_at": "2025-01-20T11:00:00Z",
        "latest_build": null
      }
    ]
  }
}

List all environments

curl -X GET \
  "https://dash.empirical.run/api/environments/list?project_id=42" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"

List enabled environments only

curl -X GET \
  "https://dash.empirical.run/api/environments/list?project_id=42&is_disabled=false" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"