feat(inboxes): match the inbox commands to the stable Inboxes API
Merged
FE
16d ago+2018+2018+0123456789012345678901234567890123456789-421-421-012345678901234567890123456789
What broke in 2.25.0
The Inboxes API is now stable. Three commands of the released 2.25.0 fail against the live API.
inboxes agent getreadsenabled_actions. The API now returnsactions, so the interactive output crashes on.join.inboxes agent update --enabled-actionssendsenabled_actions. The API ignores it and returns 422.inboxes threads update --add-label-idsand--remove-label-idssend fields that the API strips. The request returns 422.
This PR moves the CLI to resend@6.34.1 and matches every inbox command to the merged OpenAPI spec (resend-openapi#137).
Changes per command group
agent
agent getreads and printsactions.agent updatetakes--actionsand removes duplicate values. The values arearchiveandmove_to_trash, notarchive_threadanddelete_thread. An old value fails withinvalid_actionsand names the new value.--toneaccepts only the four presets fromINBOX_AGENT_TONES, or""to clear it. Other text fails withinvalid_tone(MES-2747).- The error code
invalid_enabled_actionsis nowinvalid_actions. The sibling codes (invalid_tone,invalid_limit,invalid_header) take the name of the flag. mainhad no SDK bridge foractions. The bridge was only in the closed #417, so MES-2740 needs no code removal here.
threads labels (new)
threads labels add <inbox> <thread> --labels <ids...>callsPOST /inboxes/{inbox_id}/threads/{thread_id}/labels.threads labels set <inbox> <thread> --labels <ids...>callsPUTon the same path.--labels ""removes every label.threads labels remove <inbox> <thread> <label>callsDELETE .../labels/{label_id}.- Each command calls one SDK method (
resend.inboxes.threads.labels.add|set|remove) and outputs the label list of the thread.
threads
threads updatetakes only--read,--unreadand--folder.threads searchdropshighlightsfrom help and from the table. The table showsmatched_email_id, which is now the email ID thatthreads emails listreturns.
Inbox ID or email address
- Every command that names an inbox takes its ID or its email address. A value with
@goes to the SDK asemailAddress. Any other value goes asinboxId, like the MCP servers. - The help of every argument and
--inbox-idflag says "Inbox UUID or email address". inboxes deleteprints the API result, so an address argument still prints the inbox UUID.
inboxes, drafts, attachments, keys
inboxes getandlisthelp showcreated_atandupdated_at.getprints both in interactive mode.inboxes createhelp says the address cannot contain a+.drafts updatehelp shows the new output{"object":"inbox_draft","id":"<uuid>"}.drafts createanddrafts sendhelp say a reply draft without a subject is sent with the thread subject and aRe:prefix.threads emails replyandforwardhelp state only the 25 MB attachment rule. Thepathrule now matches the API.threads emails reply,threads emails forward,drafts createanddrafts sendaccept a sending-access key. The other inbox commands still need full access. The interactive pickers list inboxes, threads or drafts, so a sending-access key must pass every ID.
Docs
- README and
skills/resend-cli/references/inboxes.mddescribe all of the above. The SKILL.md command table liststhreads labels.
Compatibility
--enabled-actionsand--enabled_actionsstay as hidden aliases of--actions.--add-label-ids,--remove-label-idsand their snake_case spellings stay as hidden flags. They fail withinvalid_optionsand a message that namesthreads labels add,removeandset. The CLI does not drop them silently.invalid_enabled_actionsis nowinvalid_actions.drafts updateJSON output is now onlyobjectandid, because the API changed.
Checks
pnpm install --frozen-lockfilepasses.resendis inminimumReleaseAgeExcludeinpnpm-workspace.yaml, so 6.34.1 installs.pnpm lint,pnpm typecheck,CI=true pnpm vitest run(1479 passed, 1 skipped) andpnpm buildpass.- New tests assert the whole SDK payload for each new and changed command.
tests/commands/inboxes/email-address.test.tsruns every inbox command with an address.tests/commands/inboxes/sending-access.test.tschecks the key access. pnpm test:e2ewas not run.
E2E
Built CLI, .env key, fixture inbox 43cd94f5-63f2-4abe-93d4-58b9c26f353e.
--helpfor all 36 inbox commands exits 0.agent getby ID and by address returnsactions. Interactive output printsActions: (none).agent updatewas not called on the API, so the fixture agent did not change. Its localinvalid_toneandinvalid_actionserrors were checked.threads labels add,set,removeandset --labels ""on thread772da839returned the expected lists. An unknown label returned 404Label not found.. The thread labels are[]again, as before. The labelsspec-137 aandspec-137 bdid not change.threads update --add-label-idsreturnedinvalid_optionsbefore any API call.inboxes get,labels list,threads list,threads search,threads get,threads emails list,threads emails get,drafts listanddrafts getpassed by ID, by address and by an uppercase address.matched_email_idequals theidfromthreads emails list.- One draft was created, updated (output
{object, id}), read and deleted. - A throwaway inbox was created with
--forwardingand deleted by its address. The delete output held the inbox UUID.
Release
Release 2.26.0. package.json is 2.26.0 and the resend-cli skill is 2.23.0.