All guidesUse your WhatsApp number from another website or tool

Use your WhatsApp number from another website or tool

For the person who builds your website, app or billing software: API keys, sending a message, store events, one-time codes on WhatsApp, webhooks, the day's limits and every error — with curl examples.

12 min readUpdated 2 Dec 2026

In this guide

Your own website, app, sheet or billing software can use this business's WhatsApp number too: send a message, tell us a moment of your store so the message you switched on for it goes, and send one-time codes — with an API key you make in the CRM. This page is for the person who builds that tool: every request, every answer and every limit.

Where it is. In the CRM, open Integrations & API. When that page is called API & other tools, the WhatsApp API is open for your business, and its tabs are Keys, Webhooks, From your other tools, Log and Try it. While it shows only your CRM keys and webhooks, the WhatsApp API is not open for your business yet, and nothing on this page applies.

What you need first

  • A WhatsApp number connected to this business — see WhatsApp hub.
  • For a live key (messages to your customers), a WhatsApp plan of Starter or above. A test key works on every plan.
  • The Manage API keys & webhooks permission on the Team page, to make keys and webhooks. Someone from support looking at your dashboard as you cannot make a key — keys are made from your own login.

Keys — live or test, and what each may do

1

Make a key

On the Keys tab tap + New key. Your first key is a Test key unless you choose Live key. A test key sends only to your own business's numbers — yours, your team's and the WhatsApp number itself — up to 200 messages a day, on every plan. A live key messages your customers.

2

Tick only what your tool needs

  • Send WhatsApp messages from your number
  • Read messages, chats, layouts and the number's health
  • Record a customer's yes or no to offers
  • Tell us your store's moments (an order shipped, a cart left) so the messages you switched on go
  • Send one-time codes on WhatsApp and check them
  • Send codes to other countries

Leave all of them off for a key that only reads and writes the CRM. Send codes to other countries starts off: without it, a key's one-time codes go only to numbers in its own country. Then choose the country of a number your tool writes without a country code — India (+91) unless you choose another. That country is also the key's own country for codes.

3

Copy it once

The key is shown once. Paste it into your tool's settings straight away; if it is lost, make a new one and revoke the old. The list shows each key's kind, rights, country and when it was last used. Revoke stops a key at once — a request with it is refused from that moment.

Every request carries the key in a header: Authorization: Bearer YOUR_KEY. The addresses below start with https://www.lentlosites.com/api/crm/v1; the Try it tab shows the exact address for your business and sends a test message to your own number. A body is JSON, at most 64 KB.

  • POST /whatsapp/messages — Send one message — an approved layout, or words inside the 24-hour window. Needs: Send WhatsApp messages from your number.
  • GET /whatsapp/messages/{id} — Where one message stands. Needs: Read messages, chats, layouts and the number's health.
  • GET /whatsapp/layouts — Your layouts with each blank's name. Needs: Read messages, chats, layouts and the number's health.
  • GET /whatsapp/health — Can your number send right now, and how much of today is left. Needs: Read messages, chats, layouts and the number's health.
  • POST /whatsapp/consent — Record a customer's yes or no to offers. Needs: Record a customer's yes or no to offers.
  • GET /whatsapp/conversations — Chats that changed since a time. Needs: Read messages, chats, layouts and the number's health.
  • GET /whatsapp/conversations/{id}/messages — The messages of one chat, newest first. Needs: Read messages, chats, layouts and the number's health.
  • POST /events — Tell us one moment of your store; the message switched on for it goes. Needs: Tell us your store's moments (an order shipped, a cart left) so the messages you switched on go.
  • POST /whatsapp/otp/send — Send a one-time code to a customer's WhatsApp. Needs: Send one-time codes on WhatsApp and check them.
  • POST /whatsapp/otp/verify — Check the code the customer typed. Needs: Send one-time codes on WhatsApp and check them.

A key and the team member who made it. When you remove or suspend a team member, the Team page first names the keys they made — they stop working — and offers Make new keys now: each key gets a new key from you, with the same name, rights, kind and country, shown once for you to paste into your tools. When one of their keys reached less than you can — only some branches, or fewer rights — the sheet says so: the new keys work as you, every branch and everything you may do. The sheet also names the webhooks they made: a removal switches them off, a suspension stops them while it lasts. They saw each one's signing secret, so make a new secret for each under Webhooks before you switch it back on. When a member is made a Viewer, the keys they made only read from then on — a tool using one can no longer send or change anything — and the key list says so.

