---
title: "Retrieve custom environments"
method: GET
path: "/v9/projects/{idOrName}/custom-environments"
tags: ["environment"]
---

# Retrieve custom environments

`GET /v9/projects/{idOrName}/custom-environments`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v9/projects/{idOrName}/custom-environments`
- Auth: HTTP bearer

Retrieve custom environments for the project. Must not be named 'Production' or 'Preview'.

## Path parameters

- `idOrName` string, required: The unique project identifier or the project name

## Query parameters

- `gitBranch` string: Fetch custom environments for a specific git branch
- `teamId` string
- `slug` string

## Response `200`

- object
  - `accountLimit` object, required: The maximum number of custom environments allowed either by the team's plan type or a custom override.
    - `total` number, required
  - `environments` object[], required
    - `branchMatcher` object: Configuration for matching git branches to this environment
      - `pattern` string, required: The pattern to match against branch names
      - `type` 'endsWith' | 'equals' | 'startsWith', required: The type of matching to perform
    - `createdAt` number, required: Timestamp when the environment was created
    - `currentDeploymentAliases` string[]: List of aliases for the current deployment
    - `description` string: Optional description of the environment's purpose
    - `domains` object[]: List of domains associated with this environment
      - `apexName` string, required
      - `createdAt` number
      - `customEnvironmentId` string, nullable
      - `gitBranch` string, nullable
      - `name` string, required
      - `projectId` string, required
      - `redirect` string, nullable
      - `redirectStatusCode` 301 | 302 | 307 | 308 | null, nullable
      - `updatedAt` number
      - `verification` object[]: A list of verification challenges, one of which must be completed to verify the domain for use on the project. After the challenge is complete `POST /projects/:idOrName/domains/:domain/verify` to verify the domain. Possible challenges: - If `verification.type = TXT` the `verification.domain` will be checked for a TXT record matching `verification.value`.
        - `domain` string, required
        - `reason` string, required
        - `type` string, required
        - `value` string, required
      - `verified` false | true, required: `true` if the domain is verified for use with the project. If `false` it will not be used as an alias on this project until the challenge in `verification` is completed.
    - `id` string, required: Unique identifier for the custom environment (format: env_*)
    - `slug` string, required: URL-friendly name of the environment
    - `type` 'development' | 'preview' | 'production', required: The type of environment (production, preview, or development)
    - `updatedAt` number, required: Timestamp when the environment was last updated

## Other responses

- `400`: One of the provided values in the request query is invalid.
- `401`: The request is not authorized.
- `403`: You do not have permission to access this resource.
- `404`
- `410`

## Changes

- **2026-09-30** `099fbe1f521c`: 1 info
  - added the non-success response with the status `404`
- **2026-07-21** `2ae10ee9d21c`: 1 info
  - added the non-success response with the status `410`
- **2026-06-11** `14b4658f819e`: 1 warning, 1 info
  - added the new `undefined` enum value to the `environments/items/domains/items/redirectStatusCode` response property for the response status `200`
  - api operation id `getProjectsByIdOrNameCustomEnvironments` was added
- **2026-01-22** `c12186034433`: 2 warning
  - added the new `false` enum value to the `environments/items/domains/items/verified` response property for the response status `200`
  - added the new `true` enum value to the `environments/items/domains/items/verified` response property for the response status `200`
- **2025-05-17** `67f6a93c3cd8`: 10 info
  - added the optional property `environments/items/branchMatcher` to the response with the `200` status
  - added the optional property `environments/items/currentDeploymentAliases` to the response with the `200` status
  - added the optional property `environments/items/description` to the response with the `200` status
  - added the optional property `environments/items/domains` to the response with the `200` status
  - …6 more

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v9/projects/:idOrName/custom-environments/get.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
