Home Features Pricing About API Docs Contact
Log In Get Started Free
API Docs

WhatsApp API Documentation

Everything you need to integrate WhatsApp messaging into your application.

Get Your API Key

Authentication

All API requests require authentication using a Bearer token. You can generate your API key from the HiSynx dashboard under Settings → API Keys.

Keep Your Key Secure

Never expose your API key in client-side code. Always use it from your server-side application. Rotate keys regularly and use environment variables for storage.

Authorization Header

GET All endpoints
Authorization: Bearer your_api_key_here

Example Request

// cURL Example curl -X GET "https://hisynx.in/v1/account" \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json"

Send Message

Send a text message to a WhatsApp number. The recipient must have an active WhatsApp account and must have initiated a conversation with your business number within the last 24 hours (WhatsApp window policy).

POST /v1/messages

Request Parameters

Parameter Type Required Description
to string Required Recipient phone number in international format (e.g., "15551234567")
type string Required Message type: "text", "image", "document", "audio", "video"
text.body string Required The text message content (max 4096 characters for text type)
preview_url boolean Optional Whether to generate URL previews in the message (default: false)

Request Example

{ "to": "15551234567", "type": "text", "text": { "body": "Hello! This is a message from HiSynx.", "preview_url": false } }
Response (200 OK)
{ "success": true, "message_id": "wamid.HBgMNDU2Nzg5MDEyMzQ1NjY5MBABIgU1RTI0AA", "status": "queued", "timestamp": "2025-01-15T10:30:00Z" }

Send Template Message

Send a pre-approved template message. Templates must be approved by Meta before use. This is the primary way to initiate conversations with customers who haven't messaged you recently.

POST /v1/messages/templates

Request Parameters

Parameter Type Required Description
to string Required Recipient phone number
template_name string Required The name of the approved template
language_code string Required Language code (e.g., "en", "es", "fr")
components array Optional Array of components with parameters for dynamic values

Request Example

{ "to": "15551234567", "template_name": "order_confirmation", "language_code": "en", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "John" }, { "type": "text", "text": "#HS-2847" }, { "type": "text", "text": "Tomorrow" } ] } ] }
Response (200 OK)
{ "success": true, "message_id": "wamid.HBgMNDU2Nzg5MDEyMzQ1NjY5MBABIgU1RTI0AA", "template_name": "order_confirmation", "status": "submitted" }

Manage Templates

List, create, and manage your message templates. All templates must be submitted to Meta for approval before they can be used.

List All Templates

GET /v1/templates
Response (200 OK)
{ "data": [ { "id": "tpl_abc123", "name": "order_confirmation", "status": "APPROVED", "language": "en", "category": "UTILITY", "created_at": "2025-01-10T08:00:00Z" } ], "pagination": { "total": 15, "page": 1, "per_page": 25 } }

Webhooks

Configure webhooks to receive real-time notifications about message events, status updates, and customer interactions.

Setup Webhook

POST /v1/webhooks

Webhook Events

EventDescription
message.sentFired when a message is sent from your number
message.deliveredFired when a message is delivered to the recipient
message.readFired when the recipient reads the message
message.failedFired when message delivery fails
message.receivedFired when you receive a message from a customer

Webhook Payload Example

{ "event": "message.received", "timestamp": "2025-01-15T10:30:00Z", "data": { "message_id": "wamid.HBgM...", "from": "15551234567", "type": "text", "text": { "body": "Hi, I need help with my order" } } }

Media Upload

Upload media files (images, documents, audio, video) to use in messages. Files are stored securely and can be referenced by their media ID.

POST /v1/media/upload

Supported Formats

TypeFormatsMax Size
ImageJPG, PNG, WEBP5 MB
DocumentPDF, DOC, XLS, PPT20 MB
AudioAAC, MP3, OGG16 MB
VideoMP4, 3GP16 MB

Ready to Build?

Get your API key and start integrating in minutes.

Get Your Free API Key