Granola.Notes (Granola v1.0.0)

Copy Markdown View Source

Functions for interacting with Granola notes.

Summary

Functions

Fetches a single note by ID.

Lists notes for the authenticated workspace.

Returns a Stream that lazily pages through all notes matching the given filters.

Functions

get(client, note_id, opts \\ [])

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

Fetches a single note by ID.

Options

  • :include - Set to :transcript to include the full meeting transcript

Examples

iex> client = Granola.new(api_key: "grn_xxx")
iex> Granola.Notes.get(client, "not_1d3tmYTlCICgjy")
{:ok, %{id: "not_1d3tmYTlCICgjy", title: "...", ...}}

iex> Granola.Notes.get(client, "not_1d3tmYTlCICgjy", include: :transcript)
{:ok, %{id: "not_1d3tmYTlCICgjy", transcript: [...], ...}}

list(client, opts \\ [])

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

Lists notes for the authenticated workspace.

Options

  • :created_before - Return notes created before this date (Date or DateTime)
  • :created_after - Return notes created after this date (Date or DateTime)
  • :updated_after - Return notes updated after this date (Date or DateTime)
  • :cursor - Pagination cursor from a previous response
  • :page_size - Number of results per page (1–30, default 10)

Examples

iex> client = Granola.new(api_key: "grn_xxx")
iex> Granola.Notes.list(client, page_size: 5)
{:ok, %{notes: [...], hasMore: false, cursor: nil}}

stream(client, opts \\ [])

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

Returns a Stream that lazily pages through all notes matching the given filters.

Accepts the same options as list/2, except :cursor and :page_size.

Examples

iex> client = Granola.new(api_key: "grn_xxx")
iex> Granola.Notes.stream(client) |> Enum.take(3)
[%{id: "not_...", ...}, ...]