Send a message

POST /whatsapp/messages sends one message. Outside the 24-hour window — when the customer has not written to you in the last 24 hours — WhatsApp allows only an approved layout: name it and fill its blanks, by position (a list) or by name (an object). GET /whatsapp/layouts lists your layouts with each blank's name.

curl -X POST https://www.lentlosites.com/api/crm/v1/whatsapp/messages \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042-shipped" \
  -d '{"to":"+919876543210","ref":"1042","layout":{"name":"order_update","language":"en","values":["Ramesh","#1042"]}}'
HTTP 202
{"id":"msg_3f6c…","status":"sent","to":"+919876543210","ref":"1042","test":false}

Inside the window you can send your own words instead (at most 4,096 characters):

curl -X POST https://www.lentlosites.com/api/crm/v1/whatsapp/messages \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+919876543210","type":"text","text":"Your order is packed and leaves today."}'
  • to — the customer's number with + and the country code; without them it must be a mobile number of the key's own country (ten digits for India).
  • ref — your own order or bill number, up to 120 characters; it comes back in the answer.
  • purpose — update (the default: about the customer's own order, booking, bill or chat) or offer.
  • Idempotency-Key header — up to 80 characters. Sending the same body with the same key again answers the first message, never a second one.
  • The answer's id starts msg_; GET /whatsapp/messages/{id} says where it stands — for example delivered or read — and the whatsapp.message.status webhook tells your tool as it changes.

Offers cannot be sent through the API yet — only updates about a customer's own order, booking, bill or chat; an offer answers offers-not-open-yet. Send an offer as a broadcast from your dashboard.

Store events — your store says what happened, the message you switched on goes

Instead of building each message yourself, tell us the moment: POST /events with the event's name, the customer's phone and the event's data. The message goes only when its card is switched on in From your other tools — one tap on Switch on uses a ready layout for it (a layout new to your number is checked by WhatsApp first), and the card shows how many went today and which values were missing. An event whose card is off, or that we do not know, answers {"matched": false} with the reason — never an error, so your store keeps working.

curl -X POST https://www.lentlosites.com/api/crm/v1/events \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event":"order.shipped","phone":"9876543210","name":"Ramesh Kumar","ref":"1042",
       "data":{"order_number":"1042","courier":"Delhivery","tracking_number":"DL123456789",
               "tracking_url":"https://www.delhivery.com/track/package/DL123456789"}}'
HTTP 202
{"id":"evt_9a1b…","matched":true,"message":{"id":"msg_77d0…","status":"sent"}}
  • event — one of the standard events below (lower-case words joined by dots, up to 64 characters).
  • phone — the customer's number; name — their name, used for the greeting.
  • ref — your own order or bill number. The same event with the same ref inside 72 hours answers {"duplicate": true} and sends nothing again — so a store that sends twice never messages twice.
  • occurred_at — when it happened (ISO-8601 with its offset). An event that happened more than 24 hours ago sends nothing: a store replaying its history never messages customers about the past.
  • send_after_minutes — wait this long before the message goes, from 0 to 1440 (a day); the answer's message then reads held with its send_at. A held message is checked again when it goes; a cart reminder is not sent when an order came from the same number or cart meanwhile.
  • consent — what your store recorded from the customer, {"updates": false} or {"offers": false}: their no stops the message, and the answer's message reads refused (your store keeps working).
  • Amounts in data are in rupees (1050 or "1050.50"), links start with https://, a date is 2026-11-20 and a booking's time is ISO-8601 with its offset.

