list(options?: ListOptions): Promise<Page<WorkspaceResource>>Returns one page of every workspace the API key owner is a member of. This is the only read in the SDK that leaves the workspace the key is bound to, because it resolves memberships for the owner instead of rows inside one workspace.
Seeing a workspace in items does not mean you can act on it. A key is bound to a single workspace at creation and cannot be retargeted, so the entry with current: true is the only one every other method will touch.
The server loads all memberships before it slices the page, so pagination.totalCount is the size of the complete set rather than of the page you received.
Example
const page = await envless.workspaces.list({ limit: 50 })
const current = page.items.find((workspace) => workspace.current)
console.log(current?.slug, page.pagination.totalCount)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options.limit | number | No | Rows per page, a whole number from 1 to 100, defaulting to 25. |
options.offset | number | No | Whole number of rows to skip before the page starts. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
Page<WorkspaceResource> with items and a pagination envelope covering every membership.
Reads the workspaces 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
- A 401 with
auth.api_key_user_missingmeans the key is valid but its owner row can no longer be read.
Required scopes
workspace:read
Underlying endpoint
GET /workspaces
Request and response schema, every error code, and a live playground.
In Python
envless.workspaces.list()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.workspaces.list
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->workspaces->list()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.