Workspaces

envless.workspaces.list()

List the workspaces the key owner belongs to

ts
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

ts
const page = await envless.workspaces.list({ limit: 50 })

const current = page.items.find((workspace) => workspace.current)

console.log(current?.slug, page.pagination.totalCount)

Parameters

ParameterTypeRequiredDescription
options.limitnumberNoRows per page, a whole number from 1 to 100, defaulting to 25.
options.offsetnumberNoWhole number of rows to skip before the page starts.
options.signalAbortSignalNoCancels 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_missing means 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.