The standard events are order.created, order.paid, order.shipped, order.delivered, order.cancelled, order.refunded, cod.confirm, payment.reminder, booking.confirmed, booking.reminder, invoice.sent, review.request, cart.abandoned and lead.created. Every one is an update about the customer's own order, booking or bill — except cart.abandoned, which is an offer: only to people who said yes to offers, at most one a week across all your stores, and not open through the API yet. When the layout you switched on needs a value the event did not carry, the answer is missing-value with the field's name (for example tracking_url).

  • order.created — Order placed: The customer gets the order number, the amount and the items, the moment your store takes the order. Fields in data: order_number (needed, text up to 40), total (rupees), items (text up to 150), courier (text up to 40), tracking_url (link), tracking_number (text up to 40), eta (date), pay_url (link), store_name (text up to 60), store_phone (text up to 20), cart_ref (text up to 80).
  • order.paid — Payment received: The customer reads that their payment for the order reached you. Fields in data: order_number (needed, text up to 40), total (rupees), items (text up to 150), courier (text up to 40), tracking_url (link), tracking_number (text up to 40), eta (date), pay_url (link), store_name (text up to 60), store_phone (text up to 20).
  • order.shipped — Order shipped: The courier's name, the tracking number and the link to follow the parcel. Fields in data: order_number (needed, text up to 40), total (rupees), items (text up to 150), courier (text up to 40), tracking_url (link), tracking_number (text up to 40), eta (date), pay_url (link), store_name (text up to 60), store_phone (text up to 20).
  • order.delivered — Order delivered: The customer reads that the order was delivered and can rate it from 1 to 5 in the chat. Fields in data: order_number (needed, text up to 40), total (rupees), items (text up to 150), courier (text up to 40), tracking_url (link), tracking_number (text up to 40), eta (date), pay_url (link), store_name (text up to 60), store_phone (text up to 20).
  • order.cancelled — Order cancelled: The customer reads that the order was cancelled, with your number to call. Fields in data: order_number (needed, text up to 40), total (rupees), items (text up to 150), courier (text up to 40), tracking_url (link), tracking_number (text up to 40), eta (date), pay_url (link), store_name (text up to 60), store_phone (text up to 20).
  • order.refunded — Refund sent: The amount refunded and how it was sent. Fields in data: order_number (needed, text up to 40), total (rupees), items (text up to 150), courier (text up to 40), tracking_url (link), tracking_number (text up to 40), eta (date), pay_url (link), store_name (text up to 60), store_phone (text up to 20), refund_way (text up to 40).
  • cod.confirm — Ask a cash-on-delivery customer to confirm: The customer taps Confirm or Cancel; each tap comes back to your tool as whatsapp.button.clicked. Fields in data: order_number (needed, text up to 40), total (needed, rupees), items (text up to 150), address (text up to 160), store_name (text up to 60).
  • payment.reminder — Payment reminder: The amount still to pay, what it is for, and the link to pay. Fields in data: amount (needed, rupees), pay_url (needed, link), due_on (date), what_for (text up to 80), store_name (text up to 60).
  • booking.confirmed — Booking confirmed: What was booked, the date and the time. Fields in data: when (needed, date and time), what (text up to 80), where (text up to 120), manage_url (link), store_name (text up to 60).
  • booking.reminder — Booking reminder: A reminder of the date and time, with a reply to confirm. Fields in data: when (needed, date and time), what (text up to 80), where (text up to 120), manage_url (link), store_name (text up to 60).
  • invoice.sent — Invoice sent: The invoice number, the amount and the link to see it. Fields in data: invoice_number (needed, text up to 40), amount (needed, rupees), view_url (link), pay_url (link), store_name (text up to 60).
  • review.request — Ask for a review: After the order, a link to rate it. Fields in data: order_number (needed, text up to 40), review_url (link), store_name (text up to 60).
  • cart.abandoned — Cart left at checkout (an offer): A reminder with what is in the cart and the link to finish — only to people who said yes to offers, at most one a week. Fields in data: cart_url (needed, link), total (rupees), items (text up to 150), cart_ref (text up to 80), store_name (text up to 60).
  • lead.created — Enquiry received: A thank-you to the person who enquired, saying you will reply in the chat. Fields in data: what_for (text up to 80), store_name (text up to 60).

One-time codes on WhatsApp

First tap the One-time codes card in From your other tools once: WhatsApp checks its code layout (usually a few minutes) and the card says when your website can send codes. WhatsApp writes the words itself, with a button that copies the code.

