Attio.Entries (Attio v0.2.0)

Copy Markdown View Source

Functions for managing entries within Attio lists.

Entries are elements within a list. Each entry references a parent record and can carry list-specific attribute values (e.g. pipeline stage, deal owner).

Requires the list_entry:read scope for read operations and list_entry:read-write for mutations.

Pagination

list/3 returns a single page. stream/3 lazily pages through all entries; stream_all/3 collects them into {:ok, list}. See Attio for an overview.

client
|> Attio.Entries.stream("pipeline")
|> Stream.filter(fn e -> e["values"]["stage"] == "qualified" end)
|> Enum.to_list()

Summary

Functions

Creates an entry in a list.

Deletes an entry from a list.

Gets a single entry by its ID.

Lists entries in a list. Returns one page.

Returns a lazy stream of all entries in a list across all pages.

Fetches all entries in a list across all pages and returns them as a list.

Updates an entry's attribute values.

Functions

create(client, list_id, attrs)

@spec create(Attio.Client.t(), String.t(), map()) :: {:ok, map()} | {:error, term()}

Creates an entry in a list.

Required attributes

  • "record_id" - ID of the record to add.

delete(client, list_id, entry_id)

@spec delete(Attio.Client.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, term()}

Deletes an entry from a list.

get(client, list_id, entry_id)

@spec get(Attio.Client.t(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}

Gets a single entry by its ID.

list(client, list_id, params \\ [])

@spec list(Attio.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}

Lists entries in a list. Returns one page.

Options

  • :limit - Number of entries per page (1–1000, default 500).
  • :cursor - Opaque pagination cursor from a previous response.

stream(client, list_id, params \\ [])

@spec stream(Attio.Client.t(), String.t(), keyword()) :: Enumerable.t()

Returns a lazy stream of all entries in a list across all pages.

Accepts the same options as list/3. Raises {:attio_stream_error, error} on API failure mid-stream. Use stream_all/3 if you prefer a standard {:ok, list} | {:error, term()} return value.

stream_all(client, list_id, params \\ [])

@spec stream_all(Attio.Client.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, Attio.Error.t() | Exception.t()}

Fetches all entries in a list across all pages and returns them as a list.

Accepts the same options as list/3. Returns {:ok, [map()]} on success or {:error, term()} if any page request fails. Unlike stream/3, the entire result set is loaded into memory.

Example

{:ok, entries} = Attio.Entries.stream_all(client, "pipeline")

update(client, list_id, entry_id, attrs)

@spec update(Attio.Client.t(), String.t(), String.t(), map()) ::
  {:ok, map()} | {:error, term()}

Updates an entry's attribute values.