WhatsApp API & Developers

Send Form Submissions to WhatsApp: Team Alerts and Leads

A lead fills in your contact form at 9 pm. The submission lands in an inbox nobody checks until morning, and by then they have messaged two competitors on WhatsApp. Speed to lead matters, and your team already watches WhatsApp all day. So the question is how to send form submissions to WhatsApp: to the team, so someone acts, and often to the lead, so they hear from you while they still care.

Those are two different messages with two different sets of rules. This guide covers both, with a working form handler, the consent wording that keeps you on the right side of Meta and WhatsApp, how to stop your own form from getting your number banned, and the option many teams overlook: letting the lead message you first.

Two messages, two sets of rules

Treat the team alert and the lead message as separate problems.

Alert the teamMessage the lead
Who receives itYour staffA member of the public
ConsentInternal, not an issueRequired before you message them
Best destinationA team WhatsApp group, Slack or a shared inboxThe lead's own WhatsApp
Risk if done badlyNoiseSpam reports and a banned number
Speed that mattersSecondsMinutes, and while they still remember you

Most of the trouble comes from mixing the two, such as auto-messaging every number a form receives with no consent checkbox, or alerting the team in ways nobody sees.

Alert the team where they already are

The best alert lands where someone will act on it within minutes. For many small teams that is a WhatsApp group: sales, the front desk or the branch staff.

Meta's official API is awkward here. Cloud API messages to your own staff are still business-initiated, so outside a 24-hour window they need templates. Meta's Groups API exists for businesses with an Official Business Account, but groups are invite-only, capped at 8 participants, and the API cannot post into the existing groups a number is already in. Our guide to sending a message to a WhatsApp group by API covers the details.

A linked-number API can post straight into the group your team already uses, because your number is a member. With Tenashi, you find the group's id once with GET /api/v1/conversations?filter=groups, then send to that conversationId. If your team prefers Slack, an incoming webhook does the same job; see WhatsApp to Slack.

WhatsApp is personal. A message from a business someone never agreed to hear from on WhatsApp gets reported, and reports are what get numbers restricted. Meta's platform requires opt-in before business-initiated messages, and on any number it is simply good practice.

Put the consent on the form, unticked, in plain words:

[ ] Send me a reply on WhatsApp at this number. You can reply STOP at any time.

Store the answer with the submission: the wording shown, the timestamp, and the page. Our guide to the WhatsApp opt-in policy covers what counts as valid consent and how long to keep proof.

What to send matters as much as whether you send:

  • Refer to their request. "Thanks for your enquiry about the 2BHK in Baner" reads as service. "Hi! Check out our offers" reads as spam.
  • Name a person. "This is Arjun from the sales team, I'll call you tomorrow" sets an expectation.
  • Ask one question. "Is a site visit this weekend useful?" invites a reply, which turns the chat into a conversation.

On Cloud API, the first message to a lead who has not written to you must be an approved template. A plain acknowledgement of their enquiry can qualify as utility; anything that sells is marketing.

A form handler that does both

Here is a Next.js route handler that receives the form, filters bots, validates the number, alerts the team group and, with consent, messages the lead through Tenashi's API. The same logic works in any framework.

// app/api/enquiry/route.ts
import { parsePhoneNumberFromString } from "libphonenumber-js";
import { saveSubmission } from "@/lib/db";

const API = "https://usetenashi.com/api/v1/messages";

