# Send a Custom reference ID in the WhatsApp Send Message API and receive it in webhook data.

To pass a custom reference ID in the WhatsApp Send Message API and retrieve it via webhooks, follow this step-by-step guide based on the video content.​

### Setting Up the API and Webhook

* Set up your WhatsApp API according to the documentation and ensure you have a template message approved.
* Configure a webhook endpoint (such as using a webhook site URL) to receive status updates—like sent, delivered, read, or failed notifications—from WhatsApp.​

### Modifying the Template Message Body

* When preparing the message payload, add your custom reference ID using the parameter bis\_opaque\_callback\_data.
* Insert this parameter just above the last curly bracket in your JSON request body.
* For example, if using sample JSON from the documentation, add a comma and then the bis\_opaque\_callback\_data parameter immediately before the final closing brace.​
* The value for bis\_opaque\_callback\_data can be up to 200 characters in length, allowing you to set a unique reference ID for tracking the message.​

### Sending the Message

* Send the message via the API; you’ll receive a Queue ID in the response that confirms the message has been queued for sending.
* The webhook will then receive updates for this message under the configured endpoint, including detailed status information.​

### Retrieving the Reference ID in Webhooks

* Each status update (sent, delivered, read, failed, etc.) sent to your webhook will include both the WhatsApp message ID and your supplied bis\_opaque\_callback\_data as part of the payload.
* This allows you to track messages end-to-end using your custom reference ID, making integration with CRMs and other systems straightforward.​

### Important Points

* The bis\_opaque\_callback\_data parameter name is fixed by Meta (WhatsApp) and cannot be changed.
* You can use this for passing any variable data, such as customer IDs or campaign IDs, for later correlation.
* All message statuses (success and failure) will propagate this reference ID to your webhook, ensuring reliable tracking.​

This method streamlines tracking custom references for WhatsApp messaging automation and CRM integration.​<br>

```
Remember to Add Comma above this for a valid json.

"biz_opaque_callback_data": "my+own+reference+id-123456"

```

{% embed url="<https://www.youtube.com/watch?v=ZGqWZrCQ8ds>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpdocumentation.gitbook.io/user/messaging-channels/whatsapp-api/managing-your-whatsapp-api/send-a-custom-reference-id-in-the-whatsapp-send-message-api-and-receive-it-in-webhook-data..md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
