Spreadsheet + WhatsApp

Integrate WhatsApp with Google Sheets

Google Sheets is Google's online spreadsheet editor, collaborative and at no cost, which runs in the browser and stores everything in Google Drive. Besides formulas and tables, it has Apps Script, a built-in JavaScript environment that lets you read rows, react to edits and call external APIs. It is this combination of a contact list organized in columns plus scripts that turns an ordinary spreadsheet into a small WhatsApp automation engine.

Why connect

People who work with lists of leads, customers or orders almost always keep everything in a Google Sheets spreadsheet: name in one column, phone in another, status next to it. Connecting that spreadsheet to ZapZap API lets you send WhatsApp messages straight from the rows, without copying number by number on your phone. You can notify customers about an appointment, send an order confirmation or follow up on a list of leads in minutes, marking in the sheet itself who has already received it. Since the sending comes from a managed instance with community warm-up and anti-ban features, you lower the risk of problems when messaging many contacts from the same spreadsheet.

Step by step

  1. 1

    Set up the spreadsheet with clear columns

    In Google Sheets, create a tab with the columns Name, Phone (in the format 5511999999999, with country and area code), Message and Status. Each row becomes a contact to be messaged. The Status column is used to mark Sent after each send.

  2. 2

    Open Apps Script

    In the top menu, click Extensions and then Apps Script. The code editor opens in a new tab, already linked to this spreadsheet. Delete the default content of the myFunction function to start clean.

  3. 3

    Store your credentials in Script properties

    In the editor, go to Project settings (gear icon) and, in the Script properties section, add ZAPZAP_KEY and ZAPZAP_SECRET with your x-api-key and x-api-secret from ZapZap API. That way the keys are not written in the code.

  4. 4

    Paste the script that reads the rows and calls UrlFetchApp

    In the editor, use SpreadsheetApp.getActiveSheet().getDataRange().getValues() to read the rows and UrlFetchApp.fetch() to send each contact to ZapZap API, passing the x-api-key and x-api-secret headers. Loop through the rows, skip anyone whose Status is already Sent and write Sent in the column after each response.

  5. 5

    Run it and create a menu or trigger

    Click Run and authorize the script in the Google popup (this is normal the first time). To make daily use easier, add an onOpen() that creates a custom menu in the spreadsheet, or set up a Trigger under Triggers to run on a schedule. Check the API's official docs at https://api.zapzapapi.com/llms.txt for the exact route and field names before going to production.

Example

// Apps Script (Extensions > Apps Script) : ILLUSTRATIVE example
// Check the exact route and fields at https://api.zapzapapi.com/llms.txt
function enviarWhatsApp() {
  const props = PropertiesService.getScriptProperties();
  const sheet = SpreadsheetApp.getActiveSheet();
  const linhas = sheet.getDataRange().getValues();

  for (let i = 1; i < linhas.length; i++) {
    const [nome, telefone, mensagem, status] = linhas[i];
    if (status === 'Enviado' || !telefone) continue;

    UrlFetchApp.fetch('https://api.zapzapapi.com/messages/send', {
      method: 'post',
      contentType: 'application/json',
      headers: {
        'x-api-key': props.getProperty('ZAPZAP_KEY'),
        'x-api-secret': props.getProperty('ZAPZAP_SECRET')
      },
      // exact fields in the docs: https://api.zapzapapi.com/llms.txt
      payload: JSON.stringify({ number: String(telefone), text: mensagem })
    });

    sheet.getRange(i + 1, 4).setValue('Enviado');
    Utilities.sleep(4000); // space out the sends
  }
}

Illustrative. The exact fields and endpoints are in the documentation.

Frequently asked questions

Do I need to know how to code to use Google Sheets with WhatsApp?

The basics help, but you do not need to build anything from scratch. Apps Script lives inside Google Sheets itself, under Extensions and Apps Script, and the example on this page already brings the structure ready: read the rows, call ZapZap API and mark the Status column. Just paste it, swap in your credentials and adjust the column names.

Is ZapZap API an official WhatsApp product?

No. ZapZap API is an unofficial WhatsApp solution, based on managed instances that you connect to your own number. Authentication uses x-api-key and x-api-secret, and sending and receiving happen via REST and per-event webhooks. That gives you the freedom to integrate directly with Google Sheets, with no approval process.

Am I at risk of being banned when messaging many contacts from the spreadsheet?

Any volume sending carries risk. ZapZap API instances go through community warm-up and have anti-ban features, which lowers the risk. Still, care on the spreadsheet side matters: use the Utilities.sleep function to space out the sends, personalize the text per row and avoid blasting hundreds of identical messages at once.

How much does it cost to connect Google Sheets to ZapZap API?

Google Sheets and Apps Script cost nothing. On ZapZap API, the cost is R$15 per active number per month, on the prepaid model, and there is a welcome credit (subject to the current campaign) so you can test the integration before going to production.

How do I know the exact route and field names of the API?

The code on this page is illustrative, to show the format of the call with the x-api-key and x-api-secret headers. The exact endpoint names and request body fields are in the documentation at https://api.zapzapapi.com/llms.txt. Check it before taking your script to production.

Start now

Create your account, connect a number in minutes and test the API with warm-up and anti-ban. R$15 per active number/month, prepaid, no lock-in.