def list_all(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
order: str | None = None,
timeout: float | None = None,
) -> list[ProductResource]async def list_all(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
order: str | None = None,
timeout: float | None = None,
) -> list[ProductResource]Walks every page and returns a single flat list. Each request asks for the maximum page size of 100 and the walk stops as soon as the API reports no more rows.
The pagination envelope is discarded, so call list once when you need totalCount. A limit you pass here is the per-request page size, not a cap on how many products come back, and an offset is the starting point of the whole walk. There is no bound on the number of requests or on the size of the list, so on a large workspace prefer iterate.
Example
from envless import envless
products = envless.products.list_all()
print(sum(1 for product in products if product['isPrivate']))import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
products = await envless.products.list_all()
print(sum(1 for product in products if product['isPrivate']))
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
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 product 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[ProductResource] with every product the key can see.
Reads the products 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
- A failure on any page fails the whole call, so a partial result is never returned.
Required scopes
products:read
Underlying endpoint
GET /products
Request and response schema, every error code, and a live playground.
In TypeScript
envless.products.listAll()
The same method in @goenvless/sdk, with the same request, retries and errors.