Developer guides
Send WhatsApp Message From Google Sheets With Apps Script
Send WhatsApp message from Google Sheets: a free Apps Script that sends one message per row from your own number, with an SMS version.


To send WhatsApp message from Google Sheets, you need something that reads each row and calls a WhatsApp API. Google's built-in Apps Script does the reading, and the Hypersender API sends from your own WhatsApp number. The script below takes about ten minutes to set up, sends one message per row, and writes the result back to the sheet.
There's an SMS version at the end, for customers who aren't on WhatsApp.
What you need
- A Google Sheet with three columns: Phone, Message and Status.
- A Hypersender account with your WhatsApp number linked by QR code. The 14-day trial is free.
- Your instance ID and API key from the dashboard.
Put phone numbers in international format, like +201000000002. The Message column can be plain text or a formula, such as ="Hi "&D2&", your order "&E2&" has shipped." to fill in names and order numbers from other columns. Leave Status empty.
Step 1: add the script
In the sheet, open Extensions → Apps Script, delete the sample code and paste this:
// Sends one WhatsApp message per row with Hypersender.
// Columns: A = Phone, B = Message, C = Status (the script fills it in).
const INSTANCE_ID = "your-instance-id";
function onOpen() {
SpreadsheetApp.getUi()
.createMenu("Hypersender")
.addItem("Send WhatsApp to new rows", "sendWhatsApp")
.addToUi();
}
function sendWhatsApp() {
const token = PropertiesService.getScriptProperties().getProperty("HYPERSENDER_API_KEY");
const sheet = SpreadsheetApp.getActiveSheet();
const rows = sheet.getDataRange().getValues();
for (let i = 1; i < rows.length; i++) { // row 1 is the header
const [phone, message, status] = rows[i];
if (!phone || !message || status) continue; // skip empty or already-sent rows
const chatId = String(phone).replace(/\D/g, "") + "@c.us";
const res = UrlFetchApp.fetch(
"https://app.hypersender.com/api/whatsapp/v2/" + INSTANCE_ID + "/send-text-safe",
{
method: "post",
contentType: "application/json",
headers: { Authorization: "Bearer " + token, Accept: "application/json" },
payload: JSON.stringify({ chatId: chatId, text: message }),
muteHttpExceptions: true,
}
);
const code = res.getResponseCode();
sheet.getRange(i + 1, 3).setValue(
code < 300 ? "Queued " + new Date().toLocaleString() : "Error " + code + ": " + res.getContentText().slice(0, 150)
);
}
}Replace your-instance-id with your instance ID.
Step 2: store the API key safely
Don't paste the key into the code, because anyone with edit access to the sheet can read the script. In the Apps Script editor, open Project Settings, scroll to Script properties, and add one called HYPERSENDER_API_KEY with your key as the value.
Step 3: send
Reload the sheet. A Hypersender menu appears next to Help. Click Send WhatsApp to new rows. The first time, Google asks you to authorise the script to edit the sheet and connect to an external service; allow it.
Each row's Status changes to "Queued" with the time, or to the error message if something was wrong, such as a missing country code. Hypersender then sends the messages from your number. The send-text-safe endpoint shows typing and waits a moment between messages, so a long list goes out at a human pace.
Run it again whenever you add rows. Rows with a status are skipped, so nobody gets a message twice.
Send SMS from Google Sheets instead
For customers without WhatsApp, the same sheet can send SMS from your own Android phone. Add an SMS instance, link the phone with the Hypersender SMS app, and change the request in the loop:
const SMS_INSTANCE_ID = "your-sms-instance-id"; // add this at the top
const res = UrlFetchApp.fetch(
"https://app.hypersender.com/api/sms/v1/" + SMS_INSTANCE_ID + "/send-message",
{
method: "post",
contentType: "application/json",
headers: { Authorization: "Bearer " + token, Accept: "application/json" },
payload: JSON.stringify({ to: String(phone), content: message, request_id: "sheet-row-" + (i + 1) }),
muteHttpExceptions: true,
}
);The request_id makes a repeated run harmless: the same row, number and text won't be sent twice. The SMS plan has a 28-day free trial, then costs $7.99 a month per phone, and your carrier bills each text on your plan.
Before you send to a list
A spreadsheet lets you message hundreds of people with one click, and that's exactly how numbers get banned. Send only to people who gave you their number and expect to hear from you, such as customers with an order or a booking. Read how to send bulk messages on WhatsApp for the opt-in and pacing rules, and WhatsApp message limits for the caps on new contacts.
Prefer no code?
If you'd rather not touch Apps Script, an n8n workflow can watch the sheet for new rows and send each one with the Hypersender node. Make and Zapier work the same way through a webhook step, covered in the Zapier and Make guide.





