Skip to content

feat(broadcasts): add duplicate endpoint - #279

Open
gabrielmfern wants to merge 2 commits into
mainfrom
feature/dev-2092-python-sdk-internal-squad-devtools
Open

feat(broadcasts): add duplicate endpoint#279
gabrielmfern wants to merge 2 commits into
mainfrom
feature/dev-2092-python-sdk-internal-squad-devtools

Conversation

@gabrielmfern

@gabrielmfern gabrielmfern commented Sep 11, 2026

Copy link
Copy Markdown
Member

Adds resend.Broadcasts.duplicate(id) and duplicate_async(id) for POST /broadcasts/{id}/duplicate, the endpoint added in resend/resend-openapi#115, ported from the Node method resend.broadcasts.duplicate(id). The release carries 2.45.0.

Two things an adversarial review pass wanted gone that stayed on purpose: the one-line behavior note in the docstrings (Templates.duplicate carries the same kind of note) and the async no-content test (every other endpoint in this file has one). Happy to drop either if you disagree.

Live call against staging through the new method, duplicating e6bd3843-3cc7-4c0d-b7fd-e01cbb514a16, then reading the copy back and deleting it. http_headers elided from the first line.

dup.py
import resend

source = "e6bd3843-3cc7-4c0d-b7fd-e01cbb514a16"
duplicated = resend.Broadcasts.duplicate(source)
print(duplicated)
assert duplicated["object"] == "broadcast"
assert duplicated["id"] != source
copy = resend.Broadcasts.get(duplicated["id"])
print("name:", copy["name"], "| status:", copy["status"], "| subject:", copy["subject"])
{'object': 'broadcast', 'id': 'e1dd9c48-da27-4d59-9f24-0d95a1702b1d', 'http_headers': {...}}
name: Untitled (copy) | status: draft | subject: Another day another test
$ http DELETE https://api.resend-staging.com/broadcasts/e1dd9c48-da27-4d59-9f24-0d95a1702b1d
{"object":"broadcast","id":"e1dd9c48-da27-4d59-9f24-0d95a1702b1d","deleted":true}

🤖 Generated with Claude Code


Summary by cubic

Adds duplicate() and duplicate_async() to Broadcasts for POST /broadcasts/{id}/duplicate. Duplicating a broadcast creates a new draft with the same content and " (copy)" appended to its name.

  • The new methods return the duplicated broadcast's ID and object type.
  • The SDK version is bumped to 2.45.0.
  • Tests and a usage example cover both sync and async paths, including the no-content error case.

Written for commit 1412d51. Summary will update on new commits.

Review in cubic

gabrielmfern and others added 2 commits September 11, 2026 14:47
Ports resend.broadcasts.duplicate(id) from the Node SDK for
POST /broadcasts/{id}/duplicate (resend/resend-openapi#115).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@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 5 files

Linked issue analysis

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

Status Acceptance criteria Notes
Implement the broadcasts duplicate endpoint in the Python SDK, including synchronous and asynchronous methods. The diff adds Broadcasts.duplicate and duplicate_async using POST /broadcasts/{id}/duplicate, with response typing and coverage for both paths.
Release the implementation. The package version is updated from 2.44.0 to 2.45.0.

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

Re-trigger cubic

Comment thread resend/broadcasts/_broadcasts.py
@gabrielmfern
gabrielmfern marked this pull request as ready for review September 11, 2026 19:12
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