feat: add emails.share() method - #1074
Merged
Merged
Conversation
Adds support for POST /emails/{id}/share, which generates a
shareable link for a sent or received email. Mirrors the
cancel/update email method conventions.
commit: |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
felipefreitag
approved these changes
Aug 20, 2026
gabrielmfern
approved these changes
Aug 20, 2026
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
emails.share(id, options?), calling the newPOST /emails/{id}/shareendpoint that creates a shareable link for a sent or received email. See the spec PR resend/resend-openapi#92.options.expiresInis an optional human-readable duration (e.g.10m,2 hours,1 day; server defaults to48h, capped at 48h).Summary by cubic
Adds
emails.share(id, options?)to generate a shareable link for a sent or received email. Previously there was no SDK method; now clients can create a link with an optional expiration (server defaults to 48h, capped at 48h).options.expiresIn(e.g., "10m", "2 hours", "1 day") to{ expires_in }inPOST /emails/{id}/share. Returns 422 for malformed or >48h durations, and 404 when the email is not found.ShareEmailOptions/ShareEmailResponsetypes and re-exports them. Adds tests for default/custom expiration and error cases.Written for commit efabbe7. Summary will update on new commits.