Projects

Envless.projects.list

Read one page of projects across products

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

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

ruby
require "envless/sdk"

page = Envless.projects.list(product: "billing", limit: 50)

page.items.each do |project|
  puts "#{project.dig(:product, :slug)} #{project[:slug]}"
end

Parameters

ParameterTypeRequiredDescription
product:String | SymbolNoProduct slug or product uniqueId to filter the list down to one product.
limit:IntegerNoRows per page, a whole number from 1 to 100.
offset:IntegerNoRows to skip before the page starts.
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

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 404 product.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.