Invites

Envless.invites.list_all

Collect every pending invitation into one array

def list_all(limit: nil, offset: nil, search: nil, timeout: nil)

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

ruby
require "envless/sdk"

invites = Envless.invites.list_all

stale = invites.select { |invite| invite[:status] == "expired" }

stale.each { |invite| Envless.invites.revoke(invite[:id]) }

Parameters

ParameterTypeRequiredDescription
limit:IntegerNoPage size used while walking, capped at 100 and defaulting to 100.
offset:IntegerNoRow to start the walk from, so earlier invites are left out of the result.
search:String | SymbolNoCase insensitive substring match on the invited email address, applied to every page.
timeout:Integer | Float | RationalNoSeconds 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 status values 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.