Members

envless.members.listAll()

Collect every workspace member into one array

ts
listAll(options?: MemberListOptions): Promise<Array<MemberResource>>

Walks every page and resolves with 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.

options.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 resolves until the last page lands.

Example

ts
const members = await envless.members.listAll()

const admins = members.filter((member) => member.role?.name === 'Admin')

console.log(members.length, admins.length)

Parameters

ParameterTypeRequiredDescription
options.limitnumberNoPage size used while walking, clamped to 100.
options.offsetnumberNoRow to start the walk from.
options.searchstringNoCase insensitive substring match on the member name, email or role name.
options.roleIdstringNoOnly members holding this role, by the role id from roles.list.
options.signalAbortSignalNoCancels every request in the walk.

Returns

Array<MemberResource> holding every accepted member of the workspace.

Reads the members collection. list returns one page as { items, pagination }, listAll collects every page into an array, and iterate streams one item at a time without buffering the whole set.

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 than member.user?.id, since user is nullable and only id is 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 Python

envless.members.list_all()

The same method in envless-sdk, the Python SDK, with the same request, retries and errors.

In Ruby

Envless.members.list_all

The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.

In PHP

$envless->members->listAll()

The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.