feat(webhooks): add event replay endpoint - #274
Conversation
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
There was a problem hiding this comment.
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 a public POST endpoint that triggers an additional webhook delivery. Human review is needed for the product and operational implications of replay semantics and its external API contract.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
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 a new public POST endpoint that queues an additional webhook delivery. Human review is needed for the product and operational semantics of replay and the new external API contract.
Re-trigger cubic
Adds
POST /webhooks/{webhook_id}/events/{event_id}/replay(webhooks/replay-event), which queues one more delivery of a webhook event to its webhook. Placed next toget_event/get_event_async, same argument style.ReplayEventResponseis{ object: "webhook_event", id: str }.Also adds a replay call to
examples/webhooks.py.Spec PR: resend/resend-openapi#112
API PR: https://github.com/resend/resend-monorepo/pull/9535
Docs page: https://resend.com/docs/api-reference/webhooks/replay-event
Tests
The
ResendBaseTestfixture mocksRequest.make_request(url), which hides the verb, and the verb is the only thing separatingreplay_eventfromget_event. The tests therefore swapresend.default_http_client/resend.default_async_http_clientfor a mock client and assertmethod == "post"plus the exact URL, the same shape asTestSuppressionsRequestBody. The setUp/tearDown is copied rather than lifted intoconftest.pyon purpose: this is the second copy per mode, not the third.Checks
tox -e lint(flake8): passedtox -e mypy: passed, no issues in 181 filestox -e py(pytest): 626 passedNot verified live
No call was made against the API (write endpoint, no key configured for this task). The tests pin the verb and path; the only remaining assumption is the response body shape, which is pinned by the spec (
ReplayWebhookEventResponse).No version bump; that happens in a separate chore PR.
Part of DEV-2005.
Linear: https://linear.app/resend/issue/DEV-2012