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

# Retrieve a custom environment

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

## Request

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

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

## Path parameters

- `idOrName` string, required: The unique project identifier or the project name
- `environmentSlugOrId` string, required: The unique custom environment identifier within the project

## Query parameters

- `teamId` string
- `slug` string

## Response `200`

- object: Internal representation of a custom environment with all required properties
  - `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-07-21** `2ae10ee9d21c`: 1 info
  - added the non-success response with the status `410`
- **2026-06-11** `14b4658f819e`: 1 warning
  - added the new `undefined` enum value to the `domains/items/redirectStatusCode` response property for the response status `200`
- **2026-01-22** `c12186034433`: 2 warning
  - added the new `false` enum value to the `domains/items/verified` response property for the response status `200`
  - added the new `true` enum value to the `domains/items/verified` response property for the response status `200`
- **2025-05-17** `67f6a93c3cd8`: 9 info
  - added the optional property `branchMatcher` to the response with the `200` status
  - added the optional property `currentDeploymentAliases` to the response with the `200` status
  - added the optional property `description` to the response with the `200` status
  - added the optional property `domains` to the response with the `200` status
  - …5 more
- **2025-03-19** `37b482c58c92`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v9/projects/:idOrName/custom-environments/:environmentSlugOrId/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)
