get(id: string, options?: RequestScope): Promise<VersionDetailResource>Reads one snapshot with the variables captured in it, addressed by version id and scoped to the workspace behind the key. There is no environment scoped read for a single version, ids are the only way in, and a label such as v3 is refused: this wants the uuid v7 id from a list row.
The resolved value is a flattened version row plus a variables array of { name, value } pairs sorted by name, where value is the ciphertext exactly as it stood when the version was taken. Decrypt it with the workspace key that was in force at snapshot time, which is not necessarily the current one.
The snapshot also stores defaultValue, type, visibility and required per entry, and a rollback restores all of them, but this response deliberately exposes only name and value. Use envless.versions.listEntries when you need the stored defaultValue ciphertext.
Example
const version = await envless.versions.get('0191f0c4-6d2a-7c31-9a4b-8f2e1d5c7a90')
for (const variable of version.variables) console.log(variable.name, variable.value)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Version uniqueId, a uuid v7 taken from a list row. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
VersionDetailResource, the version row plus a variables array of { name, value } pairs where value is ciphertext.
Worth knowing
- Requires both
versions:readandvariables:read. A key holding only one fails withauth.scope_missing. - The version lookup runs before the key project restriction, so a 403 here confirms the version exists while a 404 means it does not.
- A
valueof null means the entry was captured with no value, not that the read was denied. - On the Free plan only the latest version of an environment is readable. Any older id fails with status 402 and code
plan.upgrade_required(error.resourceversion); older versions and rollback need Dev or above.
Required scopes
versions:read and variables:read
Underlying endpoint
GET /versions/{id}
Request and response schema, every error code, and a live playground.
In Python
envless.versions.get()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.versions.get
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->versions->get()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.