curl -X POST https://www.lentlosites.com/api/crm/v1/whatsapp/otp/send \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+919876543210","purpose":"login","client_ip":"203.0.113.7"}'

HTTP 202
{"id":"otp_5c2e…","expires_at":"2026-12-02T10:10:00.000Z"}
curl -X POST https://www.lentlosites.com/api/crm/v1/whatsapp/otp/verify \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"otp_5c2e…","code":"482913"}'

HTTP 200
{"verified":true}
  • A code is 6 digits and lasts 10 minutes. A new code to the same number cancels the old one.
  • Between two codes to one number: at least 60 seconds (otp-wait with Retry-After).
  • 5 wrong tries lock that code (otp-locked); a new one can be asked for after 15 minutes. A wrong try answers otp-wrong with tries_left.
  • purpose is login, cod or other. Pass client_ip, your visitor's own address: without it, your key stands in for every visitor and many codes asked from one place stop sooner.
  • A number that is not on WhatsApp answers not-on-whatsapp — send that customer the code another way, such as an SMS from your own system.
  • A code goes only to a number in the key's own country — the country chosen when the key was made — unless the key has Send codes to other countries switched on; any other number answers bad-number.
  • Each code is a message Meta bills to your own Meta account at its rate for codes — a number outside India costs more.
  • One business, every website and app together, from every address: at most 150 codes an hour and 600 a day (from midnight, India time). Past it, the answer is otp-capped with next_allowed_at, and the business's owner is told once that day. Codes from a test key are counted neither here nor in the next line.
  • More than 32 codes to one number in one day: the owner is told once, and that number gets at most one code every 30 minutes until midnight — a real customer still gets a code within half an hour.

Webhooks — hear what happens

On the Webhooks tab, add your address and choose its events: Customer messaged you (whatsapp.message.received), Message delivered, read or failed (whatsapp.message.status), Customer tapped a button (whatsapp.button.clicked), Customer sent STOP or START (whatsapp.optout.changed), Layout approved, refused or paused (whatsapp.layout.status) and Number's standing changed (whatsapp.number.health). Customers' own messages (“Customer messaged you”, “Customer tapped a button”) go only to webhooks the business's owner made.

Check every delivery is ours. Each one is signed: X-Lentlo-Signature is the hex HMAC-SHA256 of the body exactly as it arrived, made with the webhook's secret, sent with X-Lentlo-Event, X-Lentlo-Timestamp and X-Lentlo-Delivery. X-Lentlo-Delivery is the same for every try of one delivery — use it to skip a repeat.

The signing secret is shown once — when you add the webhook, and after New secret; the list shows only its last four characters. New secret makes a fresh one: the old one stops signing the moment you confirm, so put the new one into your tool straight away. Someone from support looking at your dashboard as you cannot make one, and neither can a login that may only view.

# the hook's secret, and the body exactly as it arrived (before any JSON parsing)
expected=$(printf '%s' "$RAW_BODY" | openssl dgst -sha256 -hmac "$HOOK_SECRET" | sed 's/^.* //')
[ "$expected" = "$X_LENTLO_SIGNATURE" ] && echo "signed by us" || echo "refuse it"

Answer with a 2xx within 5 seconds. A delivery that fails is tried again after 30 seconds, 2 minutes, 10 minutes, 1 hour and 6 hours. A webhook with WhatsApp events does not pause at the first trouble: after 20 straight failures it rests — we check your address every 5 minutes with a small signed check (event whatsapp.ping; answer it with 200) and, once it answers, send every message event it missed, oldest first (news about a layout or your number while it rests is not sent again). You are told after an hour; only a whole day of unanswered checks pauses it. Deliveries on a webhook lists the last 100 WhatsApp deliveries of the past 7 days, each with Send again.

