Skip to content

feat(inboxes): accept path attachments on drafts - #308

Open
dielduarte wants to merge 8 commits into
mainfrom
feature/dev-2420-python-sdk-internal-squad-devtools
Open

dielduarte wants to merge 8 commits into
mainfrom
feature/dev-2420-python-sdk-internal-squad-devtools

Conversation

@dielduarte

@dielduarte dielduarte commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

resend.Inboxes.Drafts.create() and .update() now accept path attachments. This ports resend/resend-node#1172 (released in resend@6.36.0). Spec: resend/resend-openapi#141. The API change is live.

Changes

The attachments field of create/update is now typed as InboxDrafts.DraftAttachmentParams, a union of two TypedDicts, so mypy rejects invalid shapes:

  • AttachmentParams: content, filename, content_type (all required). This is the existing type, unchanged, so InboxDrafts.AttachmentParams(...) still works as a constructor.
  • PathAttachmentParams (new): path, filename, plus an optional content_type that defaults to the downloaded file's type.

The params are sent as-is, so no runtime change was needed. Fully backward compatible.

  • The create/update docstrings now describe the path rules instead of "a path returns a 422".
  • examples/inboxes.py adds a path attachment to the draft.
  • Version: 2.50.1 → 2.51.0 (minor).

Verification

  • flake8, pytest (852 passed) and mypy (strict) all pass. mypy shows only the 5 unused-ignore errors that are also on main.
  • New tests: create and update send path attachments with and without content_type. mypy checks that an attachment with no source, with both sources, or with content and no content_type stays a type error.
  • Live against api.resend.com through the SDK:
    • create with path stores invoice.pdf (application/pdf, 80893 bytes)
    • update with path + content stores both
    • an ftp:// path raises a 422 ResendError
    • a draft with a path attachment sends

Linear: DEV-2420


Summary by cubic

Adds support for path URL attachments to inbox drafts. InboxDrafts.AttachmentParams stays a TypedDict for inline content, and the new DraftAttachmentParams union accepts either inline base64 content or a URL downloaded when the request is made, so mypy rejects attachment dicts that mix or omit both sources. Params are sent as-is, so no runtime change was needed and existing code using AttachmentParams keeps working.

  • Updates the create/update docstrings to describe the path rules instead of "a path returns a 422".
  • Adds a path attachment to the draft example.
  • Bumps the version to 2.51.0.

Written for commit 678c40b. Summary will update on new commits.

View guided diff

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cubic analysis

All reported issues were addressed across 4 files

Linked issue analysis

Linked issue: DEV-2420: Python SDK (internal, squad-devtools)

Status Acceptance criteria Notes
✅ Support path attachments on inbox drafts Draft attachments now accept path-based parameters, and tests cover create and update requests with optional content_type.
❌ Update the Python API reference code tab The diff updates SDK docstrings and an example, but contains no change to the API reference code tab.
⚠️ Release the updated Python SDK The version is bumped to 2.51.0, but the diff does not show that the package was released.

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

View guided diff | Re-trigger cubic

Comment thread resend/inboxes/drafts/_inbox_drafts.py Resolved
Comment thread resend/inboxes/drafts/_inbox_drafts.py Resolved

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

Copy link
Copy Markdown
Contributor

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 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
Contributor

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
Contributor

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: Adds path-attachment support to inbox draft create/update: a new union TypedDict, docstring updates, an example, tests, and a minor version bump. This expands the SDK's public request contract and client capability, so the feature decision needs human sign-off.

View guided diff | Re-trigger cubic

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

Copy link
Copy Markdown
Contributor

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 path URL attachment support to inbox draft create/update params with docs, tests, example, and version bump. This expands the SDK's public request contract with a new client capability, so the feature decision needs human sign-off.

View guided diff | Re-trigger cubic

@dielduarte
dielduarte marked this pull request as ready for review October 30, 2026 18:21

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

Copy link
Copy Markdown
Contributor

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 1 file (changes from recent commits).

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

View guided diff | Re-trigger cubic

Comment thread examples/inboxes.py Resolved

@klotty klotty 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.

Auto-approved.

This branch has not been deployed

No deployments
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