list(project: string, options?: ScopedSortedListOptions): Promise<Page<EnvironmentSummaryResource>>Resolves one page of the environments in a project, sorted by name A to Z, as items plus a pagination envelope. The project argument resolves as a uniqueId first and then as a slug. Project slugs are only unique inside a product, so set options.product whenever the same project slug exists in two products, otherwise the call fails with project.ambiguous_product before it ever looks at environments.
search matches environment name and slug, and order defaults to name, which sorts A to Z, with asc and desc sorting oldest and newest first on createdAt. Each row carries id, name, slug, projectId, exposed, createdAt and updatedAt, the same fields get returns.
Example
const page = await envless.environments.list('api', { product: 'billing', limit: 50 })
console.log(page.pagination.totalCount)
console.log(page.items.map((environment) => environment.slug))Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project slug or uniqueId that owns the environments. |
options.product | string | No | Product slug that disambiguates an ambiguous project slug. |
options.limit | number | No | Rows per page, a whole number between 1 and 100. |
options.offset | number | No | Rows to skip before the page starts. |
options.search | string | No | Case insensitive substring match on the environment name or slug. |
options.order | string | No | asc or desc sorts by creation time, oldest or newest first. Anything else, or nothing, sorts by name. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
Page<EnvironmentSummaryResource> holding the rows in items and the counts in pagination.
Reads the environments collection. list returns one page as { items, pagination }, listAll collects every page into an array, and iterate streams one item at a time without buffering the whole set.
Worth knowing
- A
limitoutside 1 to 100 is rejected withrequest.invalid_paginationrather than clamped. - A 404 here means no project matched in scope for this key, not that the project has no environments.
Required scopes
environments:read
Underlying endpoint
GET /projects/{slug}/environments
Request and response schema, every error code, and a live playground.
In Python
envless.environments.list()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.environments.list
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->environments->list()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.