Fix missing organization_domain events in webhook defs#471
Fix missing organization_domain events in webhook defs#471nicknisi merged 1 commit intoworkos:mainfrom
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR fixes a critical gap in the webhook event handling system by adding support for three missing organization domain webhook events: organization_domain.created, organization_domain.updated, and organization_domain.deleted.
The changes follow the established webhook pattern in the codebase where each webhook event type gets its own class that extends WebhookModel with the appropriate payload type (OrganizationDomain in this case). Each class uses a Literal type annotation to specify its exact event name, enabling Pydantic's discriminated union deserialization based on the event field.
Previously, the webhook system only supported organization_domain.verified and organization_domain.verification_failed events, but was missing the basic CRUD operations. This meant any attempt to deserialize webhooks for domain creation, updates, or deletion would fail at runtime. The fix adds the three missing webhook classes (OrganizationDomainCreatedWebhook, OrganizationDomainUpdatedWebhook, OrganizationDomainDeletedWebhook) and includes them in the main Webhook union type to enable proper deserialization.
The PR also includes minor import reorganization, grouping related imports together with blank lines between sections for better readability. This change integrates seamlessly with the existing webhook infrastructure and follows the exact same patterns used for other webhook event types throughout the codebase.
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it follows established patterns exactly
- Score reflects simple, well-structured additions that match existing code patterns perfectly
- No files require special attention - the changes are straightforward and follow existing conventions
1 file reviewed, no comments
Description
The webhook event organization_domain.created fails to deserialize
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.