def list_all_history(
project,
environment,
name,
limit: nil,
offset: nil,
product: nil,
timeout: nil
)def list_all_history: (
String project,
String environment,
String name,
?limit: Integer?,
?offset: Integer?,
?product: (String | Symbol)?,
?timeout: seconds?
) -> Array[variable_history_event]Walks every page of the audit trail for a variable and returns one array, newest event first.
The trail grows with every write, so a long lived variable in an active environment can cost many round trips and a large array. Reach for list_history when you only need the most recent changes.
No values appear in any event, so this is safe to log or ship to an audit sink without decrypting anything.
Example
require "envless/sdk"
events = Envless.variables.list_all_history(
"api",
"production",
"STRIPE_SECRET_KEY"
)
puts "#{events.size} #{events.first&.fetch(:type)}"Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | String | Yes | Project slug the environment belongs to. |
environment | String | Yes | Environment slug the variable lives in. |
name | String | Yes | Name of a live variable, matched without regard to case. |
limit: | Integer | No | Page size for each underlying request, clamped to 100. |
offset: | Integer | No | Offset the walk starts from, defaults to 0. |
product: | String | Symbol | No | Product slug, needed when the project slug is not unique in the workspace. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
Array[variable_history_event] with the complete audit trail, newest first.
Reads the events collection. list returns one page as an Envless::Page with items and pagination, list_all collects every page into an array, and iterate yields one item at a time to a block, fetching the next page only when it gets there. Without a block, iterate returns an Enumerator.
Worth knowing
- Events keep their order across page boundaries, so
events[0]is the most recent change. - On the Free plan only the latest event is returned (the API's
historyLimitedandhiddenCountflags are not surfaced on the returned array, so a one-item result on Free is the plan, not an empty history); the full trail needs Dev or above.
Required scopes
variables:read
Underlying endpoint
GET /projects/{slug}/environments/{environmentSlug}/variables/{name}/history
Request and response schema, every error code, and a live playground.
In TypeScript
envless.variables.listAllHistory()
The same method in @goenvless/sdk, with the same request, retries and errors.