Integrate WhatsApp with Google Sheets

To integrate WhatsApp with Google Sheets, calls go out through its Apps Script UrlFetchApp.fetch() and events come back through its Apps Script web app doPost(e); authentication is Token stored in Script Properties and read into the Authorization header, and the setup below takes about 20 minutes. No official connector is involved: groups, Channels, status posts and template-free sends all go through one plain HTTPS call.

Data

What you can do with Google Sheets

Setup in Google Sheets

Events arrive through
Apps Script web app doPost(e)
Authentication
Token stored in Script Properties and read into the Authorization header
Time to first call
About 20 minutes
  1. Open Extensions then Apps Script from the sheet, and put your channel token in Script Properties rather than in the code, so a shared sheet never exposes it.

  2. Write a send function that reads a row, builds the JSON body, and calls UrlFetchApp.fetch with the Authorization header and muteHttpExceptions set to true so you can read error bodies.

  3. Write the result and the timestamp back into the row, so a re-run skips everything already sent instead of messaging people twice.

  4. Add a time-driven trigger that processes a small batch per run rather than the whole sheet, which keeps you inside both the script execution limit and a sane sending pace.

  5. For inbound events, deploy a second script as a web app with doPost, set access to anyone, and register that URL in Wapito.

Example flows

Add a row of customers to a group

A sheet holds numbers and a status column. A batched trigger reads the unprocessed rows, posts them to the group's participants endpoint, and writes back whether each person was added or merely invited.

POST /groups/{id}/participants Add participants to a group

curl --request POST \
  --url https://api.wapito.com/v1/groups/120363041234567890@g.us/participants \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"participants":["+15551234567","+15559876543"]}'

Check a column of numbers

A menu item runs a check over the selected range in small batches and writes yes or no into the next column with the date. The date is what stops the next run from re-checking numbers that were answered last month.

POST /contacts/check Check numbers for WhatsApp registration

curl --request POST \
  --url https://api.wapito.com/v1/contacts/check \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"phones":["+15551234567","+15559876543","+15550000000"]}'

Send a personalised message per row

A template in a named cell is merged with each row's fields and sent one row at a time, with a pause between sends. The message id and status are written back so a failed row can be retried without touching the rest.

POST /messages/text Send a text message

curl --request POST \
  --url https://api.wapito.com/v1/messages/text \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"to":"+15551234567","body":"Your order #4182 has shipped. Track it here: https://acme.example/t/4182","typing_time":3}'

Log inbound replies into the sheet

The doPost web app appends each inbound message event as a row, keyed on the chat id, so the same sheet that sent the campaign shows who replied without anyone exporting anything.

GET /messages/list/{chat_id} List messages in a chat

Beta

curl --request GET \
  --url 'https://api.wapito.com/v1/messages/list/15551234567@s.whatsapp.net?count=50&offset=0&from_me=true&time_from=1789372800000&time_to=1789459200000' \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN'

Receiving events

In Google Sheets the inbound side is the Apps Script web app doPost(e): it gives you the URL to register in Wapito.Every event Wapito delivers — an inbound message, a delivery receipt, a member joining a group, a number disconnecting — is one HTTPS POST to a URL you register, signed with the webhook's secret in the X-Wapito-Signature header. Verify that header against the raw request body before you act on anything, answer with a 2xx within the retry window, and do slow work afterwards.

Webhooks guide: events, envelope and signature Apps Script web app doPost(e) documentation

Step-by-step recipes for Google Sheets

What the official connector does instead

Google publishes no WhatsApp connector of any kind, official or otherwise, so every Sheets integration is somebody's Apps Script or a third-party add-on. Wapito is reached with a plain HTTPS call, which means there is no add-on to install and no extra party holding your data.

Wapito is an independent product. It is not affiliated with, endorsed by, sponsored by or certified by WhatsApp or Meta Platforms, Inc. WhatsApp is a trademark of Meta Platforms, Inc.

Frequently asked questions

Will I hit Apps Script quotas?

You can. Scripts have daily limits on outbound calls and a six-minute ceiling per execution, so a sheet with thousands of rows must be processed in batches with a status column that records progress. That design is also better for your number, because it paces the sending.

Is it safe to keep the token in the script?

Not in the code itself - anyone with edit access to the sheet can read it. Put it in Script Properties, which are tied to the script project rather than to the document, and remember that anyone who can edit the script can still run it, so control sharing accordingly.

Can the sheet receive messages as well as send them?

Yes, by deploying a second script as a web app and registering its URL with Wapito. Apps Script web apps do not give you the raw request body in a form that makes signature verification straightforward, so treat the URL itself as a secret and keep it out of shared documents.

Related

Try it on your own number

Create a channel, link a WhatsApp number by QR or pairing code, and call the API in a couple of minutes. The Sandbox plan is free and needs no card.