def list(
limit: nil,
offset: nil,
search: nil,
order: nil,
product: nil,
timeout: nil
)def list: (
?limit: Integer?,
?offset: Integer?,
?search: (String | Symbol)?,
?order: ("name" | "asc" | "desc")?,
?product: (String | Symbol)?,
?timeout: seconds?
) -> Page[project_resource]Returns a single page of projects drawn from every product the key can reach, as items plus the raw pagination envelope. Nothing is fetched beyond that page, so read pagination[:hasMore] before assuming you have the whole set.
Project slugs are unique per product, not per workspace, so this flat list can legitimately hold two rows with the same slug. Key off id, or off the product[:slug] and slug pair. Every row carries its product Hash so you never need a second call to disambiguate. Pass product: to narrow to one product.
Example
require "envless/sdk"
page = Envless.projects.list(product: "billing", limit: 50)
page.items.each do |project|
puts "#{project.dig(:product, :slug)} #{project[:slug]}"
endParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product: | String | Symbol | No | Product slug or product uniqueId to filter the list down to one product. |
limit: | Integer | No | Rows per page, a whole number from 1 to 100. |
offset: | Integer | No | Rows to skip before the page starts. |
search: | String | Symbol | No | Case insensitive substring match against project name and slug. |
order: | "name" | "asc" | "desc" | No | Defaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt. |
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
Page[project_resource] with items and the pagination envelope.
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
- An unknown or inaccessible
product:fails with 404product.not_found, it does not quietly return an empty page. - Projects a restricted key cannot reach are simply absent from the page rather than rejected.
Required scopes
projects:read
Underlying endpoint
GET /projects
Request and response schema, every error code, and a live playground.
In TypeScript
envless.projects.list()
The same method in @goenvless/sdk, with the same request, retries and errors.