Skip to content

feat: add broadcasts.cancel() method - #1059

Merged
dielduarte merged 1 commit into
preview-headless-dashboardfrom
broadcasts-cancel
Aug 10, 2026
Merged

feat: add broadcasts.cancel() method#1059
dielduarte merged 1 commit into
preview-headless-dashboardfrom
broadcasts-cancel

Conversation

@dielduarte

@dielduarte dielduarte commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds broadcasts.cancel(id), calling POST /broadcasts/:id/cancel to cancel a queued or scheduled broadcast.
  • Returns a validation_error/403 if the broadcast is draft, sent, or failed.
  • Mirrors emails.cancel()'s shape exactly (no body, no options param) since the underlying endpoint is the same kind of simple id-only action.

Companion API docs: resend/resend-docs#(branch broadcasts-cancel, based on main).

Test plan

  • pnpm typecheck — clean
  • lint (scoped to touched files — the full repo-wide lint script chokes on committed .next build artifacts under e2e/, unrelated to this change)
  • pnpm test — 28/28 passing in broadcasts.spec.ts (26 existing + 2 new: success case, 403 not-cancelable case)

🤖 Generated with Claude Code


Summary by cubic

Add broadcasts.cancel(id) to cancel queued or scheduled broadcasts via POST /broadcasts/:id/cancel, matching emails.cancel().

  • New Features
    • Cancels by ID with no body/options; returns validation_error (403) if the broadcast is draft, sent, or failed.
    • Adds CancelBroadcastResponse types and exports under src/broadcasts/interfaces.

Written for commit 0470001. Summary will update on new commits.

Review in cubic

Cancels a queued or scheduled broadcast via POST /broadcasts/:id/cancel.
Returns a validation_error/403 if the broadcast is draft, sent, or
failed. Mirrors emails.cancel()'s shape (no body, no options).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/resend@1059

commit: 0470001

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Adds a small, additive broadcasts.cancel() wrapper mirroring emails.cancel(), with types and passing tests for success and 403; no existing behavior or operational config changes, so no human-owned tradeoff remains.

Re-trigger cubic

@dielduarte
dielduarte marked this pull request as ready for review August 10, 2026 18:26
@dielduarte
dielduarte requested a review from a team as a code owner August 10, 2026 18:26
@dielduarte
dielduarte requested review from felipevolpone and removed request for a team August 10, 2026 18:26
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.

3 participants