Callback Request using Callback Profiles

Before proceeding with the Callback Profiles option, you need to have a callback profile created. For more information on how to create callback profiles, see the Callback Profiles page.

The callback profile contains all the information needed for our system to send back information to your system. Example: Callback URL, HTTP method, headers, and so on.



  • The Callback profiles option also supports static authentication based on username and password, API KEY, or any other method that does not require dynamic fields.
  • If your callback URL requires authentication, you need to add all the needed headers and related values to your callback profiles.
  • will automatically retrieve this information when generating the HTTP call to your callback URL.

Base URL





To know all the callback profile IDs, go to Accounts Settings > Callback Profiles page. You can filter the callback profiles on the listing page with Callback Profile Name, HTTP Method, and Created Date range for accurate results.

Request Format

curl --location --request POST '<SID>/messages' \
--header 'api-key: <API_KEY>' \
--header 'Content-Type: <CONTENT_TYPE>' \
--data-urlencode 'body=<BODY_CONTENT>' \
--data-urlencode 'to=<TO_NUMBER>' \
--data-urlencode 'type=<CONTENT_TYPE>' \
--data-urlencode 'sender=<SENDER>' \
--data-urlencode 'template_id=<TEMPLATE_ID>' \
--data-urlencode 'callback_profile_id=<CALLBACK_PROFILE_ID>'

Sample Request Format

curl --location --request POST '' \
--header 'api-key: Aaf0dff8cd58cf99cba958f8941d30XXX' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'body=Your Kaleyra OTP is 5556. This is valid for 5 minutes.' \
--data-urlencode 'to=+18830907XXX' \
--data-urlencode 'type=TXN' \
--data-urlencode 'sender=KLRHXA' \
--data-urlencode 'template_id=1107160129068911XXX' \
--data-urlencode 'callback_profile_id=IN_09b3dfa7-e05d-4d84-ab2d-6ed654272XXX'

Parameters and Data Types

Following is the list of parameters and data types supported and the attributes that could be added to the API call when requesting the Callback Profile ID:

ParameterData TypeDescriptionExample/Numeric FormatMandatory (Yes /No)
<SID>StringAccount SID (Security Identifier)HXIN169510844XXXYes
<API_KEY>StringAPI Key generated by Kaleyra.ioAaf0dff8cd58cf99cba958f8941d3XXX0Yes
<CONTENT_TYPE>StringThe format in which the data is sent.application/x-www-form-urlencodedYes
<BODY>StringMessage contents that need to be sent.Your Kaleyra OTP is 5556. This is valid for 5 minutes.Yes
<TO_NUMBER>StringRecipient's MSISDN in E.164 format.+18830907XXXYes
<TYPE>StringRoute typeTXNYes
<SENDER>StringOriginator/Alphanumeric ID (default KLRHXA)KLRHXAYes
<TEMPLATE_ID>IntegerUnique ID of the template (Only for Indian Customers)1107160129068911XXXYes
<CALLBACK_PROFILE_ID>StringUnique callback profile ID is set for each account for a callback. For more information related to callback profiles, see callback profiles page.IN_09b3dfa7-e05d-4d84-ab2d-6ed654272XXXNo
<MESSAGE_ID>StringUnique ID for each message. Basically, this message ID helps you to identify each message.ebcccXXf-6311-4c52-b23d-afeXXX5fcXXX:1Optional
<SOURCE>StringThe source will be an API or Plugin for identifying from where the API is called.APIOptional
(used in the callback call send from kaleyra)
StringThe following are the status used:
(used in the callback call send from kaleyra)
StringStatus trace of the message.REJECTED-MULTIPARTOptional
(used in the callback call send from kaleyra)
StringDescription of the delivery Status.No sender ID is allocatedOptional

Response Format

This section provides you with the JSON format that will be sent to your system in the Callback call.

Sample Callback Body (in case of POST method is selected for Callback)

  "sender": "TEST",
  "recipient": "919620838XXX",
  "type": "DEFAULT",
  "flash": 0,
  "total": 1,
  "source": "API",
  "price": "0.001354",
  "iso_code": "IN",
  "message_id": "ebcccXXf-6311-4c52-b23d-afeXXX5fc336:1",
  "country_name": "India",
  "campaign_name": "",
  "length": 5,
  "units": 1,
  "sent_time": "2022-04-05 09:55:50",
  "status_time": "2022-04-05 08:55:50+00:00",
  "status_trace": "REJECTED-MULTIPART",
  "status": "Undelivered",
  "description": "Validation fail [SMS over 160 characters]",
  "id": "ebccc6ff-6311-4XXc-b23d-afe6fXXXXXf6",
  "ref": "",
  "ref1": "",
  "ref2": ""

Sample Callback (in case of GET method is selected for Callback) Rejected as the number is blacklisted by operator.&id=84352649-f610-4fd7-b7de-c163be9b1XXX&ref=&ref1=&ref2=

HTTP Status Code and Response Code

For more information regarding the HTTP Status Codes and Response Codes, see SMS Error Codes.