def list(limit: nil, offset: nil, search: nil, role_id: nil, timeout: nil)def list: (
?limit: Integer?,
?offset: Integer?,
?search: (String | Symbol)?,
?role_id: (String | Symbol)?,
?timeout: seconds?
) -> Page[member_resource]Returns one page of everyone who has accepted membership of the workspace, as items plus the raw pagination envelope. Each row carries the member id that update, remove and the product access routes expect, the assigned role, and the underlying user.
search matches a member name, email or role name, and roleId keeps only the members holding that role. Pending invites are not members and never show up in these rows: read them from the invites namespace.
Example
require "envless/sdk"
page = Envless.members.list(limit: 50)
page.items.each do |member|
puts "#{member[:id]} #{member.dig(:role, :name)}"
puts member.dig(:user, :email)
endParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit: | Integer | No | Rows per page, a whole number from 1 to 100. |
offset: | Integer | No | Rows to skip before the page starts. |
search: | String | Symbol | No | Case insensitive substring match on the member name, email or role name. |
role_id: | String | Symbol | No | Only members holding this role, by the role id from roles.list. |
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
Page[member_resource] with items and the pagination envelope.
Reads the members 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
- The API reads the whole member set and paginates it in memory, so
pagination[:totalCount]is exact. usercan benilwhen the user record cannot be resolved.roleis always populated for a real member.- A
limitabove 100 or a fractionaloffsetfails with 400request.invalid_paginationanderror.fieldnames the culprit.
Required scopes
members:read
Underlying endpoint
GET /members
Request and response schema, every error code, and a live playground.
In TypeScript
envless.members.list()
The same method in @goenvless/sdk, with the same request, retries and errors.