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 Document

POST
https://api.mottasl.ai/v1/message/send
Last modified:2025-12-30 09:30:43

Send a Document#

Sends a regular (non-template) WhatsApp document message to a recipient phone number.
This endpoint is used for session messages (non-template).
You can optionally include a caption with up to 1024 characters.
You can also optionally set a file name for the document while sending it. If you don’t provide a file name, WhatsApp will display it as Untitled .
💡
This endpoint can be used only when you have an active 24-hour customer service session with the recipient (i.e., the customer has messaged you within the last 24 hours and the conversation window is open). If there is no open session, you must use a template message instead.

Supported document types and sizes#

Document TypeExtensionMIME TypeMax Size
Text.txttext/plain100 MB
Microsoft Excel.xlsapplication/vnd.ms-excel100 MB
Microsoft Excel.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet100 MB
Microsoft Word.docapplication/msword100 MB
Microsoft Word.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document100 MB
Microsoft PowerPoint.pptapplication/vnd.ms-powerpoint100 MB
Microsoft PowerPoint.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentation100 MB
PDF.pdfapplication/pdf100 MB

Request

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

Example
{
    "to": "966544351828",
    "type": "document",
    "document": {
        "link": "https://example.com/files/invoice-2025-0001.pdf",
        "filename": "فاتورة-INV-2025-0001.pdf",
        "caption": "مرفق فاتورتك رقم INV-2025-0001. إذا عندك أي استفسار رد على الرسالة."
    }
}

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' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "966544351828",
    "type": "document",
    "document": {
        "link": "https://example.com/files/invoice-2025-0001.pdf",
        "filename": "فاتورة-INV-2025-0001.pdf",
        "caption": "مرفق فاتورتك رقم INV-2025-0001. إذا عندك أي استفسار رد على الرسالة."
    }
}'

Responses

🟢200OK
application/json
Body

Example
{
    "data": {
        "id": 0,
        "message_id": "string",
        "from_id": "string",
        "to_id": "string",
        "timestamp": "string",
        "channel": "string",
        "source": "string",
        "type": "string",
        "direction": "string",
        "level": "string",
        "parent_message_id": 0,
        "thread_id": 0,
        "business_id": "string",
        "contact_id": 0,
        "forwarded": true,
        "sensitive": true,
        "mock": true,
        "spam": 0,
        "mentions": null,
        "agent_id": 0,
        "is_msg_read": true,
        "template_id": 0,
        "is_recorded": true,
        "close_reason_id": 0,
        "close_summary": "string",
        "CreatedAt": "string",
        "UpdatedAt": "string"
    },
    "message": "string",
    "success": true
}
Modified at 2025-12-30 09:30:43
Previous
Send a Text Message
Next
Send an Image
Built with