def list(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
order: str | None = None,
timeout: float | None = None,
) -> Page[ProductResource]async def list(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
order: str | None = None,
timeout: float | None = None,
) -> Page[ProductResource]Fetches one page of the products the key can reach, unwrapped into items plus a pagination envelope. Private products with no grant for the key owner are filtered out before pagination is applied, so pagination['totalCount'] is the number of products this key can see and never the raw workspace total.
Every row carries locked, which is True for products sitting beyond the plan allowance. Locked products still list and still read, but an update against one is refused. search matches name and slug, order defaults to name and sorts A to Z, with asc and desc sorting oldest and newest first on createdAt.
Example
from envless import envless
page = envless.products.list(limit=10, search='api')
for product in page['items']:
print(product['slug'], product.get('locked', False))import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
page = await envless.products.list(limit=10, search='api')
for product in page['items']:
print(product['slug'], product.get('locked', False))
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | int | No | Rows per page, a whole number from 1 to 100. |
offset | int | No | Rows to skip, a whole number of 0 or greater. |
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
Page[ProductResource] holding items and the pagination envelope.
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
limitoutside 1 to 100 is rejected as invalid pagination rather than clamped. - Pagination happens in memory after the access filter, so page boundaries shift if grants change between calls.
Required scopes
products:read
Underlying endpoint
GET /products
Request and response schema, every error code, and a live playground.
In TypeScript
envless.products.list()
The same method in @goenvless/sdk, with the same request, retries and errors.