def list_all_projects(
slug: str,
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
order: str | None = None,
timeout: float | None = None,
) -> list[ProjectResource]async def list_all_projects(
slug: str,
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
order: str | None = None,
timeout: float | None = None,
) -> list[ProjectResource]Walks every page of the projects in a product and returns one flat list. Requests use the maximum page size of 100 until the API reports no more rows.
The pagination envelope is dropped, so call list_projects once when you need totalCount. An unknown product, or a private one with no grant, raises here rather than returning an empty list, which makes this a cheap existence check as well.
Example
from envless import envless
projects = envless.products.list_all_projects('billing')
print([project['slug'] for project in projects])import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
projects = await envless.products.list_all_projects('billing')
print([project['slug'] for project in projects])
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | str | Yes | Product slug, or the product uniqueId when the value is UUID shaped. |
limit | int | No | Page size for each underlying request, capped at 100. |
offset | int | No | Row to start the walk from. |
search | str | No | Case-insensitive substring match against project name and slug. |
order | str | No | Defaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt. |
timeout | float | No | Seconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
An list[ProjectResource] with every project in the product the key can see.
Reads the projects collection. list returns one page as a dict with items and pagination, list_all collects every page into a list, and iterate yields one item at a time, fetching the next page only when the loop reaches it. On AsyncEnvless, iterate is an async iterator for async for.
Worth knowing
- Each returned project still carries its own
productsummary, so the list is safe to concatenate across products.
Required scopes
products:read and projects:read
Underlying endpoint
GET /products/{slug}/projects
Request and response schema, every error code, and a live playground.
In TypeScript
envless.products.listAllProjects()
The same method in @goenvless/sdk, with the same request, retries and errors.