Sin código

6 min · Jul 31

Webhook to Send WhatsApp From a Form (Step by Step)

Learn how to set up a webhook to send WhatsApp from a form: one POST to the Blind Agents API with your API key creates the contact and fires the message.

Want a WhatsApp message to reach someone the instant they submit your form? The cleanest way to do it is a webhook to send WhatsApp from a form: your form makes an HTTP call (a POST) to the Blind Agents API, we create the contact, and we fire the WhatsApp message in seconds. This guide walks you through the API event automation step by step, with the request body example and the API-key header included.

How a webhook to send WhatsApp from a form works

The idea is simple: every time your form is submitted, an event travels to Blind Agents and triggers an action. No polling, no batch export, no waiting for a nightly sync—the message goes out while the lead is still warm and thinking about you. Here is the path:

  • Someone fills out and submits your web form (or a lead is created in your CRM).
  • Your form, your backend, or a tool like Zapier or Make sends a POST to the Blind Agents events endpoint, authenticated with your organization's API key.
  • Blind Agents creates or updates the contact and its company from the data you sent.
  • The automation fires the configured channel—WhatsApp, in this case—and sends your approved template to the contact's phone.
  • If you assigned an AI agent, it continues the conversation the moment the contact replies, in automatic, copilot, or manual mode.

WhatsApp only lets you start a conversation with an approved template, which then opens a 24-hour window for free-form chat. That is why the first message the webhook fires is always a template; the back-and-forth with the agent happens inside that window.

What you need before you start

  • A Blind Agents account with a connected WhatsApp number.
  • At least one approved WhatsApp template (for example, a welcome greeting with the contact's name).
  • Your organization's API key, which authenticates every POST.
  • A form, CRM, or automation tool (Zapier, Make) that can make an HTTP POST request.

Step 1: Create the API event automation

Everything is managed in the Automations section. You will create an automation whose trigger is an API event.

  1. Open Automations and click New.
  2. Under Details, choose the API Event trigger and give it a recognizable name, such as "Web form lead".
  3. Under Trigger and message, select the WhatsApp channel and pick your approved template. Map the template variables to the contact data you will send (name, company, and so on).
  4. Under Agent and delivery, choose the outbound WhatsApp number and, if you want, assign an AI agent and its mode (automatic, copilot, or manual) to pick up the conversation when the contact replies.
  5. Save the automation. From now on, every event it receives will fire that WhatsApp message.

Step 2: Copy your organization's API key

The API key is the credential that identifies your organization on every call. It is sent in the BLIND-AGENTS-API-KEY header. Treat it like a password: keep it on your server or inside your no-code tool, never in code that runs in a visitor's browser.

Step 3: Make the POST from your form

When someone submits the form, your backend (or Zapier/Make) sends a POST to the events endpoint with the API-key header. Here is the full request:

curl -X POST https://api.blindagents.com/v1/events -H "BLIND-AGENTS-API-KEY: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"event":"new_lead","contact":{"name":"Ada","email":"ada@acme.com","phone":"+57..."},"company":{"name":"ACME"}}'

The body carries the event name plus the contact and company data. This is the minimal example:

{"event":"new_lead","contact":{"name":"Ada","email":"ada@acme.com","phone":"+57..."},"company":{"name":"ACME"}}

Which fields to include in the body

  • event: the event name that identifies the automation, for example new_lead.
  • contact.name: the contact's name, handy for personalizing the template variables.
  • contact.email and contact.phone: used to recognize the contact and avoid duplicates; the phone is required to send WhatsApp.
  • company.name: the company the contact is linked to, which Blind Agents creates or updates.

With that, Blind Agents creates or updates the contact (matching it by email or phone), records or updates the company ACME, and fires the WhatsApp message using your approved template.

Send the phone number in E.164 international format, with the + sign and country code (for example, +573001234567). A number without a country code cannot be reached on WhatsApp. And remember: the API key belongs on the server, never exposed in the browser.

Step 4: Test it and check the metrics in the Monitor

  1. Fire a test event with the command above, swapping in your own real contact details.
  2. Verify in Blind Agents that the contact (and its company) show up as created or updated.
  3. Confirm the WhatsApp message went out and was delivered to the test phone.
  4. Open the Monitor to see how many events fired and the delivery status of each message.

Common mistakes (and how to avoid them)

  • Unauthorized response: almost always a mistyped API key or one sent in a header other than BLIND-AGENTS-API-KEY.
  • The WhatsApp never arrives: check that the phone has a country code (+…) and that the template is approved.
  • Empty variables in the message: make sure every template variable maps to a body field (for example, contact.name).
  • Exposed API key: never make the POST from browser-side JavaScript; do it from your server or from Zapier/Make.

Wire it up without writing any code

If your form can't POST on its own, you don't need to program anything. Tools like Zapier or Make ship a ready-made "Webhook" step: paste the endpoint URL, add the BLIND-AGENTS-API-KEY header, and build the body from your form fields. The result is the same webhook to send WhatsApp from a form, set up in minutes and with no code.

Webhook to Send WhatsApp From a Form (Step by Step) · Blind Agents