Skip to content

feat(inboxes): match the spec to the stabilized Inboxes API - #137

Merged
felipefreitag merged 14 commits into
mainfrom
feat/inboxes-stabilized-api
Oct 16, 2026
Merged

felipefreitag merged 14 commits into
mainfrom
feat/inboxes-stabilized-api

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Match the Inboxes part of resend.yaml to the public API on resend-monorepo main of 2026-10-16 17:20 UTC.

Inbox identifier

Inbox, label and thread routes take the Inbox ID or the inbox email address. The new InboxIdOrEmailAddress parameter documents it. Agent, draft and email routes take both too, since #12892 (see the Identifier section). Monorepo #12843, #12846, #12849, #12850, #12851, #12852, #12853, #12854, #12855, #12857, #12858, #12764.

Email routes without the thread segment

Not in the spec for now. The API added GET /inboxes/{inbox_id}/emails, GET /inboxes/{inbox_id}/emails/{email_id} and POST /inboxes/{inbox_id}/emails/{email_id}/reply (resend-monorepo #12859, #12866, #12864), but the Node.js SDK calls only the thread email routes. The spec follows the SDK until the team decides on these routes (MES-2753 was canceled).

Agent actions

enabled_actions is now actions. archive_thread and delete_thread are now archive and move_to_trash. Monorepo #12724, #12736, #12830, #12742.

Timestamps

Inboxes add updated_at. List items add created_at and updated_at. Labels and emails do not change. #12704, #12714 and #12790 are internal only. Monorepo #12711.

Drafts

Update draft returns only object and id. A reply draft sent without a subject takes the thread subject with Re:. Monorepo #12729, #12621.

Search

Remove highlights. matched_email_id is now the email id. Monorepo #12612, #12599.

Access keys

The Inboxes tag lists the five routes that accept a sending access key. Monorepo #12641.

Small fixes

No + in the address local part. No 10-file cap on reply and forward. The path rule matches the validator. Monorepo #12776, #12762.

Verified

  • Code: origin/main of apps/public-api inbox routes, types and auth middleware, packages/inboxes, packages/inbox-agent-schemas and the internal API drafts.
  • Live, on the test team. Every result matches main:
    • Address in path: inbox, threads, search, labels 200. Agent, drafts, emails 422. Temporary inbox PATCH and DELETE 200.
    • Agent: archive 200, archive_thread 422, enabled_actions alone 422.
    • Emails: list 200, list without thread_id 422, get 200, unknown email 404. New reply 200 with object, thread reply 200 with id only.
    • 11 attachments: reply 200, draft 201.
    • Update draft 200 with object and id. Reply draft without subject sent as Re: spec check 1016.
    • + address 422. Search has no highlights, and matched_email_id equals the email id.
  • Not live: the sending access key routes.
  • redocly lint: 0 errors, as on main. The three new operations add three warnings from the 4xx rule.

Not in this PR

Open monorepo PRs: #12743, #12744, #12834, #12152.

Breaking for clients

  • Agent enabled_actions is renamed to actions.
  • Agent action archive_thread is renamed to archive, and delete_thread to move_to_trash. The old names return 422.
  • Update draft returns {object, id}, not the full draft.
  • Search results lose highlights.
  • matched_email_id now holds the email id.
  • inbox_id loses format: uuid on 27 operations.
  • Update thread no longer takes add_label_ids or remove_label_ids. Use the thread label operations.

Agent tone

tone stays the enum of the four presets from #136. That is the intended contract. The live API still accepts custom text, which is an API bug, not part of the contract.

Thread labels

Thread labels move to their own endpoints. Monorepo #12778, merged 2026-10-16.

  • inboxes/add-thread-labels: POST /inboxes/{inbox_id}/threads/{thread_id}/labels. Body labels, 1 to 10 label IDs. Labels already on the thread stay.
  • inboxes/set-thread-labels: PUT /inboxes/{inbox_id}/threads/{thread_id}/labels. Body labels, 0 to 100 label IDs. It replaces every label in one atomic change. An empty array clears them.
  • inboxes/remove-thread-label: DELETE /inboxes/{inbox_id}/threads/{thread_id}/labels/{label_id}. A label that is not on the thread returns 200.
  • All three return { object: "list", data: [label] } with every label on the thread after the change. They accept the inbox ID or address.
  • Errors: an unknown label returns 404 Label not found. and changes nothing. An unknown thread returns 404 Thread not found.. A bad labels array returns 422.
  • Update thread loses add_label_ids and remove_label_ids. The API strips them, so a body with only those fields returns 422 validation_error.
  • inbox.thread.labels.updated can now list several labels in added and removed. A request that changes nothing sends no event. The other 13 inbox.* payloads do not change.
  • Live: add, remove and set each 200 with the expected list. Unknown label 404, unknown thread 404, empty add 422, 11 IDs 422, update thread with only add_label_ids 422. The temporary label was deleted and the fixture thread kept its labels.

Identifier

Agent, draft, email and thread email routes now take the Inbox ID or the inbox email address. Monorepo #12892, merged 2026-10-16.

  • The 12 operations that took only the UUID now use InboxIdOrEmailAddress: get-agent, update-agent, the six draft operations, list-thread-emails, get-thread-email, reply-thread-email and forward-thread-email.
  • Every route under /inboxes/{inbox_id} now accepts both.
  • Live: agent GET and drafts list by address 200. Thread-free and thread email lists by address 200. An unknown address 404, an invalid address 422.

The inbox, label and thread routes now take the inbox ID or its email
address in the path. Agent, draft and email routes still take only the ID.
Add a shared InboxIdOrEmailAddress path parameter for these routes.

Monorepo PRs: #12843, #12846, #12849, #12850, #12851, #12852, #12853,
#12854, #12855, #12857, #12858, #12764.
Add GET /inboxes/{inbox_id}/emails, GET /inboxes/{inbox_id}/emails/{email_id}
and POST /inboxes/{inbox_id}/emails/{email_id}/reply. The list route takes
the thread in a required thread_id query parameter. The reply response adds
object: email. The thread routes stay, and the code does not deprecate them.

Monorepo PRs: #12859, #12864, #12866.
The agent request and response use actions. The archive and trash actions
are now archive and move_to_trash. The API rejects the old names
archive_thread and delete_thread on update, and returns stored old names
under the new ones.

Monorepo PRs: #12724, #12736, #12742, #12830.
Retrieve inbox and the inbox.created and inbox.updated webhooks add
updated_at. List inboxes adds created_at and updated_at to each item.
Labels and inbox emails keep their public fields: the updated_at from
#12704, #12714 and #12790 stays inside the internal API.

Monorepo PRs: #12711.
Update draft now returns only object and id. A reply draft sent with an
empty subject takes the thread subject with a Re: prefix. A standalone
draft still needs a subject to send.

Monorepo PRs: #12729, #12621.
Search results no longer carry highlights. matched_email_id is now the
same id that the list emails endpoints return.

Monorepo PRs: #12612, #12599.
A sending access key can now reply, forward, create a draft and send a
draft. A key limited to one domain must match the inbox domain, or the
request returns a 403. Every other Inboxes route still needs full access.

Monorepo PRs: #12641.
An inbox address cannot contain + before the @. Reply and forward no
longer cap the number of attachments, only the 25 MB of content. The
request rejects only a path that does not start with http or that starts
with http://localhost:. Other path problems fail the email at send time.

Monorepo PRs: #12776, #12762.
The API accepts a preset key or custom text (inboxAgentToneSchema in resend-monorepo#12580). The enum rejected the custom tones that inboxes already store.
Add the add, set and remove thread label operations from resend-monorepo#12778.
Remove add_label_ids and remove_label_ids from update thread. The API now
ignores them. A label webhook event can now list several labels.
resend-monorepo#12892 accepts the inbox ID or email address on the agent,
draft, email and thread email routes. Use the shared InboxIdOrEmailAddress
parameter on all 15 of them.
This reverts 93968cd. The contract is the four presets only. The API still accepts custom text, which is an API bug to fix.
The Node.js SDK calls only the thread email routes, so the spec documents those for now. The API keeps the routes without the thread segment.
… note

Reply returns a 422 without html or text, as the Node.js SDK types it. The matched_email_id note still counted the removed list emails route.
@felipefreitag
felipefreitag merged commit c272fb9 into main Oct 16, 2026
3 checks passed
@felipefreitag
felipefreitag deleted the feat/inboxes-stabilized-api branch October 16, 2026 17:46
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.

2 participants