Projects

Envless.projects.list_all

Collect every reachable project into one array

def list_all(
  limit: nil,
  offset: nil,
  search: nil,
  order: nil,
  product: nil,
  timeout: nil
)

Walks every page for you and returns the flattened result. Use it when the workspace is small enough that holding all projects in memory is fine and you would rather not manage offsets.

The trap is limit:, which here sets the page size used while walking, not a cap on how many projects come back. Asking for a limit of 5 still returns everything, just in more round trips. Duplicate slugs across products survive into the array, so continue keying off id.

Example

ruby
require "envless/sdk"

projects = Envless.projects.list_all(search: "api")

puts projects.size

Parameters

ParameterTypeRequiredDescription
product:String | SymbolNoProduct slug or product uniqueId to restrict the walk to one product.
limit:IntegerNoPage size used while walking, clamped to 100.
offset:IntegerNoRow to start the walk from.
search:String | SymbolNoCase insensitive substring match against project name and slug.
order:"name" | "asc" | "desc"NoDefaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt.
timeout:Integer | Float | RationalNoSeconds 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[project_resource] holding every project the key can reach.

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

  • Page size defaults to the API maximum of 100 and is clamped there, so a larger limit buys nothing.
  • Nothing is returned until the final page lands. Prefer iterate when you want to act on rows as they arrive.

Required scopes

projects:read

Underlying endpoint

GET /projects

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

In TypeScript

envless.projects.listAll()

The same method in @goenvless/sdk, with the same request, retries and errors.