How many messages a day

  • Live keys, all together, in one day (from midnight, India time) — messages, store events and one-time codes: Starter 1,000 · Growth 10,000 · Business 50,000. Updates — about a customer's own order, booking, bill or chat — keep going past it, up to three times it; offers, your own words and one-time codes wait for the next day (daily-limit with Retry-After). You are told once when 80 % of the day is used. The Keys tab shows today's count and what is left, and GET /whatsapp/health tells your tool.
  • Test keys: 200 messages a day, to your own business's numbers only.
  • One key, one minute: at most 600 sends (rate-limited with Retry-After — nothing is lost); reads: 2,000 an hour.
  • Numbers that have never written to you: at most 60 new numbers an hour and 250 a day get automatic messages; numbers that have written to you are not counted. A message past it answers recipient-not-allowed and is not sent — nothing to fix for a real customer: messages to that number go again later, and once they write to you they are not counted. A cart reminder past it answers try-later instead: send it again later. A plan's day count is for all your messages together — it does not mean that many can go to numbers that never wrote to you. One-time codes are not counted here — they have limits of their own (see One-time codes above).
  • When we could not finish one of our checks, the answer is try-later and nothing was sent — try again in a minute.

When a customer sends STOP

A customer who replies STOP gets nothing more from your number through the API — not even order updates — until they send START. A send to them answers opted-out; there is nothing to fix. The whatsapp.optout.changed webhook tells your tool the moment it changes.

The Log — what your keys did

The Log tab lists the last 7 days, newest first: every message your keys sent, with where it stands, and every request we answered without sending, with the reason in words and the key's name. A request with a wrong or missing key is not listed (it belongs to no key). A message your keys sent shows its number in full to owners and to team members with the Export / download data permission, and its last four digits to everyone else; a request we answered without sending keeps only the last four digits of its number, for everyone. The tab refreshes every 15 seconds while it is open.

Errors — what each one means and what to do

Every refusal answers {"error": {"code", "message", "fix"}}, sometimes with more (field, next_allowed_at, tries_left). Read code in your tool; show message to a person.

