v66

OpenAPI 3.1.0raw.githubusercontent.com2026-08-0174265626.3 KB
environments

List environments

Retrieve the environments within an app.

Use this to enumerate every environment in an app. Identify the app by its project slug and app slug. Results are ordered by environment id. An app has only a handful of environments, so all of them are returned in a single response.

Required Permissions

Your root key must have the following permission:

  • environment.*.read_environment (to read environments in any app)
post/v2/environments.listEnvironments

Request body

projectstring required

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

appstring required

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

Example request

{
  "project": "proj_1234abcd",
  "app": "proj_1234abcd"
}

Response

Successfully retrieved the app's environments.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": [
    {
      "id": "env_1234abcd",
      "slug": "production",
      "description": "Production environment",
      "createdAt": 1704067200000,
      "updatedAt": 1704153600000,
      "runtime": {
        "port": 8080,
        "vCpus": 0.25,
        "memoryMib": 256,
        "command": [
          "node",
          "server.js"
        ],
        "healthcheck": {
          "method": "GET",
          "path": "/healthz",
          "intervalSeconds": 10,
          "timeoutSeconds": 2,
          "failureThreshold": 3,
          "initialDelaySeconds": 5
        },
        "shutdownSignal": "SIGTERM",
        "upstreamProtocol": "http1",
        "openapiSpecPath": "/openapi.yaml"
      },
      "build": {
        "dockerfile": "Dockerfile",
        "rootDirectory": ".",
        "buildCommand": "pnpm --filter api build",
        "watchPaths": [
          "src/**"
        ],
        "autoDeploy": true
      },
      "regions": [
        {
          "name": "us-east-1",
          "replicas": {
            "min": 1,
            "max": 3
          }
        }
      ]
    }
  ]
}