feat(inboxes): accept path attachments on drafts
Merged
DI
7h ago+11+11+01234567890123456789-9-9-0123456789
POST /inboxes/{inbox_id}/drafts and PATCH /inboxes/{inbox_id}/drafts/{draft_id} now accept path attachments, like POST /emails. They used to return a 422. API change: resend/resend-monorepo#13475 (live in prod).
Changes
InboxDraftAttachmentInput:
- Only
filenameis required now.contentis required withoutpath, andpathis required withoutcontent. - New
pathproperty. content_typeis required withcontent. Withpath, it defaults to the downloaded file's content type.
The create/update attachments descriptions and the create-draft operation description now say that a path file is downloaded when the request is made (not when the draft is sent). They also give the 422 cases:
- a
paththat doesn't start withhttp/https, or can't be downloaded - downloads that take more than 20 seconds together
- a total over 25 MB, downloaded files included
Verification
yq eval . resend.yamlparses.redocly lintgives 184 warnings and 0 errors, the same as main.- Each rule checked live against api.resend.com:
path+filename→ 201, and the content type comes from the downloadpathwithoutfilename→ 422contentwithoutcontent_type→ 422ftp://path → 422- PATCH with
path→ 200 content+path→contentwins
Linear: DEV-2418