---
title: "Get a list of environments a Runbook can be run within, based on its EnvironmentScope."
method: GET
path: "/spaces/{spaceIdentifier}/projects/{projectId}/runbooks/{id}/environments/v2"
tags: ["Runbooks"]
---

# Get a list of environments a Runbook can be run within, based on its EnvironmentScope.

`GET /spaces/{spaceIdentifier}/projects/{projectId}/runbooks/{id}/environments/v2`

## Request

- Base URL: `https://demo.octopus.app/api`
- URL: `https://demo.octopus.app/api/spaces/{spaceIdentifier}/projects/{projectId}/runbooks/{id}/environments/v2`
- Auth: one of:
  - API key in header `X-Octopus-ApiKey`
  - API key in query parameter `ApiKey`
  - API key in header `X-NuGet-ApiKey`

## Path parameters

- `spaceIdentifier` string, required
- `projectId` string, required
- `id` string, required

## Response `200`

The requested list of Runbook Environments

- GetRunbookEnvironmentsInDatabaseResponseV2
  - `Environments` BaseEnvironmentV2Resource[], required
    - `Description` string: Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
    - `EnvironmentTags` string[]: List of tags assigned to this environment
    - `Id` string, required
    - `Name` string, required: Gets or sets the name of this environment. This should be short, preferably 5-20 characters.
    - `Slug` string, required
    - `SpaceId` string, required
    - `Type` string

## Other responses

- `400`: Bad request. Either the payload was not structurally valid or business rules did not permit the operation.
- `404`: Not found. One or more of the entities involved in the operation was not found.

---

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