HTTP 409
{"error":{"code":"window-closed","message":"This customer last wrote more than 24 hours ago (or never wrote), so WhatsApp allows only an approved layout.","fix":"Send an approved layout instead."}}
  • unauthorized (HTTP 401) — This API key is not valid — it is missing, mistyped, or it was switched off. What to do: Send the key in the Authorization header as "Bearer <key>". A key is shown only once: make a new one in the CRM's API & other tools page (Integrations & API).
  • forbidden-scope (HTTP 403) — This key is not allowed to do this. What to do: Make a key with this right switched on in the CRM's API & other tools page (Integrations & API).
  • test-key-recipient (HTTP 403) — A test key sends only to your own business's numbers — your number, your team's and the WhatsApp number itself. What to do: Use a live key to message customers.
  • plan-needed (HTTP 402) — The API is part of Starter and above. A test key works on every plan. What to do: Choose a WhatsApp plan, or use a test key until you do.
  • layout-not-found (HTTP 404) — There is no layout with this name on your WhatsApp number. What to do: List your layouts with GET /whatsapp/layouts and use a name from there.
  • message-not-found (HTTP 404) — No message with this id. What to do: Use the id the send answered (it starts "msg_").
  • conversation-not-found (HTTP 404) — No chat with this id. What to do: Use an id from GET /whatsapp/conversations (it starts "cnv_").
  • number-not-ready (HTTP 409) — Your WhatsApp number cannot send right now. What to do: Open WhatsApp → Settings in your dashboard — it names the reason and the step that fixes it.
  • window-closed (HTTP 409) — This customer last wrote more than 24 hours ago (or never wrote), so WhatsApp allows only an approved layout. What to do: Send an approved layout instead.
  • opted-out (HTTP 409) — This person asked not to get these messages from you (they sent STOP), so nothing was sent. What to do: Nothing to fix — they can send START to hear from you again.
  • offer-needs-consent (HTTP 409) — This person has not said yes to offers from you. What to do: Pass the customer's own yes with the send ("consent"), or send an update instead.
  • offer-capped (HTTP 409) — This person already got an offer from you in the last 7 days. What to do: Try again after next_allowed_at.
  • offers-not-open-yet (HTTP 409) — Offers cannot be sent through the API yet — only updates about a customer's own order, booking, bill or chat. What to do: Send an update layout, or send the offer as a broadcast from your dashboard.
  • layout-not-approved (HTTP 409) — WhatsApp has not approved this layout (or paused it). What to do: Check the layout in WhatsApp → Layouts; use an approved one meanwhile.
  • meta-refused (HTTP 409) — WhatsApp refused this message. What to do: Read `failure` for WhatsApp's reason and the step that fixes it.
  • customer-said-no (HTTP 409) — This customer's newest answer is no, so a yes sent by your tool is not recorded. What to do: Only the customer can change their own no — at your shop's counter, or on your website's own question.
  • idempotency-mismatch (HTTP 409) — This Idempotency-Key was already used for a different message. What to do: Use a new key for a new message; send the same body to read the first answer again.
  • sending-paused (HTTP 409) — Messages from this business are paused by Lentlo. What to do: Open Help & Support in your dashboard.
  • recipient-not-allowed (HTTP 409) — This number already got many messages today and has never written to you on WhatsApp, so no more go to it today. What to do: Nothing to fix for a real customer — tomorrow it goes again; when they write to you, the limit is higher.
  • too-large (HTTP 413) — The request is larger than 64 KB. What to do: Send a shorter message.
  • bad-number (HTTP 422) — This phone number cannot be read. What to do: Write it with + and the country code (+91 98765 43210). Without them it must be a mobile number of the key's own country (ten digits for India).
  • missing-value (HTTP 422) — A blank of the layout has no value. What to do: Fill every blank `field` names (GET /whatsapp/layouts lists them).
  • bad-request (HTTP 422) — Part of the request cannot be read. What to do: Check `field` against the API guide.
  • rate-limited (HTTP 429) — Too many requests from this key in a minute. What to do: Wait for Retry-After seconds, then send the rest — nothing was lost.
  • daily-limit (HTTP 429) — Today's API limit for this business is used up. What to do: Updates still go; offers and free-form messages wait until Retry-After. A bigger plan lifts the limit.
  • limiter-unavailable (HTTP 429) — We could not check today's limits just now, so this was not sent. What to do: Try again in a minute — order and booking updates still go.
  • in-flight (HTTP 409) — A send with this Idempotency-Key is still on its way. What to do: Read the message with GET /whatsapp/messages in a few seconds — it is never sent twice.
  • try-later (HTTP 409) — We could not finish one of our checks just now, so nothing was sent. What to do: Try again in a minute.
  • content-not-allowed (HTTP 409) — WhatsApp does not allow this business to send this message. What to do: Read `message` for the reason; if it is a mistake, ask us to look.
  • api-closed (HTTP 403) — This business's WhatsApp API is closed while one of its websites is taken down: nothing is sent or read through it, and its webhooks receive no WhatsApp events. A customer's no to offers is still recorded. What to do: It opens again by itself within a minute of the website being restored. If that website was deleted, it does not open by itself: the business asks for help from Help & Support in its dashboard.
  • otp-wait (HTTP 429) — A code for this number was asked for a moment ago, so a new one cannot go yet. What to do: Wait for Retry-After seconds; the code already sent still works until it expires.
  • otp-capped (HTTP 429) — Codes for this number are being asked for from many places, so no new code goes to it for now. What to do: Try again after next_allowed_at. The code already sent still works until it expires.
  • otp-wrong (HTTP 409) — That code is not the one we sent. What to do: Ask the customer to type the code again — tries_left says how many tries remain.
  • otp-used (HTTP 409) — This code was already used. What to do: Ask for a new code with POST /whatsapp/otp/send.
  • otp-expired (HTTP 410) — This code has expired (codes last 10 minutes), or a newer code replaced it. What to do: Ask for a new code with POST /whatsapp/otp/send.
  • otp-locked (HTTP 429) — This code was typed wrong too many times, so it no longer works. What to do: A new code can be asked for after Retry-After seconds.
  • otp-not-found (HTTP 404) — No code with this id. What to do: Use the id the send answered (it starts "otp_").
  • not-on-whatsapp (HTTP 409) — This number is not on WhatsApp, so the code was not sent. What to do: Send the code another way (an SMS from your own system).

When one of your websites is taken down, the whole API of this business is closed (api-closed): nothing is sent, read or written through it, and its webhooks get no events; it opens again by itself within a minute of the website being restored. If that website was deleted, it does not open by itself: ask for help from Help & Support in your dashboard.

More in CRM, WhatsApp & AI

Did this answer your question?

It takes one tap and it genuinely changes what we write next.