async function send(body: object, idempotencyKey: string) {
  const res = await fetch(API, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.TENASHI_KEY}`,
      "Content-Type": "application/json",
      "Idempotency-Key": idempotencyKey,
    },
    body: JSON.stringify(body),
  });
  if (!res.ok) {
    const { error } = await res.json();
    throw Object.assign(new Error(error.message), { code: error.code });
  }
  return res.json();
}

export async function POST(req: Request) {
  const form = await req.formData();
  if (form.get("website")) return Response.json({ ok: true }); // honeypot field

  const name = String(form.get("name") ?? "").trim();
  const note = String(form.get("message") ?? "").slice(0, 500);
  const phone = parsePhoneNumberFromString(String(form.get("phone") ?? ""), "IN");
  if (!name || !phone?.isValid()) {
    return Response.json({ error: "Please check your phone number" }, { status: 400 });
  }

  const consent = form.get("whatsapp_consent") === "yes";
  const sub = await saveSubmission({ name, phone: phone.number, note, consent });

  // 1. Alert the team group your number is already in
  await send(
    { conversationId: process.env.TEAM_GROUP_ID, text: `New enquiry from ${name} (${phone.number}):\n${note}` },
    `enquiry-${sub.id}-team`,
  );

  // 2. Reply to the lead, only if they ticked the box
  if (consent) {
    try {
      await send(
        { to: phone.number, text: `Hi ${name}, thanks for your enquiry on example.com. This is Arjun from the sales team. Is a call tomorrow morning okay?` },
        `enquiry-${sub.id}-lead`,
      );
    } catch (e: any) {
      if (e.code !== "new_chat_limit") throw e;
      await sub.flag("reply_manually"); // over today's new-chat allowance
    }
  }
  return Response.json({ ok: true });
}

Notes on the design:

  • Idempotency keys from the stored submission. A double-click or a retried request reuses the same key, and Tenashi returns the first response without sending again for 24 hours.
  • The new-chat limit. Tenashi allows 50 new chats per number per day through the API, counting only people who never wrote to you. Past that it returns 429 new_chat_limit; flag the lead for a teammate instead of dropping it.
  • Personalised text. Sending the identical text to 5 chats within 10 minutes is paused with send_blocked. Including the lead's name and request avoids that and reads better.

For the basics of each call, including the Cloud API equivalent, see how to send a WhatsApp message by API.

Protect your number from your own form

A public form that triggers WhatsApp messages is an open door. Anyone can type any number into it.

  1. Stop bots. Use a honeypot field, a CAPTCHA, or both. Bots that submit thousands of random numbers will make you message thousands of strangers.
  2. Rate-limit per IP and per phone. One enquiry per number per hour is plenty.
  3. Normalise numbers. Parse with a library like libphonenumber and a sensible default country. "09811122233" and "+91 98111 22233" are the same person.
  4. Make the message self-explanatory. If someone else typed a stranger's number, a message that names the site and the enquiry is far less likely to be reported than a sales pitch.
  5. Do not retry blindly. If a send fails with invalid_phone, fix the data; do not loop.

Or flip it: let the lead message you first

The cleanest form-to-WhatsApp flow sometimes has no form. A "Chat on WhatsApp" button using a click-to-chat link (https://wa.me/919800012345?text=Hi%2C%20I%27m%20interested%20in%20the%202BHK) opens WhatsApp with a prefilled message. The lead sends it, so there is no consent question, and on Cloud API the 24-hour window opens and you can reply without a template. You lose structured fields, so pair it with a short form for leads who prefer one. Running Meta ads? See Meta lead ads to WhatsApp.

Where Tenashi fits

Tenashi runs on the number your team already uses, so form alerts can go into the WhatsApp group your staff already watch, and lead replies go out from the number the lead will see again. Every message sent by API appears in the shared inbox, so when the lead answers, whoever picks it up sees the enquiry and the first reply together.

You may not need code at all. Tenashi's lead capture gives each source a webhook URL: point your website form at it, and each submission becomes a contact in the CRM, deduplicated by phone number, with a new-lead notification for the team. Leads from Meta lead ads and CSV imports become contacts the same way. Then a teammate replies from the inbox, or your code calls the API as above.

The honest limits: Tenashi is not Meta's official API, sends are paced at one message every 4 to 12 seconds per number, the API opens at most 50 new chats per number per day, and WhatsApp can still ban numbers that message people who did not ask. The complete guide to the WhatsApp API covers the official route if you need template-based volume.

Read the API docs · Get started

FAQ

How do I get website form submissions on WhatsApp?

Point your form's submit handler at a WhatsApp API and send a message to wherever your team will see it, such as a team WhatsApp group, a teammate's chat or a shared inbox. With a linked-number API like Tenashi you can post into an existing group. With Cloud API, messages to staff outside 24 hours need templates.

Can I automatically message every lead on WhatsApp?

Only those who agreed to it. Add an unticked WhatsApp consent checkbox, store the proof, and message only leads who ticked it. Messaging every submitted number invites spam reports, and bots that submit random numbers can turn your form into a spam cannon. Filter bots and rate-limit before sending anything.

Do I need a template to reply to a form lead on WhatsApp?

On Meta's Cloud API, yes, if the lead has not messaged you in the last 24 hours: the first message must be an approved template. A plain acknowledgement of their enquiry can be utility. On a linked-number API there are no templates, but consent and sensible, personalised wording still apply.

Can I send form alerts to a WhatsApp group?

With a linked-number API, yes: your number is already in the group, so you post to that conversation's id. Meta's Groups API only covers groups created through it, needs an Official Business Account, caps groups at 8 participants and cannot reach existing groups your number belongs to.

What should the first WhatsApp message to a form lead say?

Mention the site and what they asked about, say who you are, and ask one easy question, such as whether a call tomorrow works. Keep it short and personal. A message that clearly answers their own request reads as service, gets replies, and is far less likely to be reported as spam.

The fastest reply wins most leads. Read the Tenashi API docs and get your form talking to the WhatsApp your team already uses.