Skip to content

feat(inboxes): add the inboxes endpoints and inbox webhook events - #119

Merged
AntoniosBarotsis merged 21 commits into
mainfrom
feature/dev-2328-rust-sdk-external-tony-via-slack-team-sdks
Oct 17, 2026
Merged

AntoniosBarotsis merged 21 commits into
mainfrom
feature/dev-2328-rust-sdk-external-tony-via-slack-team-sdks

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR adds the Inboxes API to the Rust SDK.

  • resend.inboxes is a new InboxesSvc with the 29 /inboxes operations. The nested resources use flat, prefixed methods, the same as webhooks.list_events:
    • Inboxes: create, list, get, update, delete.
    • Agent: get_agent, update_agent.
    • Labels: list_labels, create_label, update_label, delete_label.
    • Threads: list_threads, search_threads, get_thread, update_thread, delete_thread.
    • Thread labels: add_thread_labels, set_thread_labels, remove_thread_label.
    • Thread emails: list_thread_emails, get_thread_email, reply_thread_email, forward_thread_email.
    • Drafts: list_drafts, create_draft, get_draft, update_draft, delete_draft, send_draft.
  • The list endpoints take the usual ListOptions<T>. list_threads and search_threads also take a filter struct. The struct sends folders, labels, from, to, cc and bcc as comma-separated values, as the API requires.
  • Create inbox, create label and create draft return { object, id }. Reply, forward and send draft return { id }, the ID of the sent email.
  • reply_thread_email and forward_thread_email accept attachments. They use CreateAttachment, the same type as emails.send.
  • Every method takes the inbox ID or the inbox email address. inbox_path percent-encodes it.
  • update_thread takes read and folder. The folder is an UpdateInboxThreadFolder, because sent cannot be set. Labels change through add_thread_labels (POST, 1 to 10 IDs), set_thread_labels (PUT, up to 100 IDs, an empty slice clears them) and remove_thread_label (DELETE). Each returns a ListInboxThreadLabelsResponse with every label on the thread.
  • The agent uses actions. InboxAgentAction has Archive and MoveToTrash, and tone is the InboxAgentTone enum of the four presets.
  • update_draft returns UpdateInboxDraftResponse, with only object and id.
  • Search results have no highlights. matched_email_id is the email id that list_thread_emails returns.
  • Inbox has updated_at, and InboxListItem has created_at and updated_at.
  • Drafts accept attachments (resend/monorepo#12481). CreateInboxDraftAttachment needs content, filename and content_type, because the API stores each file on the draft. On update, with_attachments replaces every attachment, and an empty list removes them all. Drafts, draft list items and the draft in inbox.draft.* events return attachments.
  • Create draft, send draft, reply and forward accept an Idempotency-Key header (resend/monorepo#11768). They expose it the same way as emails.send: with_idempotency_key on the options returns an Idempotent<T>. send_draft takes a SendInboxDraftOptions for this, because the request has no body.
  • Reply, forward and send draft accept custom headers (resend/monorepo#12509), through with_header as on emails.send. Resend sets In-Reply-To, References and Reply-To, so the API returns a 422 for them. send_draft sends a body only when headers are set.
  • UpdateInboxAgentOptions and UpdateInboxDraftOptions have clear_* methods that send null, because the API clears a field on null.
  • Event and EventType get the 14 inbox.* webhook events. InboxEvent is an enum tagged by type, because the data shape changes with the event type. events_up_to_date now counts the inbox events instead of skipping them.
  • The doc comments use the words of the OpenAPI spec descriptions, from feat(inboxes): add the Inboxes API and webhook events to the spec resend-openapi#125 and #137.
  • Version bump to 0.35.0, in its own commit. I left CHANGELOG.md for the release.

Depends on

  • No SDK release is needed. The API changes this PR follows (resend/monorepo#12396, #12481, #11768 and #12509) are live.
  • The tone presets text merges after resend-monorepo #12580, #12634 and #12635 are deployed.

Verification

  • cargo build
  • cargo fmt --check
  • cargo clippy --all-targets -- -Dwarnings
  • cargo clippy --all-targets --no-default-features --features rustls-tls -- -Dwarnings
  • cargo clippy --all-targets --features blocking -- -Dwarnings
  • cargo test --lib inbox: 29 offline tests pass, with and without --features blocking. They cover the request bodies, the query strings, the response shapes, and one payload per inbox webhook event.
  • cargo test --lib events_up_to_date: passes against the live event types page with the 14 inbox events counted.

The three clippy runs and cargo fmt --check pass.

A live run through the methods against https://api.resend.com, on a test inbox addressed by its email address. It restored every setting it changed and did not create or delete an inbox. All 33 checks passed:

  • get, update and list: OK. updated_at and the list item created_at and updated_at are set. The name was restored.
  • get_agent and update_agent with InboxAgentTone::ExpandedCasual and [Archive, MoveToTrash]: OK, and the old values were restored.
  • create_label, update_label, list_labels, delete_label: OK.
  • add_thread_labels, set_thread_labels with an empty slice, remove_thread_label: OK, each returned the thread labels. Removing a label that is not on the thread returned 200. An unknown label returned 404 Label not found.
  • get_thread, update_thread with read and a restore, list_threads, and delete_thread on a thread in trash, which returned deleted: false.
  • search_threads: OK, and matched_email_id is an email id from list_thread_emails.
  • list_thread_emails, get_thread_email, reply_thread_email, forward_thread_email: OK.
  • create_draft, update_draft (only object and id), get_draft, list_drafts, send_draft, delete_draft: OK.
  • An unknown inbox address returned 404 Inbox not found.

The crate tests that call the live API do not include inboxes, because the CI team may have no inbox to test with.

Not in this PR

  • Sender authentication fields. They are not on the API yet.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread src/inboxes.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/events.rs Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds the Inboxes SDK (26 endpoints, types, and 14 inbox webhook events) plus a version bump. Needs human sign-off because the PR depends on an unreleased upstream API change for label-id fields and adds a large public contract surface.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 4 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

felipefreitag and others added 14 commits October 16, 2026 16:25
Add InboxesSvc with the 26 /inboxes operations: inboxes, agent settings, labels, threads, thread emails and drafts.
Add InboxEvent and InboxEventType for the 14 inbox events, and count them in events_up_to_date.
The API removed label_id. Use add_label_ids and remove_label_ids.
Create and update draft accept attachments with content, filename and content_type. Drafts, draft list items and the draft in inbox.draft.* events return attachments.
Follow the spec audit: no file count limit on draft attachments, send draft requirements, reply_all recipients, cursor and update order notes.
Create draft, send draft, reply and forward accept with_idempotency_key, the same way as emails.send. send_draft takes a SendInboxDraftOptions.
with_header works as on emails.send. send_draft sends a body only when headers are set.
Idempotency replays only a successful response, header name and value rules, reply and forward attachment rules. Add clear_attachments to the draft update.
Follow resend-openapi #137 and resend-node 7943103:

- Every inbox route takes the Inbox ID or the inbox email address, and
  `inbox_path` percent-encodes it.
- Agent: `enabled_actions` is now `actions`, `ArchiveThread` and
  `DeleteThread` are now `Archive` and `MoveToTrash`, and `tone` is the
  `InboxAgentTone` enum of the four presets.
- Add `add_thread_labels`, `set_thread_labels` and
  `remove_thread_label`. `UpdateInboxThreadOptions` loses
  `with_add_label_ids` and `with_remove_label_ids`.
- `update_draft` returns `UpdateInboxDraftResponse` with only `object`
  and `id`.
- Search results lose `highlights`.
- `Inbox` adds `updated_at`, and `InboxListItem` adds `created_at` and
  `updated_at`.
- Reply and forward no longer cap attachments at 10 files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dielduarte
dielduarte force-pushed the feature/dev-2328-rust-sdk-external-tony-via-slack-team-sdks branch from c850a08 to f182c0a Compare October 16, 2026 19:31

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@dielduarte
dielduarte marked this pull request as ready for review October 16, 2026 20:12
The `inbox` object in `inbox.created` and `inbox.updated` events is the
same inbox object that the API returns, which now has `updated_at`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds the Inboxes API client and inbox webhook event types, but a dismissed P1 double-encoding bug in get/update/delete still appears in the diff, so human review is needed before shipping.

View guided diff | Re-trigger cubic

@AntoniosBarotsis
AntoniosBarotsis merged commit 6533600 into main Oct 17, 2026
1 check passed
@AntoniosBarotsis
AntoniosBarotsis deleted the feature/dev-2328-rust-sdk-external-tony-via-slack-team-sdks branch October 17, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants