An order comes in at 9:12 pm. The customer should get "Thanks, we've got your order" on WhatsApp straight away, and a tracking link when it ships. Instead, someone on your team copies the details from the store dashboard into WhatsApp the next morning, or forgets to. The same thing happens with login codes, unpaid carts and appointment reminders: the information is in your system, but getting it onto WhatsApp needs a person.
The Mywa API removes that step. It lets your website, app, store or CRM send WhatsApp messages, sync customers and start automations on its own, without anyone opening the Mywa dashboard. This guide explains what that means for a business owner, what developers get, what you can build with it and the limits worth knowing before you start.
What the Mywa API does, in one paragraph
Your systems already know when something happens: an order is placed, a payment fails, a booking is made, someone asks for a login code. With the API, that moment sends a WhatsApp message by itself, using the same WhatsApp number, templates and contacts you already have in Mywa. Every message also lands in your Mywa inbox, so when a customer replies, your team sees the whole conversation and answers it there.
What business owners get
| Benefit | What it means for you |
|---|---|
| Messages go out by themselves | An order, a left-behind cart or a booking triggers the WhatsApp message automatically. No one has to remember. |
| Login codes on WhatsApp | Send verification codes on the app your customers open every day, instead of SMS. |
| Fewer lost sales | Remind people about abandoned carts and pending payments without a person chasing them. |
| Updates where customers look | Order, shipping and booking updates arrive in WhatsApp, not a spam folder. |
| Everything in one place | Messages sent through the API show up in the Mywa inbox, so your team can see them and reply. |
| Nothing new to set up | The API uses your existing number, approved templates and contacts. |
The last two matter more than they look. An API that sends messages from a separate system leaves your team blind: a customer replies "wrong address" to a shipping update and nobody sees it. With Mywa, that reply sits in the same inbox as every other chat.
What developers get
If you're the person who will connect it, here's the short version.
- Plain REST and JSON. It works from any language that can make an HTTPS request. There's no SDK to install; the docs have small copy-paste clients for Node.js, PHP and Python.
- Quick to start. Create a key in Settings → API, and the quickstart gets your first message out in minutes.
- One endpoint to send.
POST /messagessends both approved templates and normal text replies. - No contact setup. Send to a number Mywa hasn't seen before and the contact is created automatically.
- Personalised messages. Fill template variables, attach a different image, video or document to each message, and point button links at a specific page, such as the customer's own order.
- Delivery tracking. Check whether each message was sent, delivered, read or failed, with Meta's reason when it fails.
- Errors you can act on. Every error has a fixed code, such as
window_closedoropted_out, so your code knows exactly what went wrong. The errors page says which ones are safe to retry. - Rate-limit headers. Every response tells you how many requests you have left, so your system can slow down before it hits the limit.
Sending a login code looks like this:
curl -X POST "https://api.mywa.net/api/public/v1/messages" \
-H "Authorization: Bearer $Mywa_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template": { "name": "otp_code", "variables": ["483920"] }
}'
otp_code is an approved authentication template, and 483920 fills its {{1}}. The response includes a message id you can use to check delivery later.
Keep customer data in sync
Your CRM or online store knows things about each customer that make WhatsApp messages better: their plan, city, last order or how much they spend.
- Add or update in one call.
POST /contactscreates a contact or updates the existing one, matched by phone number. - Nothing gets overwritten. Custom details are merged with what's already saved. Send
{ "orders": 13 }and only that detail changes, so two systems can update the same contact safely. - Use the details in campaigns. Synced details can fill template variables, so a campaign can say "Hi Asha, your Pro plan renews on…" without anyone typing it.
- Find contacts quickly. Look one up by phone number, or page through them all.
Start automations from your own system
This is where the API goes furthest. In Mywa you can build an automation, such as a thank-you message, a delivery check and a review request, and then start it from your system for one customer with one API call.
- Start any automation. Payment received → start the "Thank you + review request" automation for that customer.
- Pass your own data. Send the order id, amount or anything else, and use it in the automation's messages, like "Thanks for order {{vars.hook.orderId}}!".
- Track the result. Check each run's status, and whether it reached its goal, for example "Left a review" or "Converted".
- Safety rules built in. An automation won't message someone who unsubscribed, won't start twice at the same time for the same person, and stops a contact being started over and over in a loop.
The private link is the easiest way in for non-developers: give the automation the "From another app" trigger, copy the link, and paste it into a Zapier webhook step. It can only start that one automation, so even if someone sees it, they can't read your data. Keep it in server-side tools like Zapier, not in your website's code, and if it leaks, create a new one and the old one stops working immediately. The automations reference has every detail.
Eight things you can build
- OTP and login codes. Deliver verification codes on WhatsApp. In India, Meta charges ₹0.115 per authentication message before GST (full pricing).
- Abandoned cart recovery. When a cart sits unpaid, send a reminder with the items and a link back to checkout.
- Order and shipping updates. "Your order has shipped 🚚" with a button that opens the tracking page.
- Booking and appointment confirmations. For clinics, salons, hotels and property visits, with a reminder before the time.
- Payment reminders. Send the invoice and a reminder when the due date gets close.
- CRM sync. Keep Mywa contacts up to date with your CRM or online store, so campaigns always use current details.
- Website form → instant WhatsApp follow-up. A lead fills in your form, gets a WhatsApp reply within seconds and goes straight into a lead-qualifier automation.
- Post-purchase journeys. Thank-you message → review request → re-order reminder, started by the purchase and tracked to the goal.
The use cases guide has working code for OTPs, abandoned carts, order updates, order follow-up automations and the Zapier form flow.
Safe by design
An API key that can send WhatsApp messages from your number deserves care. Mywa builds that in:
- Keys with limited permissions. Each key gets only the access it needs. A reporting tool can read data but can't send messages.
- Keys stored securely. The full key is shown once, when you create it. Mywa keeps only a hashed copy, so it can never be read back.
- Instant revoke. Turn off a leaked key and it stops working immediately.
- Rotation without downtime. Create a new key, switch your system over, then turn off the old one.
- WhatsApp's rules enforced. Normal text only goes out inside the 24-hour window after a customer's last message; outside it, the API asks for an approved template. That protects your number's quality rating, which decides how far your messaging limit can grow.
- Opt-outs respected. People who unsubscribed are never messaged.
- A fair usage limit. 120 requests per minute per key stops a runaway script from flooding your account.
Limits to know before you start
Honest limits save you surprises later:
- Templates are created in the Mywa app, not through the API. The API lists your approved templates and sends them. The same goes for campaigns and tags.
- The API sends and syncs; it doesn't read your inbox. Chats, lead scores and analytics stay in the Mywa app.
- There's no installable SDK. The docs give you short client code to copy, not an npm, pip or Composer package.
- Sending isn't unlimited. Each key can make 120 requests per minute, and WhatsApp's own messaging limits still apply.
- Free-form text needs an open window. Outside the 24-hour window, only approved templates can be sent.
- Delivery is tracked, not guaranteed. You can see if each message was delivered, read or failed, and why.
- A retry can send twice. If a request times out and you send it again, the customer may get the message twice. Check the message's status before resending.
Connect your system in four steps
- Connect your WhatsApp number to Mywa, if you haven't already (step-by-step guide).
- Get your templates approved for the messages your system will start, such as an OTP, an order update or a cart reminder. Check them first with the free template checker.
- Create an API key in Settings → API, with only the permissions this integration needs.
- Follow the quickstart to send your first message, then copy the use case closest to yours.
Not a developer? Start with a Mywa automation and the private link: Zapier can start it from your website form today, with no code. When you're ready to go further, the full API documentation is open to read, and you can try the live demo with sample data first.