Nuntly.Threads (nuntly v0.1.0)

Copy Markdown View Source

Browse email conversations grouped by subject. Mark threads as read or spam, and assign them to an agent.

Summary

Functions

list_inbox_threads(client, inbox_id, params \\ %{}, opts \\ [])

List Inbox Threads

List threads in an inbox.

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • inbox_id — Required path parameter, string.
  • params — Optional map of query parameters:
    • "cursor" — Optional query parameter, string. Pagination cursor from a previous response
    • "limit" — Optional query parameter, integer. Maximum number of items to return Defaults to 30.
    • "labels" — Optional query parameter, string. Comma-separated labels to filter by (AND logic). Threads with spam/trash are excluded by default unless explicitly requested via ?labels=spam or ?labels=trash.
  • opts — Optional keyword list passed to Req for this request.

Example

client = Nuntly.new(api_key: "ntly_...")

Nuntly.Threads.list_inbox_threads(
  client,
  "inbox-id",
  %{
    "cursor" => "cursor",
    "limit" => 30,
    "labels" => "labels"
  }
)

list_thread_messages(client, thread_id, params \\ %{}, opts \\ [])

List Thread Messages

List messages in a thread (chronological order).

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • thread_id — Required path parameter, string.
  • params — Optional map of query parameters:
    • "cursor" — Optional query parameter, string. Pagination cursor from a previous response
    • "limit" — Optional query parameter, integer. Maximum number of items to return Defaults to 30.
  • opts — Optional keyword list passed to Req for this request.

Example

client = Nuntly.new(api_key: "ntly_...")

Nuntly.Threads.list_thread_messages(
  client,
  "thread-id",
  %{
    "cursor" => "cursor",
    "limit" => 30
  }
)

retrieve_thread(client, thread_id, opts \\ [])

Retrieve Thread

Retrieve a thread. Pass ?markRead=true to automatically remove the unread label from all messages.

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • thread_id — Required path parameter, string.
  • opts — Optional keyword list passed to Req for this request.

Example

client = Nuntly.new(api_key: "ntly_...")

Nuntly.Threads.retrieve_thread(client, "thread-id")

update_thread(client, thread_id, body, opts \\ [])

Update Thread

Update thread labels and agent assignment. Label operations apply to all messages in the thread.

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • thread_id — Required path parameter, string.
  • body — application/json request body using UpdateThreadRequest. Accepted fields:
    • "addLabels" (list of string, optional) — Labels to add to all messages in the thread.
    • "removeLabels" (list of string, optional) — Labels to remove from all messages in the thread.
    • "agentId" (string or nil, optional) — The AI agent identifier.
  • opts — Optional keyword list passed to Req for this request.

Example

client = Nuntly.new(api_key: "ntly_...")

Nuntly.Threads.update_thread(
  client,
  "thread-id",
  %{
    "addLabels" => ["add-label"]
  }
)