def list_all(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
timeout: float | None = None,
) -> list[InviteResource]async def list_all(
*,
limit: int | None = None,
offset: int | None = None,
search: str | None = None,
timeout: float | None = None,
) -> list[InviteResource]Walks the pages and returns a flat list of every outstanding invitation. Pending invite counts are normally small because acceptance and revocation both remove rows, so this usually costs a single request.
The pagination envelope is dropped, so you lose totalCount and hasMore. Reach for list when you need those numbers, or iterate when you want to stop as soon as you find the invite you were looking for.
Example
from envless import envless
invites = envless.invites.list_all()
stale = [
invite['id']
for invite in invites
if invite['status'] == 'expired'
]
for invite_id in stale:
envless.invites.revoke(invite_id)import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
invites = await envless.invites.list_all()
stale = [
invite['id']
for invite in invites
if invite['status'] == 'expired'
]
for invite_id in stale:
await envless.invites.revoke(invite_id)
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | int | No | Page size used while walking, capped at 100 and defaulting to 100. |
offset | int | No | Row to start the walk from, so earlier invites are left out of the result. |
search | str | No | Case insensitive substring match on the invited email address, applied to every page. |
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[InviteResource] holding each pending invitation in the workspace.
Reads the invites 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 and the rows already collected are lost.
- Every page is a separate read, so
statusvalues in the list were each computed at a slightly different moment.
Required scopes
members:read
Underlying endpoint
GET /invites
Request and response schema, every error code, and a live playground.
In TypeScript
envless.invites.listAll()
The same method in @goenvless/sdk, with the same request, retries and errors.