3. Messaging Endpoints

A. Template Messages/bulk-message
Method:POST
Endpoint:https://api.siteti.com/v1/bulk-message
Requirement:Must use a pre-approved Meta template.
Cost:Standard Meta conversation charges apply.

Use Case: Starting a new conversation or responding after 24 hours of inactivity. Templates are pre-approved by Meta and are required to "open" a communication window with a customer.


Follow these steps to create your template

  • Navigate to Templates: Click the Settings icon in your Siteti dashboard and select Templates.

  • New Template: Click the "New Template" button

  • Naming Convention: Enter a name for your template (e.g., order_confirmation). Note: Spaces are not allowed; the dashboard will automatically replace them with underscores

  • Select Category: Choose the appropriate category (Utility or Marketing).

  • Add Content & Variables: Write your message body. Use variables like {{1}}, {{2}} for dynamic content such as names or order numbers. Pro Tip: Always provide a meaningful sample for your variables (e.g., use "John" as a sample for a name variable) to help Meta approve your template faster.

  • Add Interactive Buttons:: You can add Call to Action buttons, such as a "Track Order" button that links directly to your website.

  • Submit for Approval:Click Submit. Your template will usually be approved within minutes (indicated by a green checkmark).


Step 2: Sending Templates via the API

Once your template is approved, you can use the /bulk-message endpoint to send it. You must provide the values for your variables in the exact order they appear in the template.

Request Payload Sample:
JSON
{
"template_id": 402,
"template_name": "monthly_promo",
"save_contact": true,
"segment": "Apo_Box_Subscribers",
"recipients": [
{
"phone": "2348001112222",
"first_name": "Bisi",
"variables": [
"Bisi",
"10% OFF"
]
},
{
"phone": "2348003334444",
"first_name": "Fola",
"variables": [
"Fola",
"15% OFF"
]
}
]
}

If the provided segment field in request payload does not exist, the contact will automatically be assigned to the default "Chats" segment, provided save_contact is set to true.


Field Definitions:
  • template_id / template_name (Required): Identifiers for the WhatsApp message.
  • save_contact (Boolean): If true, Siteti adds/updates the user in the CRM.
  • segment (String): The CRM group for this contact. Siteti creates the segment if it doesn't exist.
  • recipients (Array): An array of objects, where each object represents an individual target for the communication. This structure allows for bulk processing while maintaining granular, per-user personalization. .
  • phone (String): Recipient in international format (e.g., "234...").
  • first_name / last_name (String): The recipient's given name, used for basic identification or system logging.
  • variables (Array): Ordered strings to replace {{1}}, {{2}} in the template.


Understanding Template Categories

When creating a template, you must select one of three categories. Each category has a specific purpose and affects how Meta charges for the conversation.

Authentication (OTP)

Used exclusively for security and identity verification.

  • Best For: One-Time Passwords (OTPs), login codes, and account recovery.

  • Constraint: These templates are highly restricted. They usually only allow a text code and a "Copy Code" button. You cannot include images or marketing text here.

  • Use Case: Verifying a customer's phone number before they can apply for loan

Utility

Used for essential, transaction-related updates that the customer is expecting.

  • Best For: Order confirmations, delivery updates, payment reminders, and appointment changes.

  • Use Case: Sending a "Your Yefepere cake is out for delivery" notification or a Siteti invoice PDF after a purchase.

  • Why use this? Utility messages usually have higher delivery priority and are cheaper than Marketing messages.

Marketing

Used for any message that isn't strictly utility or authentication.

  • Best For: Promotions, discount codes, newsletters, abandoned cart reminders, and "Welcome" messages.

  • Use Case: Sending a "10% Off Christmas Special" promo to your Apo Box subscribers or announcing a real estate property.

  • Important: Any template that includes a "salesy" vibe or a general greeting must be categorized as Marketing, or Meta will reject it.


To retrieve the Template Name and Template ID, navigate to the Resources and CRM Management section of this doc. These identifiers are located within your saved message templates and are essential for correctly mapping the variables in your API requests.

B. Free Form Messaging:/send-message
Method:POST
Endpoint:https://api.siteti.com/v1/send-message
Requirement:An active session must exist (the user must have messaged you first).
Capability:Supports Text, Media (URL, Media ID, or Base64), and Location.

Free form messages (also know as Session Messages) are used when a customer has messaged you within the last 24 hours. Unlike templates, these do not require pre-approval from Meta/WhatsApp

Use Case: Responding to a customer who has messaged you within the last 24 hours. Once a customer sends you a message, a 24-hour Service Window opens. During this time, you can send "Free-Form" messages (text, images, PDFs) without using templates.


⚠️ Important: Webhook Synchronization

To send a Free-Form message successfully, your server needs to know exactly when the 24-hour window is open. We highly recommend subscribing to the following events in your Siteti Developer Dashboard

session.started
  • The "Green Light": This fires the moment a customer sends you a message or interacts after a period of inactivity.

  • Developer Action: When you receive this notification, it’s your signal that you can now use the /send-message endpoint for the next 24 hours.


message.received
  • The "Incoming Feed": This fires for every message a customer sends.

  • Developer Action:Use this to capture user input (text, images, or button clicks) so your backend can decide what Free-Form response to send back.



1. Text Message

