/** @return list<MemberResource> */
public function listAll(
?int $limit = null,
?int $offset = null,
?string $search = null,
?string $roleId = null,
int|float|null $timeout = null,
): arrayWalks every page and returns 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.
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 is returned until the last page lands.
Example
use Envless\Envless;
$envless = new Envless();
$members = $envless->members->listAll();
$admins = 0;
foreach ($members as $member) {
$admins += ($member['role']['name'] ?? '') === 'Admin' ? 1 : 0;
}
echo count($members), ' members, ', $admins, ' admins', PHP_EOL;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
$limit | int | No | Page size used while walking, clamped to 100. |
$offset | int | No | Row to start the walk from. |
$search | string | No | Case insensitive substring match on the member name, email or role name. |
$roleId | string | No | Only members holding this role, by the role id from $envless->roles->list(). |
$timeout | int|float | No | Seconds each attempt of this call may take, the response body included, before it throws Envless\Exception\NetworkException with isTimeout() true. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
list<MemberResource> holding every accepted member of the workspace.
Reads the members collection. list returns one page as an Envless\Result\Page with items and pagination, listAll collects every page into an array, and iterate returns a Generator that yields one item at a time, fetching the next page only when the loop gets there.
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 thanmember['user']['id'], sinceuseris nullable and onlyidis 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 TypeScript
envless.members.listAll()
The same method in @goenvless/sdk, with the same request, retries and errors.