---
title: "List Factory Environments visible to the caller"
method: GET
path: "/api/v0/environments"
tags: ["Environments"]
---

# List Factory Environments visible to the caller

`GET /api/v0/environments`

## Request

- Base URL: `https://api.factory.ai`
- URL: `https://api.factory.ai/api/v0/environments`
- Auth: HTTP bearer

## Query parameters

- `serviceAccountId` string

## Headers

- `X-Factory-Org-Id` string

## Response `200`

Response for status 200

- ListEnvironments200ResponseBody
  - `environments` object[], required
    - `id` string, required
    - `name` string, required
    - `scope` 'user' | 'organization', required
    - `repositories` object[], required
      - `url` string, uri, required
      - `script` string, required
      - `check` string
    - `activeRepositories` object[]
      - `url` string, uri, required
      - `script` string, required
      - `check` string
    - `setupScript` string
    - `source` object, required
      - `id` string, required
      - `name` string, required
      - `supportsRepositories` boolean, required
      - `supportsSetupScripts` boolean, required
      - `providerType` string
      - `provider` object, required
        - `id` string, required
        - `name` string, required
      - `unavailable` true
    - `activeSource` object
      - `id` string, required
      - `name` string, required
      - `supportsRepositories` boolean, required
      - `supportsSetupScripts` boolean, required
      - `providerType` string
      - `provider` object, required
        - `id` string, required
        - `name` string, required
      - `unavailable` true
    - `activeRepositoryCheckouts` object[]
      - `repoUrl` string, required
      - `path` string, required
    - `status` 'building' | 'ready' | 'failed', required
    - `isDefault` boolean
    - `computerSizes` object[]
      - `preset` string, required
      - `label` string, required
      - `cpuMillis` integer, required
      - `memoryMiB` integer, required
      - `isDefault` boolean, required
    - `latestBuild` object
      - `id` string, required
      - `status` 'queued' | 'building' | 'validating' | 'succeeded' | 'failed' | 'superseded', required
      - `trigger` 'create' | 'edit' | 'manual' | 'scheduled' | 'base-update', required
      - `repositories` object[]
        - `url` string, uri, required
        - `name` string, required
        - `defaultBranch` string, required
        - `commitSha` string, required
      - `failureReason` string
      - `failureCategory` 'source-resolution' | 'provider' | 'timeout' | 'validation' | 'promotion' | 'cleanup' | 'unknown'
      - `excerpt` string
      - `truncated` boolean, required
      - `withheld` boolean, required
      - `createdAt` integer, required: Unix timestamp, in milliseconds, when the build was created.
      - `startedAt` integer: Unix timestamp, in milliseconds, when the build started.
      - `finishedAt` integer: Unix timestamp, in milliseconds, when the build finished.
      - `promotedAt` integer: Unix timestamp, in milliseconds, when the build became the one launches use.
    - `lastSuccessfulBuildAt` integer: Unix timestamp, in milliseconds, when the last successful build finished.
    - `failureReason` string
    - `createdAt` integer, required: Unix timestamp, in milliseconds, when the environment was created.
    - `updatedAt` integer, required: Unix timestamp, in milliseconds, when the environment last changed.
  - `defaultEnvironmentId` string
  - `hiddenOrganizationEnvironmentCount` integer

## Other responses

- `400`: Response for status 400
- `401`: Response for status 401
- `402`: Response for status 402
- `403`: Response for status 403
- `404`: Response for status 404
- `451`: Response for status 451
- `500`: Response for status 500
- `503`: Response for status 503

## Changes

- **2026-11-28** `411bf7b6c871`: 1 info
  - added the optional property `environments/items/computerSizes` to the response with the `200` status
- **2026-11-26** `01fc57b2148d`: 2 info
  - added the optional property `environments/items/activeRepositories/items/check` to the response with the `200` status
  - added the optional property `environments/items/repositories/items/check` to the response with the `200` status
- **2026-11-17** `54bb6cc588c0`: 2 info
  - added the optional property `environments/items/activeSource/providerType` to the response with the `200` status
  - added the optional property `environments/items/source/providerType` to the response with the `200` status
- **2026-11-14** `9fb2e1b1ec61`: 1 info
  - added the non-success response with the status `404`
- **2026-11-12** `b6a46c415079`: 4 breaking, 1 warning, 24 info
  - the response's body type changed from `object` to no type for status `400`
  - removed the required property `detail` from the response with the `400` status
  - removed the required property `status` from the response with the `400` status
  - removed the required property `title` from the response with the `400` status
  - …25 more

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/v0/environments/get.md)

---

[API](https://skmtc.dev/factory/apis/factory-public-api.md) - [All operations](https://skmtc.dev/factory/apis/factory-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/factory/apis/factory-public-api/revisions/2e37e1b079d2?raw)
