Create WhatsApp Callback Profiles using Dynamic Variables

You can create WhatsApp callback profile for receiving several possible WhatsApp status updates to any of your endpoint(s) from the Kaleyra platform.

For example, you can configure your callback profile to receive updates about message status, incoming message, message template status, payment status, and phone number quality update. While creating a callback profile for the WhatsApp channel, the Kaleyra platform provides a list of WhatsApp related events you can chose to receive updates for and for every events, the kaleyra platform provides a list of attributes you can receive as part of the updates. Such attributes, called “dynamic variables" can be selected as you like so to match the set of information you are interested in. The "dynamic variables" list serves as a ‘ready reckoner’ to add the callback variables without having to know the variable names. Whenever Kaleyra platform receives an update from Meta matching the events you have configured in your callaback profile, the value for the “dynamic variable” configured is fetched and sent to your endpoint.

For more information on how to use a callback profile in WhatsApp, see WhatsApp API V2 Configuration for Callback.

To create a callback profile for receiving updates about WhatsApp events, perform the following steps:

  1. Sign in to your Kaleyra platform.
  1. Navigate to the profile settings drop-down list and select the Callback Profiles option.
    The Callback Profiles page appears.
  1. On the Callback Profiles page, click Add New Profile.
    The New Callback Profile page appears.
  1. Perform the following steps to add all the relevant information in the Callback Details step:

    1. In the Title field, enter a name for the callback profile you are creating. This is a mandatory field.

    2. From the Select Channel API list, select the option whatsapp - WhatsApp Callbacks to create a callback profile to be used to receive back updated information about the WhatsApp events.

    3. After you select the option whatsapp - WhatsApp Callbacks’ in the previous step, the List of Events for the selected channel automatically appears.

    4. By default, all the events are selected. If you wish to deselect all, click the Deselect All. To deselect an individual event, click the check-box corresponding to the available options. You have the following options:

      • message_status - to get the WhatsApp callback for message status. For example, sent, delivered, read, and many more statuses.
      • incoming-message - to get the WhatsApp callback for incoming message carrying the actual text or media sent by the end-user to you.
      • payment_status - to get the WhatsApp callback for payment status.
      • message_template_status_update - to get the WhatsApp callback for message template status update.
      • phone_number_quality_update - to get the WhatsApp callback for phone number quality update.
    5. In the HTTP Method field, select a method for which the callback is created.
      The options listed are POST, GET, PUT, and DELETE. Only POST and GET methods are supported for the WhatsApp channel. Based on your selection for Method type, the relevant fields appear. For the POST method, you need to copy the dynamic variable and paste it in the Request Body (mentioned in this procedure). For the GET method, you need to copy the dynamic variable and paste it in next to the provided endpoint.

    6. In the Enter Endpoint field, enter the URL at which the callback information should be sent by Kaleyra platform.

    7. In the Dynamic Variables field, click View to view and select the dynamic variables for the selected events. The dynamic variables represent all the possible information that you can retrieve about the selected events as part of the callback. You may select all of them, or only the ones you are interested in.
      The List Dynamic Variables list appears.

    8. To select all the dynamic variables, click Select All or manually select the dynamic variables check-boxes that you want to receive in the callback sent from Kaleyra to your system.

    9. After selecting the variables, click Copy to Clipboard.

    10. Click ‘X’ (CLOSE) on the window to close the window.

    11. Using the mouse, right-click and paste the dynamic variables either in the Request Body field (POST method) or at the end of the Endpoint URL as query parameters (GET method).

    12. From the Retry drop-down, select the number of retries that Kaleyra Platform will perform in case the first callback receive a failure response or no response from your endpoint. You have the option for 0, 1, and 2. For assistance with more than two retry attempts, you can contact the Support team.

      📘

      Note:

      The following are the retries according to channels:

      • SMS - max 3 retries, 10s interval between retries.
      • WhatsApp - max 4 retries, 60s interval between retries.
      • Voice - max 4 retries, 60s interval between retries.
      • Email - max 4 retries, 60s interval between retries.

      For the Default priority, the Time Interval increases exponentially after each failed attempt. The formula for the delay: Delay = Initial Delay×(2^retry_count).

      If the initial delay is 60 seconds and we allow up to 2 retries:

      Retry AttemptDelay (in seconds)Cumulative Wait Time
      1st Try60×2^0=6060s
      1st Retry60×2^1=120180s
      2nd Retry60×2^2=240420s
    📘

    Note:

    Click Test to send a callback to your endpoint based on the configuration just set in the callback profile to see if the callback is working as expected. The confirmation message Callback profile tested appears in the bottom left of the screen.

  2. Click Next.
    The Advanced Configuration step appears.

  1. Perform the following:
    1. (Optional) From the Data Format drop-down, select one of the following options:
      • Form Data - To view the callback data through fields.
      • URL Encoded - To view the callback data in URL encoded format. The URL encoded data can be replaced using special characters and spaces in data with a format that can be transmitted over the internet using URLs.
      • JSON - To view the data in JSON format. JSON is a lightweight data format used to store and exchange data between a client (like a browser) and a server.
    2. (Optional) In the Header field, enter values as Key-Value pairs.
      Use the Header fields to include additional information on the HTTPS request generated by Kaleyra for your system.
      • Use the Headers field for authentication purposes. For example: API-KEY-based authentication or Basic authentication. For more information on basic authentication, see Basic Authentication.
      • Use the Headers field to indicate how the callback response should be presented using the “Content Type”.
    3. Click the Enable Encryption toggle button. The fields related to encryption are displayed. This is an optional field. The Algorithm, Key, Initialization Vector, and Parameters fields appear. To know more about these fields, see Callback Encryption.
  2. Click Save.
    The confirmation message appears and the callback gets listed to the Callback Profile page.


Did this page help you?



© 2026 Kaleyra Inc. All rights reserved.
Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.