Fire a named webhook event type for a test case.
POST/test/webhooks/fire
Fires a real current-state webhook event for any registered Customer API event type against a test case — even if the case hasn't naturally reached the state that would produce that event.
Purpose:
Unblocks testing webhook handlers for rare or hard-to-reach event types (e.g. case.closed, chat.created) without having to drive the case through its full lifecycle.
Payload: The event carries the real current state of the case — fields are read from the case as it exists now. No payload fabrication or override is supported in this version.
Event types:
case.created— current lifecycle (use after case creation, or to re-test your handler)case.updated— current lifecycle (oldLifecycle and newLifecycle both reflect current state)case.closed— current close code and comment (use after case is already closed, or to test your handler regardless)payment.created— most recent payment on the case (returns 422 if no payments exist)chat.created— most recent chat message on the case (returns 422 if no chats exist)
Target subscriptions:
- If
subscriptionIdis provided, fires only to that subscription. Returns 400 if the subscription is not found, not a test subscription, or not owned by this creditor. - If omitted, fires to all active test subscriptions registered for the given event type.
Event log (asynchronous):
The synthetic fire is enqueued into the normal delivery pipeline, exactly like a real dispatch. A successful response (and its enqueuedCount) confirms the event was queued — it does not mean a row already exists in the webhook event log. The WebhookEvent row appears in GET /webhooks/events only after the worker drains the queue and attempts delivery — usually within a few seconds, but allow up to ~30 seconds, as the queue drain can lag under load. Do not assume the row is present the instant this call returns: poll GET /webhooks/events?caseId={id} with a short backoff until the event appears (or a ~30s timeout elapses) rather than reading it once immediately.
Guards:
- Returns 400 if the case is not a test case (
classification != test), the event type is not valid, or the subscription is not found/not owned. - Returns 404 if the case is not found or not owned by this creditor.
- Returns 422 if required data is missing (e.g. no payments for
payment.created, no chats forchat.created).
Request
Responses
- 200
- 400
- 404
- 422
- 500
Event fired — delivery jobs enqueued
Validation error — non-test case, invalid event type, or subscription not found
Case not found or not owned by this creditor
Required data missing (e.g. no payments for payment.created)
Internal server error