GET /v1/environments
Lists environments under the current account with cursor pagination. Archived environments are excluded by default.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | No | 20 | Items per page. Must be positive; values above 100 are capped at 100 |
after_id | string | No | - | Cursor; returns records after this ID in the current descending ID order. Do not combine with before_id |
before_id | string | No | - | Cursor; returns records before this ID in the current descending ID order. Do not combine with after_id |
include_archived | boolean | No | false | Set to true to include archived environments |
created_at[gte] | string | No | - | Include environments created at or after this RFC 3339 timestamp |
created_at[lte] | string | No | - | Include environments created at or before this RFC 3339 timestamp |
Example request
Example response
HTTP 200 OKResponse fields
| Field | Type | Description |
|---|---|---|
data | array of Environment object | Environments on the current page |
first_id | string | ID of the first record on this page |
last_id | string | ID of the last record on this page |
has_more | boolean | Whether more records remain |
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | limit is not a positive integer |
| 400 | invalid_request_error | Both before_id and after_id were provided |
| 400 | invalid_request_error | created_at[gte] or created_at[lte] is not RFC 3339 |
| 401 | authentication_error | PAT invalid or expired |
| 403 | permission_error | Not authorized for this resource |
Notes
- Records are returned in descending ID order by default.
- Archived environments do not appear in the default listing. Pass
include_archived=trueto include them. - Pagination is cursor-based; offset-based pagination is not supported.
Related
Cloud environment setup
Choose the container, network, and dependencies your agent runs in.