To send texts from Google Sheets, add an Apps Script that reads each row, calls POST /v1/messages with UrlFetchApp, and writes the result back to a status column. A sheet makes a handy control panel for small lists, appointment reminders and one-off notices, because the people who own the data can already edit it. What makes the integration safe is what you add around the send: a consent column, an opt-out check and a key that stops a rerun from texting anyone twice.
We make Ready, so the example uses the Ready REST API and only the request shape we document. If you want the minimal version first, our post on sending SMS from Google Apps Script covers a single call. This post builds the sheet around it.
What you need before the first request
Four things stand between you and a delivered text.
- An API key. Ready authenticates with an
X-API-Keyheader. Store it in Script Properties, not in a cell and not in the code. - A card and a number. A card on file and a number of your own are required to send, and the number is $2 a month. To build first, create a test key (Settings, Developers, Environment: Test). It simulates every send, so nothing is charged.
- Consent. Each request carries
consent_attested: true, your promise that the recipient agreed to texts. In a sheet, that promise should be backed by a column, which the script checks row by row. - A plan for registration. An account can send up to 500 texts a calendar month until its business is verified and its registration is paid for. Most approvals take 1 to 14 days. Our 10DLC explainer for SaaS platforms covers the why.
Every text is charged from the first one: each segment costs $0.0075 plus a $0.0045 carrier fee. Screening, the optional scrub and number validation checks, is extra when you switch it on.
Lay out the sheet
Put a header row in row 1 and give each column one job. A layout that works:
| Column | Header | Who fills it | Purpose |
|---|---|---|---|
| A | Phone | You | The number, ideally in E.164 like +12125550199 |
| B | Message | You | The text to send |
| C | Consent | You | The word yes only if the person agreed to texts |
| D | Do not text | You or the script | Any value here means skip the row |
| E | Key | Script | One UUID per row, written before the send |
| F | Status | Script | sent, skipped, retry or failed |
| G | Detail | Script | The HTTP code and the start of the response |
The script writes columns E to G, and you never hand-edit them. Consent is a column you maintain from your real records, such as the signup form or CRM where the person opted in. Ready doesn't store per-contact consent for you, so the sender keeps it. The sheet is only as honest as that column.
For phone numbers, store them as text and in E.164 where you can. A 10-digit US number is treated as +1, but Sheets will happily turn a number with a leading plus sign into a formula or drop a leading zero. Our post on E.164 phone number formatting for SMS APIs covers the traps.
Store the key and add a menu
Open Extensions, then Apps Script. Save your API key once from the editor with a throwaway function, then delete that function.
function saveKey() {
PropertiesService.getScriptProperties().setProperty('READY_API_KEY', 'paste-your-key-here');
} Run saveKey once, then remove the line with the real key from the editor. Script Properties aren't visible in the sheet, so people who can view the spreadsheet can't read the key from a cell. Anyone who can edit the script can still read it, so share edit access sparingly.
Next, a menu so a person starts each run on purpose. This is also why the script doesn't use an onEdit trigger. Simple triggers can't call external services, and a text that fires because someone fixed a typo in a cell is a bad surprise.
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Texting')
.addItem('Send pending rows', 'sendPendingRows')
.addToUi();
} Send each eligible row
The core function walks the rows and applies three gates before any call: the Consent column must say yes, the Do not text column must be empty, and the row must not already be marked sent. A row that passes gets a key written to column E first, so a crash or a timeout leaves the key behind for the next run.
const MESSAGES_URL = 'https://api.tryready.com/v1/messages';
function sendPendingRows() {
const lock = LockService.getScriptLock();
if (!lock.tryLock(10000)) {
SpreadsheetApp.getUi().alert('Another run is in progress.');
return;
}
try {
const sheet = SpreadsheetApp.getActiveSheet();
const rows = sheet.getDataRange().getValues();
const apiKey = PropertiesService.getScriptProperties().getProperty('READY_API_KEY');
for (let i = 1; i < rows.length; i++) {
const [phone, message, consent, doNotText, key, status] = rows[i];
const rowNumber = i + 1;
if (status === 'sent') continue;
if (!phone || !message) continue;
if (String(consent).trim().toLowerCase() !== 'yes' || doNotText) {
sheet.getRange(rowNumber, 6).setValue('skipped');
continue;
}
const idempotencyKey = key || Utilities.getUuid();
sheet.getRange(rowNumber, 5).setValue(idempotencyKey);
SpreadsheetApp.flush();
const result = sendOne(apiKey, String(phone), String(message), idempotencyKey);
sheet.getRange(rowNumber, 6, 1, 2).setValues([[result.status, result.detail]]);
SpreadsheetApp.flush();
}
} finally {
lock.releaseLock();
}
} The lock matters more than it looks. Without it, two people clicking the menu item at once would process the same rows in parallel. The flush calls make Sheets commit the key to the cell before the network call, so the key survives even if the script is killed mid-run.
The call itself
UrlFetchApp.fetch does the POST. Set muteHttpExceptions to true so a 4xx or 5xx comes back as a response you can read instead of an exception, and keep the same key on a retry.
function sendOne(apiKey, phone, message, idempotencyKey) {
const options = {
method: 'post',
contentType: 'application/json',
headers: { 'X-API-Key': apiKey, 'Idempotency-Key': idempotencyKey },
payload: JSON.stringify({ to: phone, body: message, consent_attested: true }),
muteHttpExceptions: true,
};
for (let attempt = 1; attempt <= 3; attempt++) {
let response;
try {
response = UrlFetchApp.fetch(MESSAGES_URL, options);
} catch (err) {
Utilities.sleep(1000 * attempt);
continue;
}
const code = response.getResponseCode();
const text = response.getContentText();
const detail = code + ' ' + text.slice(0, 200);
if (code >= 200 && code < 300) return { status: 'sent', detail: detail };
if (code === 409 && text.indexOf('idempotency_in_progress') !== -1) {
Utilities.sleep(2000 * attempt);
continue;
}
if (code >= 500) return { status: 'check', detail: detail };
return { status: 'failed', detail: detail };
}
return { status: 'retry', detail: 'No answer. Run again; the same key is reused.' };
} Here's what each outcome means for the row.
- sent: the API accepted the text. The row is skipped on every later run.
- retry: no answer arrived, for example a timeout. The key stays in column E, so the next run reuses it and can't double-send.
- check: a 5xx. A 5xx is stored under the key and replayed, so the same key returns the same error and sends nothing. Look at
GET /v1/messagesto see whether the text went out. If it didn't, clear the Key cell so the next run makes a new key. - failed: a refusal such as a bad number or an opted-out contact. Read the Detail column, fix the row, and clear Status to try again with a new key.
For exact response fields and error bodies, use the messages API reference and the error codes page. Our post on idempotency keys that stay stable across retries explains the design in more depth.
Handle opt-outs before they happen
When a contact replies STOP, Ready blocks that number in the sub-account that received it, and later sends to it are refused up front and not charged. That protects you, but your sheet doesn't know it happened, so the row will keep failing every run. Two habits fix that.
- Mirror the opt-outs into your sheet. Check
GET /v1/opt-outs/:phonefor a number before you send from another tool, and put a value in the Do not text column when the answer says the person opted out. The plainGET /v1/opt-outslist covers only this account's opted-out contacts, so use the per-number check when it matters. The opt-outs API docs show the response. - Record opt-outs that arrive by other routes. If someone asks by email or phone to stop, add the number to the Ban list with
POST /contacts/ban-listand mark the row in the sheet. Our post on handling SMS opt-outs covers the whole loop.
Don't text anyone for whom the Consent column is blank, and don't paste in a purchased or scraped list. The consent column is only a sign you're being careful if it reflects real opt-ins. Our post on documenting SMS consent covers what to keep.
Quotas and limits
Apps Script isn't built for large sends, and Google enforces limits on how many URL fetch calls an account can make in a day and how long a single execution can run. The numbers differ between consumer and Workspace accounts and Google changes them, so check Google's current quota page for Apps Script before you plan a big run, and don't copy a figure from a blog post.
In practice, three habits keep you inside any limit:
- Send in batches. Process a fixed number of rows per run, and stop cleanly when you reach it. Rows left without a status get picked up next time.
- Watch the clock. Record the start time and stop the loop a safe distance before the execution limit, so the script ends on its own terms instead of being cut off mid-row.
- Use the bulk endpoint for one message to many people.
POST /v1/messages/bulksends the same text to a list, with at most 100 recipients per call, so one fetch covers many contacts.
Carriers also limit how fast a registered campaign can send, roughly 1 to 4 segments per second for a fresh standard campaign with no vetting. A sheet-driven send won't come close to that ceiling, but the Utilities.sleep pauses above keep you polite in any case.
A worked cost example
Assume a sheet sends 500 single-segment appointment reminders in a month, with screening off. That's 500 segments, and the text bill is 500 × ($0.0075 + $0.0045), plus $2 for the number. Keep reminders to plain characters, since one emoji drops a segment from 160 characters to 70.
Ready's all-in prices per segment include the carrier fee but not screening: Scrub lists and Number validation, the two switches in Settings under Compliance, each add $0.003 per segment when switched on, shown as screening on your bill, and both are off by default. Unless you turn the opt-out footer off, the first text to each contact, and one again from time to time, also gets "Reply STOP to opt out" and your business name if the message does not already have them, so a text close to the segment limit can bill one more segment.
Accounts opened before 17:55 UTC on November 12, 2026 keep their signup prices, shown under Billing, and so do the sub-accounts they open.
Ready's all-in price per segment includes the carrier fee but not screening. Scrub lists and Number validation, the two switches in Settings under Compliance, each add $0.003 per segment when switched on, shown as screening on your bill.
Where to go next
Two limits are worth knowing before you build more on a sheet. Quiet hours apply to API texts too: one in the recipient's quiet hours is held only if the window opens within 24 hours, and otherwise it comes back as 409 QUIET_HOURS_BLOCK, which the script above marks as failed. And a sheet can't tell you whether a text was delivered. For that, Ready calls a webhook you host. Apps Script web apps don't expose request headers, so you can't verify the webhook signature there, and a small service in front of the sheet is the better receiver. Our post on receiving SMS replies and delivery events by webhook covers it, and the API quickstart walks through a key, a first send and a webhook.
Frequently asked questions
Can Google Sheets send SMS without code?
Not by itself. Sheets has no built-in texting, so you need a short Apps Script that calls the API, as above. Once it's set up, anyone who can edit the sheet can send from it with a menu click.
How do I stop the script from texting someone twice?
Write one idempotency key per row before the send, and reuse it on any retry. The Status column then marks finished rows so later runs skip them. If a retry is needed after a timeout, the stored key means the second request can't send a second text.
Where should the consent column come from?
From your real records: the signup form, checkout box or CRM field where the person agreed to texts. The sheet column mirrors that source and should never be filled in by guesswork. Ready doesn't store per-contact consent for API sends, so you keep the proof.
Does Apps Script have limits on how many texts I can send?
Yes. Google limits URL fetch calls and execution time, and the limits differ by account type. Check Google's current quota documentation, send in batches, and stop the loop before the time limit so a run ends cleanly.