Skip to content

Sync webhook types with the current API#147

Merged
mklocek merged 1 commit into
mainfrom
fix-webhook-types
Jul 24, 2026
Merged

Sync webhook types with the current API#147
mklocek merged 1 commit into
mainfrom
fix-webhook-types

Conversation

@mklocek

@mklocek mklocek commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Changes

Brings the SDK's webhook management types in line with the current Webhooks API (per the OpenAPI spec).

  • WebhookType — add the two missing members: campaigns and inbound_receiving (previously only email_sending and audit_log).
  • Add inbound_inbox_id to Webhook (number | null), CreateWebhookParams, and UpdateWebhookParams (number), used by inbound_receiving webhooks.
  • Update the update() doc comment, which no longer omitted inbound_inbox_id from the mutable fields.
  • Add a create() test covering an inbound_receiving webhook linked to an inbox.

SendingStream and WebhookEventType already matched the API and were left unchanged.

Add the missing `campaigns` and `inbound_receiving` webhook types and the `inbound_inbox_id` field to the Webhook, create, and update types so the SDK matches the Webhooks API. Update the mutable-fields note and add coverage for creating an inbound_receiving webhook.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Webhook types now support campaigns and inbound_receiving, with optional inbox associations in webhook models and parameters. Tests cover creating an inbound receiving webhook, and update documentation marks the inbox association immutable.

Changes

Webhook contract and creation support

Layer / File(s) Summary
Webhook type and payload contracts
src/types/api/webhooks.ts
WebhookType adds campaigns and inbound_receiving; webhook models and parameters add optional inbound_inbox_id fields.
Inbound webhook creation coverage
src/__tests__/lib/api/resources/Webhooks.test.ts, src/lib/api/resources/Webhooks.ts
Tests validate inbound webhook creation requests and responses, while update documentation identifies inbound_inbox_id as immutable.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: igordobryn

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly reflects the main change: aligning webhook types with the current API.
Description check ✅ Passed The description covers the main changes well, but it omits the template's Motivation, How to test, and Images/GIFs sections.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mklocek
mklocek merged commit a66d0cc into main Jul 24, 2026
4 checks passed
@mklocek
mklocek deleted the fix-webhook-types branch July 24, 2026 07:00
@mklocek mklocek mentioned this pull request Jul 24, 2026
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