def list_all(limit: nil, offset: nil, search: nil, timeout: nil)def list_all: (
?limit: Integer?,
?offset: Integer?,
?search: (String | Symbol)?,
?timeout: seconds?
) -> Array[invite_resource]Walks the pages and returns a flat array 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
require "envless/sdk"
invites = Envless.invites.list_all
stale = invites.select { |invite| invite[:status] == "expired" }
stale.each { |invite| Envless.invites.revoke(invite[:id]) }Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit: | Integer | No | Page size used while walking, capped at 100 and defaulting to 100. |
offset: | Integer | No | Row to start the walk from, so earlier invites are left out of the result. |
search: | String | Symbol | No | Case insensitive substring match on the invited email address, applied to every page. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
Array[invite_resource] holding each pending invitation in the workspace.
Reads the invites collection. list returns one page as an Envless::Page with items and pagination, list_all collects every page into an array, and iterate yields one item at a time to a block, fetching the next page only when it gets there. Without a block, iterate returns an Enumerator.
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 array 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.