Skip to content

feat(webhooks): add support for topic and contact.topics.updated events - #291

Merged
joaopcm merged 3 commits into
mainfrom
feature/dev-2239-python-sdk-internal-squad-devtools
Sep 29, 2026
Merged

joaopcm merged 3 commits into
mainfrom
feature/dev-2239-python-sdk-internal-squad-devtools

Conversation

@joaopcm

@joaopcm joaopcm commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

the API accepts contact.topics.updated, topic.created, topic.updated and topic.deleted as webhook events, and they're live with no feature flag (the monorepo has sent them since at least 60ac6d5dbf, 2026-02-12). resend.Webhooks doesn't list them and WebhookEventPayload has no types for them.

this adds them to the event list in _webhook.py, adds ContactTopicsEventData, ContactTopicSubscription, TopicEventData, ContactTopicsUpdatedEvent, TopicCreatedEvent, TopicUpdatedEvent and TopicDeletedEvent, and exports them. topics items are a new ContactTopicSubscription, with subscription typed as Literal["opt_in", "opt_out"].

payloads, from topic-events-webhook.ts and contact-events-webhook.ts in the monorepo:

  • contact.topics.updated: email, and topics, the topics changed in that update, each with its new subscription (opt_in or opt_out)
  • topic.created, topic.updated, topic.deleted: id, name, description (string or null), default_subscription (opt_in or opt_out), deleted, created_at, updated_at

bumps to 2.49.0.

flake8 and pytest (699 passed) pass. mypy has 2 errors, both Unused "type: ignore" in tests/exceptions_test.py:136,139, and main has the same 2.

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

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

Re-trigger cubic

Comment thread resend/webhooks/_webhook_event.py Outdated
Comment thread resend/webhooks/_webhook.py
@joaopcm joaopcm self-assigned this Sep 29, 2026
@joaopcm
joaopcm requested a review from dielduarte September 29, 2026 17:27
@joaopcm
joaopcm marked this pull request as ready for review September 29, 2026 17:28

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

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.

Auto-approved: Adds TypedDicts, event-list entries, exports, and a version bump for four webhook events the API already emits. This is an additive, non-breaking SDK typing change; remaining risk is ordinary typing correctness already covered by Cubic's review.

Re-trigger cubic

@joaopcm
joaopcm merged commit eac30ca into main Sep 29, 2026
32 checks passed
@joaopcm
joaopcm deleted the feature/dev-2239-python-sdk-internal-squad-devtools branch September 29, 2026 18:51
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