Create Email Callback Profiles with Dynamic Variables

You can create an Email callback profile within the Kaleyra.io user interface to get information about the Email delivery status. The wizard to set up the callback profile for the Email channel provides a list of dynamic variables specific to the Email channel that you can individually select to get the latest information about your email message that you are interested in.
After successfully creating an Email callback profile, you must use the ‘callback profile ID’ parameter in an Email API request (POST) to fetch the Email delivery information in an endpoint that you specify.

📘

Note:

  • If you have more than one Callback Profile created for different channels, make sure you add the correct callback profile Id in the Email API requests.
  • A callback profile created for the Email channel cannot be used for other channel API requests.
  • Once a callback profile is created for the Email channel, you can only edit the list of dynamic variables you want to receive in the callback from Kaleyra or delete the profile.

To create an Email callback profile:

  1. On the profile settings drop-down list, select the Callback Profiles option.

The Callback Profiles page appears.

  1. On the Callback Profiles page, click Add New.
    The Add Callback Profile window appears.
  1. Perform the following steps to add all the relevant information in the ‘Add callback profile’ page.
    1. In the Title field, enter a title for the callback profile. This is a mandatory field.

    2. From the Select Channel API list, select the option ‘email - Email Gateway APIs’ to create a callback profile to be used to receive back updated information about the email status.

    3. Once you select the option ‘email - Email Gateway APIs’ in the previous step, the Events for the selected channel field is automatically set to the option ‘email-send’.

    4. In the HTTP Method field, select a method for which the callback is created.
      The options are: POST, GET, PUT, and DELETE.

      📘

      Note:

      Only the POST method supports the use of dynamic variables for the Email channel.

    5. In the Enter Endpoint field, enter the URL at which the callback information should be received.

    6. In the Dynamic Variables field, click View to view and select the dynamic variables for the selected channel. The dynamic variables represent all the possible information that you can retrieve about the email as part of the callback that kaleyra.io will send to your system. You may select all of them, or only the fields you are interested in.
      The List Dynamic Variables window appears.

In the List Dynamic Variables window,

  • 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.
  • After selecting the variables, click Copy to Clipboard.
  • Click ‘X’ (CLOSE) on the window to close the window.
  • For POST method, using the mouse, right click and paste the dynamic variables in the Request Body field.
  1. From the Retry drop-down, select the number of retries that Kaleyra Platform will perform in case the first callback receives a failure response or no response from your endpoint. You have the option for 0, 1, and 2. If you select either 1 or 2 retries, then you must enter the Time Interval in secs and the Timeout in milli-secs values. 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.

  1. 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 UEL 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. 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.


The following table shows the field descriptions on the Add Callback profile window.

ColumnDescriptionExample
TitleThe name of the Email callback profile.
You can use the callback title for searching the callback profiles.
email_callback_profile
Selected Channel APIThe channel for which the callback profile is created.email - Email Gateway APIs
Events for the selected channelThe events of the selected channel for which the callback information is obtained.
The relevant information for the selected event will be received using the callback.
Email Send
HTTP MethodThis section provides the options to select the HTTP methods for the Email channel APIs \-
Select MethodOnly the POST method is supported.
Note: .The dynamic variables get added in the body of the JSON request for the POST method.
POST
Enter endpointThis is the URL to which the callback data is returned.<https://webhook.site/xxxxdcb3-a524-47e9-8eac-ef4cee045635>
Dynamic variablesAll the relevant dynamic variables for the Email channel are listed here.
You can select the dynamic variables for which you want to receive the values through the callback.
Note: See the table below for dynamic variables descriptions
"delivery_status": "<delivery_status>" "from_mail": "<from_mail>"

Enable form data or urlencoded Headers

Form data
URLencoded
Headers (Optional)

The header information should be given as a key-value pair.
Form data headers are used for complex data while submitting forms with file uploads.
URL Encoded headers are used for simpler text in HTTP requests with the data encoded in key-value pairs.
Note:
Use these fields to add any additional HTTP headers and related values you want to receive in the callback.
Use Headers for authentication purposes or to indicate how the callback response should be presented using the content_type.
api-key:xxxx51f2c0ac28bb395016083d40axxxx
Enable EncryptionThis toggle button is to enable encryption for the callback information. When this option is enabled, the callback data is encrypted. Use this feature to secure the callback data.For information on encryption algorithm and the related fields for this feature, see:
Callback Profiles page.
Enable Callback Required OptionThis option is not applicable to the Email channel.NA

The following table shows the dynamic variables for Email channel and their descriptions with examples.

ColumnDescriptionExample
message_idThe unique identification number of the email.64702e3a-7596-47a1-bc50-fa4bbf9b0f9d:1
delivery_status.The delivery status of the email sent.
(see below for the full list of possible statuses).
Bounce
from_mailThe from address of the email.[email protected]
recipient_mailThe recipient's address for the email.[email protected]
delivery_timeThe time at which the email is delivered.2023-09-29T11:23:35.586Z
error_codeThe error code in case of an error in the email delivery.

550

Note: This error code is different from the error codes that Kaleyra assigns to the API request errors that are shown in the API Response.

error_statusThe error status in case of an error.5.1.1.
error_messageThe error message of the error that occurred during the email delivery.550 5.1.1 The email account that you tried to reach does not exist.

Email delivery statuses

The following table shows the Email delivery statuses and their descriptions.

StatusDescription
BlockedAn email request is marked as 'blocked' by Kaleyra for the reasons such as, the usage of unapproved templates, too many mails to a specific mail id in a short span of time.
BounceAn email delivery status is ‘bounce’ when the recipient address is incorrect.
DeferredWhen an email bounces not because of an incorrect recipient address but for other reasons, such as the recipient’s inbox is full, the email status is ‘deferred’.
DeliveredWhen an email is delivered to the recipient.
AcceptedWhen an email is accepted by Kaleyra and it is in processing.
FailedAn email is marked as ‘failed’ due to insufficient balance or an internal error.
OpenWhen an email is opened by the recipient.
SuppressedIf the recipient address is in the suppression list, then for that recipient email delivery status is ‘suppressed’.


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.