Integrations

WhatsApp API on Zapier: new lead becomes a message in seconds

There is no D-API app on Zapier: the connection runs through Webhooks by Zapier, which calls the WhatsApp API with a POST. With that, every lead who fills out a form gets a WhatsApp message right after, with no one copying phone numbers from a spreadsheet.

By D-API engineering team5 min read

Why the first WhatsApp contact needs to be automatic

Form leads go cold fast. If the sales rep only sees the sign-up late in the afternoon, the person has already talked to two other companies. A Zap handles the mechanical part: the form fires, Zapier builds the message and the WhatsApp API delivers it from the company number. The rep joins a conversation that is already open, with the history on their phone or in the support tool.

Zapier has no D-API app. The bridge is Webhooks by Zapier, Zapier’s own app for talking to any API. It has triggers like Catch Hook, to receive data, and actions like POST and Custom Request, to send. According to Zapier’s help center, this app is not on the free plan.

The Zap in three steps

  1. Trigger: your form app (Google Forms, Typeform, HubSpot, whatever you already use) with the new response event. If the form lives on your own site, the trigger can be a Catch Hook that receives the site’s POST.
  2. Phone cleanup: a Formatter by Zapier step that leaves the number with digits only and the country code.
  3. Action: Webhooks by Zapier, POST event, calling the D-API text send.

Step 1: the form trigger

Pick the form app and the new response event, connect the account and pull a test record. Check that the name, phone and consent fields show up in the sample. Without a real sample, mapping the next steps is guesswork.

The consent field is not a detail. A checkbox like "I agree to be contacted on WhatsApp" separates an expected message from one that gets reported. A number that gets many reports is a number that stops working, with any kind of API. Add a Filter by Zapier step that only continues when consent was checked. The other practices are in how to avoid bans.

Step 2: get the phone number into the right format

D-API expects the international number with digits only: 14155550123. Forms bring all sorts of things: "(415) 555-0123", "415 555 0123", "+1 415...". Use Formatter by Zapier to strip everything that is not a digit and, if the form does not ask for the country code, prepend it. Test with those three formats before turning the Zap on.

Step 3: the Webhooks by Zapier POST action

Add the Webhooks by Zapier action, choose the POST event and fill in:

Zapier fieldWhat to enter
URLhttps://api.d-api.cloud/api/v1/messages/send/text
Payload Typejson
DatasessionId, to and text, one per line
Wrap Request In ArrayNo
HeadersAuthorization with your API key, without Bearer

In to, map the Formatter output. In text, mix fixed text with the lead’s name. Zapier builds the body from those pairs, and this is what reaches D-API:

POST https://api.d-api.cloud/api/v1/messages/send/text
Authorization: YOUR_API_KEY
Content-Type: application/json

{
  "sessionId": "sales",
  "to": "14155550123",
  "text": "Hi Mary! This is Peter from Acme. I saw your sign-up on our site about the annual plan. Can I send you the details here?"
}

A first-contact message works best when it mentions what the person asked for and ends with a simple question. Avoid a link in the very first message to a number that has never talked to you.

Need more than text? Swap the URL for the image or document route and adjust the fields in Data. For nested bodies, like a list with sections, use the Custom Request event, where you write the whole JSON by hand.

The other direction: when the lead replies

The Zap above only sends. To react to the reply, create a second Zap with the Catch Hook trigger from Webhooks by Zapier. Copy the generated URL and register it as the webhook for the connection’s messages.received event:

curl -X POST https://api.d-api.cloud/api/v1/sessions/sales/webhook-config \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": true, "type": "single",
        "events": { "messages.received": { "enabled": true, "webhookUrl": "https://hooks.zapier.com/hooks/catch/YOUR_URL" } } }'

In the Zap, filter data fromMe equal to false and use data message and data from jid to, for example, mark the lead as "replied" in the CRM and notify the rep. Catch Hook splits the JSON fields for you to map, so there is nothing to parse. The other events you can receive are in the WhatsApp webhooks guide.

Cost and limits on each side

On Zapier, every step that runs counts as a task on your plan, and lead volume drives the bill. D-API charges per connection, not per message, so sending more messages from the same number does not change the invoice. Details are on pricing.

If the flow grows to many steps per lead, compare with n8n, which has a native D-API node for send actions. And if the goal is to message an entire list, not lead by lead, that is a different conversation: see WhatsApp API for marketing. The same form-to-WhatsApp design can also be built on Make.

Frequently asked questions

Does D-API have an official Zapier app?
No. The Zap uses Webhooks by Zapier, which makes HTTP requests to any API. The POST action calls the D-API send endpoint, and the Catch Hook trigger can receive the events D-API sends.
Does Webhooks by Zapier work on the free plan?
According to Zapier’s help center, no. Webhooks by Zapier is available on paid plans. Check the current terms on Zapier’s pricing page before designing the flow.
What phone format does D-API expect?
An international number with digits only, no plus sign, spaces or dashes, for example 14155550123. Forms usually store the phone number the way the person typed it, so add a cleanup step before the POST.
Can I reply automatically when the lead answers?
Yes. Create a second Zap with the Catch Hook trigger, set its URL as the webhook for the messages.received event on D-API and use a filter to ignore messages where fromMe is true.
When should I use Custom Request instead of POST?
When the body has a nested structure, like the sections of an interactive list. The POST action builds the JSON from key-value pairs, which works well for text and simple media.

Try D-API's WhatsApp API

3-day trial with full access. No credit card, no lock-in.