Azeer API Documentation
  1. Messages
Azeer API Documentation
  • Welcome 👋
  • API Authentication
  • API Endpoints
    • Messages
      • Messages Overview
      • Get Templates List
        GET
      • Send a Template Message
        POST
      • Send a Text Message
        POST
      • Send a Document
        POST
      • Send an Image
        POST
    • Agents
      • List All Agents
      • Get an Agent Details
      • Assign Contact to an Agent
    • Contacts
      • Create a Contact
      • Get Contact Details
    • Webhooks
      • Webhooks Overview
      • List All Webhooks
      • Get Webhook Details
      • Create Webhook
      • Delete Webhook
    • Tags
      • Create a Tag
      • List All Tags
      • Adding Tag to a Contact
  1. Messages

Send a Template Message

POST
https://api.mottasl.ai/v1/message/send
Last modified:2025-12-23 08:43:46
Templates must be approved, published, and available in the same language you intend to send. Your API request will fail if the message format does not match the template structure.
You can preview all your templates in the dashboard and confirm their body text, header components, media design, and button types before using them in your API calls. or you can use this endpoint to GET the whole list of available and approved Templates (/). You can utilize this endpoint to retrieve details of a Template also.
Once your template is ready, you can send messages through the API by providing:
The recipient number
The template name / ID
Optional header, body, or button parameters depending on the template
Optional media URLs for templates that include images, videos, or documents
This ensures messages are delivered in a predictable format while following WhatsApp’s policies for marketing, utility, and authentication flows.
💡
Implementation Notes:
1.
Review the template structure first (Header / Body variables / Buttons) before building your API payload—your request must match the template’s exact components and order.
2.
Map body variables in order: values in BODY[] are positional and fill {{1}}, {{2}}, {{3}}… exactly as defined in the template.
3.
Use HEADER only when the template includes a header component. For media headers (image/video/document), HEADER must contain a valid, publicly accessible media URL.
4.
Buttons use payloads, not labels: values in BUTTONS[] are the payloads returned on click (for automations/tracking). They do not change the button title shown to the customer.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params

Body Params application/json

Example
{
    "to": "966555555555",
    "type": "template",
    "template": {
        "template_id": "invoice_created",
        "language": "ar",
        "argument": {
            "HEADER": [
                "https://cdn.mottasl.ai/media/2c8a9a2d-04f8-49df-a240-f4a990782c94/business/cef891070e983228ed63add264f58512.jpeg"
            ],
            "BODY": [
                "Abdelaziz",
                "19,000"
            ],
            "BUTTONS": [
                "inv-234"
            ]
        }
    }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mottasl.ai/v1/message/send?create=true' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "966555555555",
    "type": "template",
    "template": {
        "template_id": "invoice_created",
        "language": "ar",
        "argument": {
            "HEADER": [
                "https://cdn.mottasl.ai/media/2c8a9a2d-04f8-49df-a240-f4a990782c94/business/cef891070e983228ed63add264f58512.jpeg"
            ],
            "BODY": [
                "Abdelaziz",
                "19,000"
            ],
            "BUTTONS": [
                "inv-234"
            ]
        }
    }
}'

Responses

🟢200Success
application/json
Body

Example
{
    "data": {
        "id": 53009555,
        "message_id": "wamid.HBgMMjAxMDkyODU4Nzg1FQIAERgSNzI2OTMxNEM3M0RGOUJBM0I4AA==",
        "from_id": "96600008478",
        "to_id": "201000000005",
        "timestamp": "2025-03-10T13:33:22.453557388Z",
        "channel": "whatsapp",
        "source": "",
        "type": "template",
        "direction": "out",
        "level": "agent",
        "parent_message_id": 0,
        "thread_id": 0,
        "business_id": "2c8a9a2d-04f8-49df-a240-f4a990782c94",
        "contact_id": 92,
        "forwarded": false,
        "spam": 0,
        "mentions": null,
        "agent_id": 40000,
        "window_marker": false,
        "template_id": 12345,
        "is_recorded": false,
        "CreatedAt": "2025-03-10T13:33:22.453557Z",
        "UpdatedAt": "2025-03-10T13:33:22.453557Z"
    },
    "message": "Message sent successfully",
    "success": true
}
🟠400BadRequest
Modified at 2025-12-23 08:43:46
Previous
Get Templates List
Next
Send a Text Message
Built with