To send an SMS from Google Sheets, write an Apps Script function that calls your SMS provider's REST API with UrlFetchApp.fetch, keep the API key in Script Properties, and write a "sent" marker back to the row. That last part matters most: Apps Script has no built-in guard against running a function twice.

We make Ready, so the example uses the Ready REST API and only the request shape we document. It suits internal tools, small notification jobs and prototypes. For a customer-facing product, a real backend is the better home.

Store the key in Script Properties

In the Apps Script editor, open Project Settings and add a script property named READY_API_KEY. Read it in code with PropertiesService.getScriptProperties().getProperty("READY_API_KEY"). Don't paste the key into a cell or the code. Anyone with edit access to the project can read script properties, so share the project carefully, and see API key security for rotation.

Send one text

function sendText(to, body, idemKey) {
  const key = PropertiesService.getScriptProperties().getProperty("READY_API_KEY");
  const res = UrlFetchApp.fetch("https://api.tryready.com/v1/messages", {
    method: "post",
    contentType: "application/json",
    headers: { "X-API-Key": key, "Idempotency-Key": idemKey },
    payload: JSON.stringify({ to: to, body: body, consent_attested: true }),
    muteHttpExceptions: true,
  });
  return { status: res.getResponseCode(), text: res.getContentText() };
}

muteHttpExceptions makes the call return error responses instead of throwing, so you can read the status and decide what to do. JSON.stringify handles quoting. The response fields are in the messages API reference.

Send from a sheet, once per row

Suppose column A holds a phone number in E.164 format, column B the message and column C the status. This function texts every row with an empty status and writes the outcome back:

function sendPending() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const rows = sheet.getDataRange().getValues();
  for (let i = 1; i < rows.length; i++) {
    const [phone, message, status] = rows[i];
    if (status || !phone) continue;
    const r = sendText(String(phone), String(message), "sheet-" + sheet.getSheetId() + "-" + Utilities.base64EncodeWebSafe(Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_256, i + "|" + phone + "|" + message)));
    sheet.getRange(i + 1, 3).setValue(r.status === 200 || r.status === 201 ? "sent" : "error " + r.status);
    SpreadsheetApp.flush();
    Utilities.sleep(300);
  }
}

Three habits keep this safe. The idempotency key comes from the sheet, the row number and the row's phone and message, so a rerun can't text the same row twice even if the status write failed, two rows with the same number and message each get their own text, and a new message pasted into an old row gets a new key. Keep the key tied to the message: a key reused for a different message replays the first result and sends nothing. flush() saves the status right away, so a timeout partway through doesn't lose progress. And the short sleep keeps you under the per-second limits; more in our post on SMS API rate limits.

Quotas to know

Apps Script limits how long a single run can take and how many outbound fetches you can make per day, and the limits differ between free Google accounts and Workspace. Check the current numbers in Google's quota documentation instead of trusting a blog post. For a list of thousands, don't loop over rows. Use the bulk endpoint, which takes up to 100 numbers per call with one body, or move to a proper job runner. The bulk docs list the rules.

Triggers

Use a time-driven trigger for a daily job, or an installable onEdit trigger when a status change should send a text. Simple onEdit triggers can't call external services, so the installable kind is required. Keep the trigger function idempotent, since Google can run triggers more than once.

Consent and compliance

A sheet of numbers is not a consent record. Only text people who agreed to receive texts, keep that proof somewhere you can find it, and honor STOP replies. Ready blocks a number that replied STOP, and a refused send comes back as an error you should mark in the sheet. Our consent record schema post shows what to store. Sending beyond 500 texts a month needs 10DLC registration, and most approvals take 2 to 7 days.

Cost

A segment on the Standard rate is $0.0075 plus a $0.0045 carrier fee, excluding optional screening. See pricing.

FAQ

Can Google Sheets send SMS without code?

Not by itself. You need either Apps Script, as above, or a no-code connector such as the ones in our SMS automation guide.

Why does my script text some rows twice?

Usually because the status wasn't saved before a timeout or a second trigger run. Write the status immediately and use a row-based idempotency key.

Is Apps Script fine for production?

For internal alerts and small jobs, yes. For a product that texts your customers, use a backend with queues, logging and proper secrets management.

The short version

UrlFetchApp, Script Properties, a status column and a row-based idempotency key. For a full server version, see sending SMS with Node.js.