WhatsApp API Documentation
Everything you need to integrate WhatsApp messaging into your application.
Get Your API KeyAuthentication
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
Example Request
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).
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
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.
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
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
Webhooks
Configure webhooks to receive real-time notifications about message events, status updates, and customer interactions.
Setup Webhook
Webhook Events
| Event | Description |
|---|---|
| message.sent | Fired when a message is sent from your number |
| message.delivered | Fired when a message is delivered to the recipient |
| message.read | Fired when the recipient reads the message |
| message.failed | Fired when message delivery fails |
| message.received | Fired when you receive a message from a customer |
Webhook Payload Example
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.
Supported Formats
| Type | Formats | Max Size |
|---|---|---|
| Image | JPG, PNG, WEBP | 5 MB |
| Document | PDF, DOC, XLS, PPT | 20 MB |
| Audio | AAC, MP3, OGG | 16 MB |
| Video | MP4, 3GP | 16 MB |