Functions for managing notes linked to records.
Notes are rich-text documents attached to parent records. Requires the
note:read scope for read operations and note:read-write for mutations.
Pagination
list/2 returns a single page. stream/2 lazily pages through all notes;
stream_all/2 collects them into {:ok, list}. See Attio for an overview.
client
|> Attio.Notes.stream(limit: 100)
|> Stream.filter(fn n -> n["title"] =~ "recap" end)
|> Enum.to_list()
Summary
Functions
Creates a note linked to a record.
Deletes a note.
Gets a single note by its ID.
Lists notes. Returns one page.
Returns a lazy stream of all notes across all pages.
Fetches all notes across all pages and returns them as a list.
Updates a note.
Functions
@spec create(Attio.Client.t(), map()) :: {:ok, map()} | {:error, term()}
Creates a note linked to a record.
Required attributes
"parent_object"- The object slug of the parent record (e.g."people")."parent_record_id"- The record ID to attach this note to."title"- Note title."content"- Note body as a document object.
@spec delete(Attio.Client.t(), String.t()) :: {:ok, map()} | {:error, term()}
Deletes a note.
@spec get(Attio.Client.t(), String.t()) :: {:ok, map()} | {:error, term()}
Gets a single note by its ID.
@spec list( Attio.Client.t(), keyword() ) :: {:ok, map()} | {:error, term()}
Lists notes. Returns one page.
Options
:limit- Number of notes per page.:cursor- Pagination cursor from a previous response.
@spec stream( Attio.Client.t(), keyword() ) :: Enumerable.t()
Returns a lazy stream of all notes across all pages.
Accepts the same options as list/2. Raises {:attio_stream_error, error}
on API failure mid-stream. Use stream_all/2 if you prefer a standard
{:ok, list} | {:error, term()} return value.
@spec stream_all( Attio.Client.t(), keyword() ) :: {:ok, [map()]} | {:error, Attio.Error.t() | Exception.t()}
Fetches all notes across all pages and returns them as a list.
Accepts the same options as list/2. Returns {:ok, [map()]} on success
or {:error, term()} if any page request fails. Unlike stream/2, the
entire result set is loaded into memory.
Example
{:ok, notes} = Attio.Notes.stream_all(client)
@spec update(Attio.Client.t(), String.t(), map()) :: {:ok, map()} | {:error, term()}
Updates a note.