Official WhatsApp Business API + AI automation · Mon–Sat, 10 AM – 7 PM IST WhatsApp +91 81940 66842 Call +91 70173 04793
Developers

WhatsApp API Documentation

Send WhatsApp text, media and template messages, manage contacts and receive webhooks – with a simple REST API on top of Meta's official WhatsApp Cloud API.

0. Ready-made integrations

WordPress & WooCommerce plugin

Floating WhatsApp chat button, [infowave_whatsapp_button] shortcode and automatic order confirmation / completed messages.

Download plugin (.zip, beta)

MCP server for AI tools

Let Claude, Cursor and other AI assistants send WhatsApp messages and manage contacts with our Model Context Protocol server.

Request MCP access

1. Quick start

  1. Log in to wa.infowaveit.com and connect your WhatsApp Business number (Settings → WhatsApp Setup).
  2. Open Settings → API Access & Webhook. Click Generate to create your API Access Token, and copy your Vendor UID.
  3. Send your first message:
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-message" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phone_number":"919876543210","message_body":"Hello from Infowave!"}'
Important: WhatsApp only lets a business send a free-form text or media message within 24 hours of the customer's last message. To start a new conversation, or to message someone after 24 hours, send an approved template (section 5).

2. Authentication & base URL

Base URL

https://wa.infowaveit.com/api/{vendorUid}/

Send your API token in one of two ways:

  • Recommended: HTTP header Authorization: Bearer YOUR_API_TOKEN
  • Query parameter ?token=YOUR_API_TOKEN. Tokens in URLs can end up in server and proxy logs, so use the header wherever you can.

Send request bodies as application/json (form data also works). All endpoints use POST.

Keep your token secret. Use it only from your server, never from browser or mobile app code. If a token leaks, click Generate again on the API Access page. The old token stops working immediately.

Phone numbers are always country code + number, digits only, with no +, leading 0 or spaces. Example: 919876543210.

3. Send a text message

POST/api/{vendorUid}/contact/send-message
FieldTypeDescription
phone_number requiredstringRecipient, e.g. 919876543210. A new contact is created automatically if it doesn't exist yet.
message_body requiredstringMessage text. WhatsApp formatting works: *bold*, _italic_, ~strike~.
from_phone_number_idstringOptional. Which of your WhatsApp numbers to send from. Your default number is used if this is empty.
contactobjectOptional. Contact details used when a new contact is created: first_name, last_name, email, country, language_code, groups (comma-separated group names).
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-message" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "919876543210",
    "message_body": "Hi Rahul, your order #1042 has been shipped.",
    "contact": { "first_name": "Rahul", "groups": "Customers" }
  }'

Successful response (fields inside data):

{
  "result": "success",
  "data": {
    "log_uid": "message log id in the portal",
    "contact_uid": "contact id in the portal",
    "phone_number": "919876543210",
    "wamid": "wamid.HBgM...",
    "status": "accepted"
  }
}

Keep the wamid. It is WhatsApp's message ID, and the delivery and read updates in the webhook refer to it.

4. Send media (image, video, document, audio)

POST/api/{vendorUid}/contact/send-media-message
FieldTypeDescription
phone_number requiredstringRecipient number.
media_type requiredstringimage, video, document or audio.
media_url requiredURLPublic HTTPS link to the file. WhatsApp downloads it from this link.
captionstringOptional caption for an image, video or document.
file_namestringOptional file name shown for documents, e.g. Invoice-1042.pdf.
from_phone_number_id, contactSame as in send-message.
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-media-message" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "919876543210",
    "media_type": "document",
    "media_url": "https://example.com/invoices/1042.pdf",
    "file_name": "Invoice-1042.pdf",
    "caption": "Your invoice"
  }'

WhatsApp size limits: image 5 MB (JPG/PNG), video 16 MB (MP4), audio 16 MB, document 100 MB.

5. Send a template message

POST/api/{vendorUid}/contact/send-template-message

Use a template to start a conversation, or for notifications such as OTPs, order updates and reminders. First create the template in the portal (Templates → Create) and wait until Meta approves it.

FieldTypeDescription
phone_number requiredstringRecipient number.
template_name requiredstringExact template name, e.g. order_shipped.
template_language requiredstringTemplate language code, e.g. en, en_US, hi.
field_1, field_2, …stringBody variables {{1}}, {{2}}… in order.
header_field_1stringVariable in a text header.
header_image / header_video / header_documentURLMedia for a media header. Add header_document_name for the file name.
location_latitude, location_longitude, location_name, location_addressstringFor a location header.
button_0, button_1, …stringDynamic part of URL buttons, in button order (starting at 0).
copy_codestringValue for a "copy code" button (coupon or OTP).
from_phone_number_id, contactSame as in send-message.

