Preview of the URL

POST Method


When you send a link in the message, the Preview URL parameter will display the preview of the landing page associated with that link. You have to add the preview_url parameter and set the value as True in the request.



The preview of the URL is only supported for the non-template type (text) of messages.

To display the preview

1. Signup or Login to and create your API key.

Refer to the Create an API Key page for steps to create your API key.



After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in

2. API Call

Execute the following API command to include the preview of the URL in a message.

curl --location --request POST '<SID>/messages'
--H 'Content-Type: <CONTENT_TYPE>'
--H 'api-key: <API_KEY>'
--f 'to=<TO_NUMBER>'
--f 'type=<MESSAGE_TYPE>'
--f 'body=<CONTENT>'
--f 'preview_url=true'
--f 'channel=<CHANNEL_NAME>'
--f 'from=<FROM_NUMBER>'
--f 'callback_url=<CALLBACK_URL>'
--f 'lang_code=en'

Ensure to replace the parameter values with the proper inputs in the above code. The below table has a list of parameters and their information.

SIDAccount SID (Security Identifier)HXXXXXXX071USTrue
CONTENT_TYPEIndicates the format of the content the API will be processing.application/jsonTrue
API_KEYYour API Key generated by
TO_NUMBERA valid WhatsApp number of the recipient. Ensure that the country code is prefixed to the number. (E164 format).

Note: You can add multiple recipients, separate each number using the comma (,) delimiter.
MESSAGE_TYPEMessage format for the message.textTrue
CONTENTContent of the message. You must include the link of the web page here.Hi, Your order has been shipped.True
PREVIEW_URLThe URL you want to include in the message
CHANNEL_NAMEChannel on which message must be sent.WhatsAppTrue
FROM_NUMBERThe number registered with WhatsApp business from which the message is to be sent. Ensure that the country code is prefixed to the number. (E164 format).+1202XXXXXXXTrue
CALLBACK_URLThe URL that should send information to when your number receives a response. This URL can be accessed publicly.

3. Below is the success response format

    "id": "bae798f8-4ad5-4e9d-a60f-6ce60a347d89",
    "type": "text",
    "body": "",
    "createdDateTime": "2020-10-12 10:40:32+00:00",
    "totalCount": 1,
    "data": [
            "message_id": "bae798f8-4ad5-4e9d-a60f-6ce60a347d89:0",
            "recipient": "91xxxxxxxxxx"
    "error": {}



In case of error, ensure that the above replaceable values are correct. See Standard Error Codes

Did this page help you?