The most common message type.

JSON
{
"recipient": "2348123456789",
"type": "text",
"content": {
"body": "Your order from Yefepere is out for delivery! 🎂"
}
}

Response Body
JSON
{
"success": true,
"messageId": "temp-d9f48a40-4bba-4413-90a2-4114ebf60b0c-1776871471982",
"status": "accepted"
}

2. Image Message

The most common message type.

JSON
{
"recipient": "2348123456789",
"type": "image",
"content": {
"url": "https://yefepere.com/media/cake-sample.jpg",
"caption": "Here is a photo of the finished design!"
}
}
Sending Images via Base64
JSON
{
"recipient": "2348123456789",
"type": "image",
"content": {
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==",
"mimeType": "image/png",
"caption": "Here is the cake sample you requested! 🎂"
}
}

3. Document / PDF Message

Ideal for sending invoices or catalogs.

JSON
{
"recipient": "2348123456789",
"type": "document",
"content": {
"url": "https://yefepere.com/invoices/INV-9902.pdf",
"fileName": "Your_Invoice.pdf",
"caption": "Please find your receipt attached."
}
}
Sending via Base64
JSON
{
"recipient": "2348123456789",
"type": "document",
"content": {
"base64": "JVBERi0xLjQKJ...[long string of text]...",
"fileName": "Catalog.pdf",
"mimeType": "application/pdf"
}
}

Format Prefix (Raw Base64 Only):

Do not include the data URI prefix (e.g., data:image/png;base64,). Your payload should contain only the raw string of characters.



MimeType Accuracy:

The mimeType field is mandatory when using Base64. This tells the system how to interpret the buffer (e.g., image/jpeg, image/png, application/pdf). An incorrect MimeType will result in a corrupted file on the recipient's phone.



The 33% Size Penalty:

Encoding a file into Base64 increases its data size by approximately 33%. Keep this in mind when checking against WhatsApp’s file size limits. A file that is 4MB on your disk will become roughly 5.3MB once encoded.


4. Audio Message

Used for voice notes or recorded instructions.

JSON
{
"recipient": "2348123456789",
"type": "audio",
"content": {
"url": "https://yefepere.com/audio/delivery-note.mp3"
}
}

5. Video Message
JSON
{
"recipient": "2348123456789",
"type": "video",
"content": {
"url": "https://yefepere.com/vids/unboxing-guide.mp4",
"caption": "How to unbox your tiered cake safely."
}
}

6. Interactive (Buttons & Lists)

These are used for quick user responses.

JSON
{
"recipient": "2348123456789",
"type": "interactive",
"content": {
"type": "button",
"body": "Would you like to confirm your delivery time?",
"buttons": [
{
"id": "confirm_yes",
"title": "Yes, I'm ready"
},
{
"id": "confirm_no",
"title": "Reschedule"
}
]
}
}

7. Location Message

Sends a map pin directly to the user's WhatsApp.

JSON
{
"recipient": "2348123456789",
"type": "location",
"content": {
"latitude": 6.467,
"longitude": 3.585,
"name": "Siteti WhatsApp CRM",
"address": "Lagos, Nigeria"
}
}

8. Reaction Message

Used for reacting to a recieved message with a wamid.

JSON
{
"recipient": "2348123456789",
"type": "reaction",
"content": {
"reactingToId": "wamid.HBgLMTU1NTEyMzQ1NjcVAgIAERgFM0U0M0M4N0JERDhDMTI3RDE0AA==",
"emoji": "👍"
}
}


WhatsApp Platform Limits
Media TypeMax File Size (Post-Encoding)
Images5 MB
Documents100 MB
Video16 MB
Audio16 MB

Documentation Reference Table
FieldTypeDescription
recipientStringThe destination phone number in international format (e.g., 234...).
typeStringOne of: text, image, document, audio, video, location, interactive.
contentObjectNested object containing the specific data for the message type.
content.urlStringThe public URL of the media file (required if mediaId is absent).
content.mediaIdStringThe Meta Media ID (use this if the file is already uploaded to WhatsApp).

Summary Table for Developers
ScenarioEndpoint to UseMessage Type
Sending a monthly newsletter/bulk-messageTemplate
Notifying of a new order (First contact)/bulk-messageTemplate
Replying to a customer's question/send-messageFree-Form (Text/Media)
Sending an invoice during a chat/send-messageFree-Form (Document).


[!TIP]
For files larger than 10MB (like high-resolution catalogs or videos), we strongly recommend using the URL method to ensure faster delivery and better reliability across Nigerian network conditions.

C. Download Media/media/{id}
Method:GET
Endpoint:https://api.siteti.com/v1/media/{id}
Requirement:

A Media ID is a unique, alphanumeric identifier generated by WhatsApp whenever a user sends a file (image, video, document, or audio) to your Business Account. Because Meta does not send raw file data directly via webhooks to preserve bandwidth and security, the Media ID acts as a pointer or "claim ticket" that you must use to retrieve the actual file.

The Media endpoint allows you to programmatically retrieve binary files (images, documents, audio, and video) sent to your WhatsApp Business Account.
Because WhatsApp media IDs are short-lived and require specific authentication headers, Siteti provides a proxy endpoint that handles the Meta handshake and streams the file binary directly to your application.