---
title: "Get a Factory Environment"
method: GET
path: "/api/v0/environments/{environmentId}"
tags: ["Environments"]
---

# Get a Factory Environment

`GET /api/v0/environments/{environmentId}`

## Request

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

## Path parameters

- `environmentId` string, required: Factory Environment ID. Must not contain "/" and must not be "." or "..".

## Headers

- `X-Factory-Org-Id` string

## Response `200`

Response for status 200

- GetEnvironment200ResponseBody
  - `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.

## 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 `computerSizes` to the response with the `200` status
- **2026-11-26** `01fc57b2148d`: 2 info
  - added the optional property `activeRepositories/items/check` to the response with the `200` status
  - added the optional property `repositories/items/check` to the response with the `200` status
- **2026-11-17** `54bb6cc588c0`: 2 info
  - added the optional property `activeSource/providerType` to the response with the `200` status
  - added the optional property `source/providerType` to the response with the `200` status
- **2026-11-12** `b6a46c415079`: 4 breaking, 1 warning, 28 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
  - …29 more
- **2026-11-03** `f8be8d86d514`: 1 info
  - added the optional property `activeRepositoryCheckouts` to the response with the `200` status

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/v0/environments/:environmentId/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)
