SENDO WhatsApp API
Send WhatsApp messages to your clients.
Send Message with template
This endpoint is used to send WhatsApp messages to a specific destination using a template.
Required attributes
| Field | Type | Description | Default Value | Optional | Example |
|---|---|---|---|---|---|
| templateName | string | The name of the template to use for the message. | none | No | template-name |
| senderNumber | string | The phone number of the sender. | none | No | +1234567890 |
| recipientNumber | string | The phone number of the receiver. | none | No | +1234567890 |
| variables | object | An object that contains variables to be inserted into the body of the message. | none | No | { "name": "John Doe", "age": 30, "city": "New York" } |
Request body.
curl --location 'https:/api.sendo.cloud/api/whatsapp/send-message'
--header 'apikey: API-KEY'
--header 'Content-Type: application/json'
--data-raw '{"templateName": "url_button_test","senderNumber": "593967793436","recipientNumber": "+50584533001","variables": {"nombre":"Jasson"}}'
| Code | Description |
|---|---|
| 200 | Successful |
{
"status": {
"messageId": "68c9802d-1910-4dba-9048-4a6c98787a0e",
"message": "Message received"
}
}
Server responses.
Send Message without template
This endpoint is used to send WhatsApp messages to a specific destination without a template.
NOTE: You may call this endpoint only once the user has engaged with your business, either by sending a message to your number or by replying to a message that was delivered through a template.
| Field | Type | Description | Default Value | Optional | Comments | Example |
|---|---|---|---|---|---|---|
| senderNumber | string | The phone number of the sender. | none | No | 1234567890 | |
| recipientNumber | string | The phone number of the receiver. | none | No | +1234567890 | |
| type | string | Type of Messages such as text, video, imagen or document | none | No | text |
NOTE: See table below to know more about the types of messages.
Interaction Types
| Field | Type | Description | Default Value | Optional | Comments | Example |
|---|---|---|---|---|---|---|
| body | string | The text of the message. | none | No | Hello world | |
| preview_url | boolean | The phone number of the receiver. | none | Yes | true |
curl --location 'https:/api.sendo.cloud/api/whatsapp/send-message' --header 'apikey: API-KEY' --header 'Content-Type: application/json' --data-raw '{"senderNumber": "593967793436","recipientNumber": "+50584533001","type": "text","text": {"body":"This is an example message"}}'
| Code | Description |
|---|---|
| 200 | Successful |
{
"status": {
"messageId": "68c9802d-1910-4dba-9048-4a6c98787a0e",
"message": "Message received"
}
}
Server responses.
| Field | Type | Description | Default Value | Optional | Comments | Example |
|---|---|---|---|---|---|---|
| link | string | Link of the image. | none | No | https://www.sendo.cloud/images/logo.png | |
| caption | string | Caption of the image. | none | Yes | This is an example image |
NOTE: Watch this table for supported images for META.
curl --location 'https:/api.sendo.cloud/api/whatsapp/send-message' --header 'apikey: API-KEY' --header 'Content-Type: application/json' --data-raw '{"senderNumber": "593967793436","recipientNumber": "+50584533001","type": "image","image": {"link":"https://www.sendo.cloud/images/logo.png","caption":"This is an example image"}}'
| Code | Description |
|---|---|
| 200 | Successful |
{
"status": {
"messageId": "68c9802d-1910-4dba-9048-4a6c98787a0e",
"message": "Message received"
}
}
| Field | Type | Description | Default Value | Optional | Comments | Example |
|---|---|---|---|---|---|---|
| link | string | Link of the video. | none | No | https://www.sendo.cloud/images/test.mp4 | |
| caption | string | Caption of the video. | none | Yes | This is an example video |
NOTE: Watch this table for supported images for META.
curl --location 'https:/api.sendo.cloud/api/whatsapp/send-message' --header 'apikey: API-KEY' --header 'Content-Type: application/json' --data-raw '{"senderNumber": "593967793436","recipientNumber": "+50584533001","type": "video","video": {"link":"https://www.sendo.cloud/images/test.mp4","caption":"This is an example video"}}'
| Code | Description |
|---|---|
| 200 | Successful |
{
"status": {
"messageId": "68c9802d-1910-4dba-9048-4a6c98787a0e",
"message": "Message received"
}
}
| Field | Type | Description | Default Value | Optional | Comments | Example |
|---|---|---|---|---|---|---|
| link | string | Link of the document. | none | No | https://www.sendo.cloud/images/test_document.pdf | |
| filename | string | Filename of the document. | none | No | test_document.pdf | |
| caption | string | Caption of the document. | none | Yes | This is an example document |
NOTE: Watch this table for supported images for META.
curl --location 'https:/api.sendo.cloud/api/whatsapp/send-message' --header 'apikey: API-KEY' --header 'Content-Type: application/json' --data-raw '{"senderNumber": "593967793436","recipientNumber": "+50584533001","type": "document","document": {"link":"https://www.sendo.cloud/images/test_document.pdf","filename":"test_document.pdf","caption":"This is an example document"}}'
| Code | Description |
|---|---|
| 200 | Successful |
{
"status": {
"messageId": "68c9802d-1910-4dba-9048-4a6c98787a0e",
"message": "Message received"
}
}
| Field | Type | Description | Default Value | Optional | Comments | Example |
|---|---|---|---|---|---|---|
| link | string | Link of the audio. | none | No | https://www.sendo.cloud/images/test_audio.mp4 |
NOTE: Watch this table for supported images for META.
curl --location 'https:/api.sendo.cloud/api/whatsapp/send-message' \
--header 'apikey: API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"senderNumber": "593967793436","recipientNumber": "+50584533001","type": "audio","audio": {"link":"https://www.sendo.cloud/images/test_audio.mp4"}}'
| Code | Description |
|---|---|
| 200 | Successful |
{
"status": {
"messageId": "68c9802d-1910-4dba-9048-4a6c98787a0e",
"message": "Message received"
}
}
Download Whatsapp Media File
This endpoint is used to download a file send by the user.
NOTE: This endpoint delivers the file via streaming, so the response is a stream of bytes.
| Field | Type | Description | Default Value | Optional | Comments | Example |
|---|---|---|---|---|---|---|
| FILE_ID | string | The id of the file given by META WhatsApp | none | No | 1234567890 |
| Code | Description |
|---|---|
| 200 | Successful |
File is sent via streaming
Server responses.
Webhook
Callback
Webhooks allow you to receive real-time HTTP notifications about events in the Sendo Platform, such as event notifications or messages from customers.
Required Fields
| Field | Type | Description | Example |
|---|---|---|---|
| message_id | string | Internal message ID provided by Sendo | 8fe793e2-3a5e-452e-a92a-363666248098 |
| waba_id | string | WhatsApp business account ID generated by Meta | 432857389903424 |
| value | object | Event metadata enriched by Meta, See Value Definition | |
| field | string | Indicates the type of Event that has been requested. | messages |
Request Body
Example Response : Status Event Update
{
"message_id": "8fe793e2-3a5e-452e-a92a-363666248098",
"waba_id": "432857389903424",
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "593967793436",
"phone_number_id": "401156743081691"
},
"statuses": [
{
"id": "wamid.HBgLNTA1ODY3MjA3NzUVAgARGBIzM0U2M0VFNEM2Njc5ODU1ODEA",
"status": "sent",
"timestamp": "1737575163",
"recipient_id": "50586720775",
"conversation": {
"id": "634fb63c5b96fa266692ca32f5494304",
"expiration_timestamp": "1737661620",
"origin": {
"type": "marketing"
}
}
}
]
},
"field": "messages"
}
Example 2 Response : Text sent by customer as reply
{
"message_id": "8fe793e2-3a5e-452e-a92a-363666248098",
"waba_id": "432857389903424",
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "593967793436",
"phone_number_id": "401156743081691"
},
"contacts": [
{
"profile": {
"name": "Jorge Argeñal"
},
"wa_id": "50586720775"
}
],
"messages": [
{
"from": "50586720775",
"id": "wamid.HBgLNTA1ODY3MjA3NzUVAgASGBQzQTREQTFCRTU1MkFBOTIxMjlCMQA=",
"timestamp": "1737575679",
"text": {
"body": "Si acepto"
},
"type": "text"
}
]
},
"field": "messages"
}
Example 3 Response : Video sent by customer as reply
{
"message_id": "8fe793e2-3a5e-452e-a92a-363666248098",
"waba_id": "432857389903424",
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "593967793436",
"phone_number_id": "401156743081691"
},
"contacts": [
{
"profile": {
"name": "Jorge Argeñal"
},
"wa_id": "50586720775"
}
],
"messages": [
{
"from": "50586720775",
"id": "wamid.HBgLNTA1ODY3MjA3NzUVAgASGBQzQTYxMDgxMTk1MUJBNkQ3MTkxQQA=",
"timestamp": "1738183832",
"type": "video",
"video": {
"caption": "Hola",
"mime_type": "video/mp4",
"sha256": "8D96O65u2ZpA+OQBdw1PvKQOH0dSDNtXENfnue8z8DM=",
"id": "1804954366989548"
}
}
]
},
"field": "messages"
}
Example 4 Response : Image sent by customer as reply
{
"message_id": "8fe793e2-3a5e-452e-a92a-363666248098",
"waba_id": "432857389903424",
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "593967793436",
"phone_number_id": "401156743081691"
},
"contacts": [
{
"profile": {
"name": "Jorge Argeñal"
},
"wa_id": "50586720775"
}
],
"messages": [
{
"from": "50586720775",
"id": "wamid.HBgLNTA1ODY3MjA3NzUVAgASGBQzQUQyQURFMDI1OUEzRDlCQzQ3RAA=",
"timestamp": "1738183940",
"type": "image",
"image": {
"caption": "Hola",
"mime_type": "image/jpeg",
"sha256": "jVIbmT753LbDCN5/msrHSOE2DKEPbwfvltygDNRTdpo=",
"id": "957620909803014"
}
}
]
},
"field": "messages"
}
Example 5 Response : Document sent by customer as reply
{
"message_id": "8fe793e2-3a5e-452e-a92a-363666248098",
"waba_id": "432857389903424",
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "593967793436",
"phone_number_id": "401156743081691"
},
"contacts": [
{
"profile": {
"name": "Jorge Argeñal"
},
"wa_id": "50586720775"
}
],
"messages": [
{
"from": "50586720775",
"id": "wamid.HBgLNTA1ODY3MjA3NzUVAgASGBQzQTk0ODlBNzQ4M0U4NzdBMDE5RgA=",
"timestamp": "1738184020",
"type": "document",
"document": {
"caption": "Hola",
"filename": "01_BTS_Sendo_v1.0-2.docx",
"mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"sha256": "pX/nG5rjWwc+FY7vZSCmJGbkyXpVTW+/IPNL+1jZRMk=",
"id": "2143224972803342"
}
}
]
},
"field": "messages"
}
Callback Response
The webhook expects an HTTP code response which might be:
| Code | Description |
|---|---|
| 200 | Successful with return data |
| 201 | Successful with no return data |
| 204 | Successful with no return data |
Attribute Definitions
Value
| Field | Type | Description | Example |
|---|---|---|---|
| messaging_product | string | Type of product or service in Meta | |
| metadata | object | Object containing sender details. | |
| contacts | object | Object containing destination details | |
| statuses | object | Object containing message event details, including sent, delivered, read, and other statuses. See Statuses Definition | |
| messages | object | Object containing message attributes. See Messages Definition |
Statuses
| Field | Type | Description |
|---|---|---|
| id | string | WhatsApp message ID provided by Meta |
| status | string | Status event |
| timestamp | string | Date and time when the event occurred. |
| recipient_id | string | Customer phone number |
| conversation | object | Object containing conversation details |
Messages
| Field | Type | Description |
|---|---|---|
| id | string | WhatsApp message ID provided by Meta |
| timestamp | string | Date and time when the event occurred. |
| from | string | Customer phone number |
| text | object | Object containing text details. |
| video | object | Object containing video details. |
| image | object | Object containing image details |
| document | object | Object containing document details. |
| type | string | Type of Messages such as text, video, image or document |
META Support Media Types
Image
| Image Type | Extension | MIME Type | Max Size |
|---|---|---|---|
| JPEG | .jpg | image/jpeg | 5MB |
| PNG | .png | image/png | 5MB |
Video
NOTE: Only H.264 video codec and AAC audio codec supported. Single audio stream or no audio stream only.
| Video Type | Extension | MIME Type | Max Size |
|---|---|---|---|
| 3GPP | .3gp | video/3gpp | 16MB |
| MP4 Video | .mp4 | video/mp4 | 16MB |
Document
| Document Type | Extension | MIME Type | Max Size |
|---|---|---|---|
| Text | .txt | text/plain | 100 MB |
| Microsoft Excel | .xls | application/vnd.ms-excel | 100 MB |
| Microsoft Excel | .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | 100 MB |
| Microsoft Word | .doc | application/msword | 100 MB |
| Microsoft Word | .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | 100 MB |
| Microsoft PowerPoint | .ppt | application/vnd.ms-powerpoint | 100 MB |
| Microsoft PowerPoint | .pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | 100 MB |
| application/pdf | 100 MB |
Audio
| Audio Type | Extension | MIME Type | Max Size |
|---|---|---|---|
| AAC | .aac | audio/aac | 16 MB |
| AMR | .amr | audio/amr | 16 MB |
| MP3 | .mp3 | audio/mpeg | 16 MB |
| MP4 Audio | .m4a | audio/mp4 | 16 MB |
| OGG Audio | .ogg | audio/ogg (OPUS codecs only; base audio/ogg not supported; mono input only) | 16 MB |