def list_all(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
role_id: str | None = None,
timeout: float | None = None,
) -> list[MemberResource]async def list_all(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
role_id: str | None = None,
timeout: float | None = None,
) -> list[MemberResource]Walks every page and returns the flattened member list. Membership counts are small compared with variables, so this is usually the right call for building a role table or a seat report.
limit= sets the page size used while walking, not a cap on how many members come back. Asking for a limit of 5 still returns everyone, just in more round trips. Nothing is returned until the last page lands.
Example
from envless import envless
members = envless.members.list_all()
roles = [member['role'] for member in members]
admins = [
role for role in roles if role and role['name'] == 'Admin'
]
print(len(members), len(admins))import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
members = await envless.members.list_all()
roles = [member['role'] for member in members]
admins = [
role for role in roles if role and role['name'] == 'Admin'
]
print(len(members), len(admins))
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | int | No | Page size used while walking, clamped to 100. |
offset | int | No | Row to start the walk from. |
search | str | No | Case insensitive substring match on the member name, email or role name. |
role_id | str | No | Only members holding this role, by the role id from roles.list. |
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
list[MemberResource] holding every accepted member of the workspace.
Reads the members 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
- Page size defaults to the API maximum of 100 and is clamped there, so a larger limit buys nothing.
- Key off
member['id']rather thanmember['user']['id'], sinceusercan beNoneand onlyidis accepted by the write routes.
Required scopes
members:read
Underlying endpoint
GET /members
Request and response schema, every error code, and a live playground.
In TypeScript
envless.members.listAll()
The same method in @goenvless/sdk, with the same request, retries and errors.