Environments

1 minute read

When you need to discover or automate the management of your organization’s environments, use the Environments API to retrieve all environments under a given org. It returns a list of environments with metadata such as ID, name, resource ID, and disabled status. This lets you keep an up-to-date inventory for feature-flag targeting, deployment scripts, and monitoring workflows — so you always know exactly which environments you’re working with.

Retrieve a list of environments

Use this endpoint to retrieve all environments defined in a specified organization.

Endpoint
GET /v2/organizations/{org_id}/environments
Parameter name In Type Required? Description

org_id

Path

String

Yes

The ID of the organization.

Responses

The following table outlines the possible responses for this endpoint, including status codes, their meanings, and the schemas that describe the returned data or errors.

Status Code Description Schema

200

Success. Returns a list of environments for the specified organization.

api.environment.ListEnvironmentsResponse

Default

Error. Occurs when the org_id is missing, invalid, or the user lacks sufficient permissions.

google.rpc.Status

Response example
{ "environments": [ { "id": "2d2cd3c1-6aae-4155-8dee-eab50a9e8483", "name": "dev", "resourceId": "6c572bfa-c926-436a-73df-1fece473c372", "isDisabled": false }, { "id": "6057e4a2-b57c-43d2-afa9-b47c665146bd", "name": "staging", "resourceId": "6c572bfa-c926-436a-73df-1fece473c372", "isDisabled": false }, { "id": "1ab871b9-e060-4332-9616-c8b205b00e25", "name": "test", "resourceId": "6c572bfa-c926-436a-73df-1fece473c372", "isDisabled": false } ] }
The isDisabled field indicates whether the environment is inactive (true) or active (false).