Skip to main content
For the exhaustive schema-derived catalog, see all examples.

What it is

Handle WhatsApp call termination, recording, and transcription events.

Before you begin

  • Create a public HTTPS endpoint in your application.
  • Configure a YCloud webhook endpoint for the event types you need.
  • Store the endpoint signing secret securely.
  • Make event processing idempotent.

How it works

YCloud sends an HTTP POST request when the event occurs. Verify the signature, durably record the event, return a 2xx response, and process slow work asynchronously.

Request

The scenarios below show requests delivered to your webhook URL. Treat the event id as the delivery identifier and use type to route the payload.

Response

Return a 2xx status after accepting the event.
For endpoint setup, signature validation, and retry behavior, see Configure webhooks.
Both the business or the WhatsApp user can terminate the call at any time. When either the business or the WhatsApp user terminates the call, you receive a Call Terminate webhook:

Call Completed

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Route the event by type, deduplicate it by id, and move slow or failure-prone work to an asynchronous processor.

Call Failed

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Route the event by type, deduplicate it by id, and move slow or failure-prone work to an asynchronous processor.

Call recording available

For an API-sourced call with recording enabled, whatsapp.call.recording.updated reports recording availability or permanent processing failure.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Use callingRecording.wacid to identify the call and phoneId to identify the business phone number. Download the mediaAssetId only when status is AVAILABLE. Recording processing is separate from the call-termination result. For FAILED, inspect error.code and error.retryable. See recordings and transcriptions.

Call transcription failed

For an API-sourced call with transcription enabled, whatsapp.call.transcription.updated reports transcription availability or permanent processing failure.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Read callingTranscription rather than callingRecording. In this example, status is FAILED and error.retryable is false. Do not attempt to download the failed asset. An AVAILABLE result uses mediaAssetId for download; the transcription result is separate from the recording result and call-termination status.