feat: add broadcasts.cancel() method

Merged
DI
2mo ago
+91-0

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.