Dynamic contact values

Any field can use these placeholders. The portal fills them from the contact's saved details: {first_name} {last_name} {full_name} {phone_number} {email} {country} {language_code}, plus your custom contact fields.

curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-template-message" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "919876543210",
    "template_name": "order_shipped",
    "template_language": "en",
    "header_image": "https://example.com/banner.jpg",
    "field_1": "{first_name}",
    "field_2": "#1042",
    "button_0": "track/1042"
  }'
Template = body "Hi {{1}}, your order {{2}} has shipped." → the customer sees "Hi Rahul, your order #1042 has shipped."

6. Create a contact

POST/api/{vendorUid}/contact/create
FieldTypeDescription
phone_number requirednumericAt least 9 digits, with no + or leading 0. It must not already exist in your account.
first_name, last_namestringOptional.
emailemailOptional.
countrystringOptional country name, e.g. India.
language_codestringOptional, e.g. en, hi.
groupsstringOptional. Comma-separated group names, e.g. Leads,Delhi.
custom_input_fieldsobjectOptional. Values for custom contact fields, keyed by the field's UID (Contacts → Custom Fields), e.g. {"a1b2c3…": "Gold"}.
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phone_number":"919876543210","first_name":"Rahul","last_name":"Sharma","email":"rahul@example.com","country":"India","language_code":"en","groups":"Leads"}'

The response data contains contact_uid, first_name, last_name, phone_number, language_code and country.

7. Update a contact

POST/api/{vendorUid}/contact/update/{phoneNumber}

Send only the fields you want to change. The fields are the same as in create, except phone_number, which goes in the URL.

curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/update/919876543210" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"rahul.new@example.com","groups":"Customers"}'

8. Webhook: receive incoming messages and status updates

Turn this on in Settings → API Access & Webhook → Enable Webhook Endpoint and enter your HTTPS URL. The portal then POSTs a JSON payload to your URL whenever a customer messages you, and whenever a sent message's status changes (sent, delivered, read, failed).

{
  "contact": {
    "status": "existing",          // new / updated / existing
    "phone_number": "919876543210",
    "uid": "contact uid",
    "first_name": "Rahul",
    "last_name": "Sharma",
    "email": "rahul@example.com",
    "language_code": "en",
    "country": "India"
  },
  "message": {
    "whatsapp_business_phone_number_id": "your number id",
    "whatsapp_message_id": "wamid.HBgM...",
    "replied_to_whatsapp_message_id": null,
    "is_new_message": true,
    "body": "Hi, I want a demo",
    "status": null,                 // sent / delivered / read / failed for status updates
    "media": null                   // or { type, link, caption, mime_type, file_name, original_filename }
  },
  "whatsapp_webhook_payload": { /* original payload from Meta */ }
}

Your endpoint should:

  • Reply with HTTP 200 within a few seconds. Do slow work (CRM sync, emails) in a background job.
  • Handle the same whatsapp_message_id arriving more than once without processing it twice.
  • Use HTTPS, and put a long secret in the path, e.g. https://yourapp.com/hooks/wa/8f3k…, so outsiders can't post fake events to it.

9. Errors

Failed requests return "result": "failed" with a message. Validation errors also list the problem fields.

MessageMeaning and fix
Invalid TokenThe token is wrong or was regenerated. Copy the current token from the API Access page.
Invalid VendorThe Vendor UID in the URL is wrong.
Vendor account is not in active stateThe account is inactive or the plan has expired. Contact Infowave support.
Please complete your WhatsApp Cloud API Setup firstNo WhatsApp number is connected yet. Finish WhatsApp Setup in the portal.
API / Webhook not available in your planUpgrade to a plan that includes API access.
Meta error 131047 (re-engagement)More than 24 hours have passed since the customer's last message. Send a template instead.
Meta error 132001Template name or language is wrong, or the template isn't approved yet.
Meta error 131026The number isn't on WhatsApp, or it can't receive the message.

10. Best practices

  • Opt-in first: only message people who agreed to hear from you. Spam reports lower your quality rating and messaging limit.
  • Templates: keep them short and useful, use UTILITY for transactional messages, and use MARKETING only for promotions. They are priced differently.
  • Rate: for bulk sends, use the portal's Campaigns feature instead of a tight API loop. If you loop over the API, leave a short pause between calls and retry failed calls with backoff.
  • Phone format: always 91XXXXXXXXXX for India.
  • Security: keep the token in an environment variable on your server, regenerate it if it leaks, and never put it in a website or app.