Versions

envless.versions.listAll()

Collect every version of an environment

ts
listAll(project: string, environment: string, options?: ScopedListOptions): Promise<Array<VersionResource>>

Walks every page and resolves the flattened array of versions, newest first. An environment is capped at 1000 versions on every plan, so the result stays bounded even on a long lived project.

options.limit is the page size used while walking, not a cap on how many versions come back: a limit of 5 still returns the whole history, just in more round trips. It is clamped to the API maximum of 100, so asking for more buys nothing.

Example

ts
const versions = await envless.versions.listAll('api', 'production', { product: 'billing' })

console.log(versions.length, versions[0]?.label)

Parameters

ParameterTypeRequiredDescription
projectstringYesProject slug or project uniqueId.
environmentstringYesEnvironment slug, since an environment uniqueId will not resolve here.
options.productstringNoProduct slug used to disambiguate a project slug shared across products.
options.limitnumberNoPage size used while walking, clamped to 100.
options.offsetnumberNoRow to start the walk from.
options.signalAbortSignalNoCancels every request in the walk.

Returns

Array<VersionResource> holding every snapshot taken for the environment.

Reads the versions 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

  • Nothing resolves until the final page lands. Use iterate when you want to act on versions as they arrive.
  • Rows carry variableCount only, so reading the values behind every version costs one envless.versions.get per row.
  • On the Free plan only the latest version is listed; the older ones are stored but need Dev or above to be read, and reading one there is 402 plan.upgrade_required.

Required scopes

versions:read

Underlying endpoint

GET /projects/{slug}/environments/{environmentSlug}/versions

Request and response schema, every error code, and a live playground.

In Python

envless.versions.list_all()

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

In Ruby

Envless.versions.list_all

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

In PHP

$envless->versions->listAll()

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