Nuntly.Inboxes (nuntly v0.1.0)

Copy Markdown View Source

Create email inboxes at a specific address on a verified receiving domain. Assign inboxes to namespaces or AI agents.

Summary

Functions

create_inbox(client, body, opts \\ [])

Create Inbox

Create a new inbox on a verified domain.

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • body — application/json request body using CreateInboxRequest. Accepted fields:
    • "domainId" (string, optional) — The id of the domain for this inbox. Defaults to your provided domain when omitted.
    • "address" (string, required) — The local-part of the email address (before the @).
    • "name" (string, optional) — The display name of the inbox.
    • "namespaceId" (string, optional) — The id of the namespace to assign the inbox to.
    • "agentId" (string, optional) — The external AI agent identifier.
  • opts — Optional keyword list passed to Req for this request.

Example

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

Nuntly.Inboxes.create_inbox(
  client,
  %{
    "address" => "address"
  }
)

delete_inbox(client, inbox_id, opts \\ [])

Delete Inbox

Soft-delete an inbox.

Arguments

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

Example

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

Nuntly.Inboxes.delete_inbox(client, "inbox-id")

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

List Inboxes

List all inboxes.

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • 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.
    • "namespaceId" — Optional query parameter, string. Filter by namespace.
  • opts — Optional keyword list passed to Req for this request.

Example

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

Nuntly.Inboxes.list_inboxes(
  client,
  %{
    "cursor" => "cursor",
    "limit" => 30,
    "namespaceId" => "namespace-id"
  }
)

retrieve_inbox(client, inbox_id, opts \\ [])

Retrieve Inbox

Retrieve an inbox.

Arguments

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

Example

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

Nuntly.Inboxes.retrieve_inbox(client, "inbox-id")

send_inbox_message(client, inbox_id, body, opts \\ [])

Send Inbox Message

Send a new message from an inbox.

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • inbox_id — Required path parameter, string.
  • body — application/json request body using SendMessageRequest. Accepted fields:
    • "to" (list of string, required) — The recipient addresses.
    • "cc" (list of string, optional) — The CC addresses.
    • "bcc" (list of string, optional) — The BCC addresses.
    • "subject" (string, required) — The message subject.
    • "text" (string, optional) — The plain text body.
    • "html" (string, optional) — The HTML body.
  • opts — Optional keyword list passed to Req for this request.
    • "Idempotency-Key" — Optional header, string. Unique key to ensure the request is processed at most once. UUIDv4 recommended.

Example

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

Nuntly.Inboxes.send_inbox_message(
  client,
  "inbox-id",
  %{
    "to" => "brian67@gmail.com",
    "subject" => "Verify your email address"
  },
  headers: [{"Idempotency-Key", "idempotency-key"}]
)

update_inbox(client, inbox_id, body, opts \\ [])

Update Inbox

Update an inbox.

Arguments

  • client — A Nuntly.Client returned by Nuntly.new/1.
  • inbox_id — Required path parameter, string.
  • body — application/json request body using UpdateInboxRequest. Accepted fields:
    • "name" (string or nil, optional) — The display name of the inbox.
  • opts — Optional keyword list passed to Req for this request.

Example

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

Nuntly.Inboxes.update_inbox(
  client,
  "inbox-id",
  %{
    "name" => "name"
  }
)