list(project: string, environment: string, options?: ScopedListOptions): Promise<Page<VersionResource>>Returns one page of the snapshots taken for an environment, newest first, as items plus the raw pagination envelope. Rows are metadata only: label, note, variableCount, environmentId and createdAt, with no variables and no ciphertext. Pass a row id to envless.versions.get for the contents.
Nothing is fetched past the page you asked for, so read pagination.hasMore before assuming you hold the whole history. label is assigned server side as v1, v2 and so on from a count of existing versions, which means it is not unique forever. Treat id as the identity and never look a version up by label.
Example
const page = await envless.versions.list('api', 'production', { limit: 50 })
for (const version of page.items) console.log(version.label, version.variableCount)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project slug or project uniqueId. |
environment | string | Yes | Environment slug, since an environment uniqueId will not resolve here. |
options.product | string | No | Product slug used to disambiguate a project slug shared across products. |
options.limit | number | No | Rows per page, a whole number from 1 to 100. |
options.offset | number | No | Rows to skip before the page starts. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
Page<VersionResource> with items and the pagination envelope.
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
- Versions always come back newest first.
- An environment holds at most 1000 versions on every plan, so the history is bounded no matter how old the project is.
- 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()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.versions.list
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->versions->list()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.