Texting at night
Quiet hours hold texts until morning in the contact’s time zone. Texting at night (Settings → Compliance, in the Sending windows & auto-reply card) lets replies and follow ups to people who texted the account before go out at night instead. It is set per account: an agency or platform sets it for each sub-account with X-Sub-Account-Id. Opt-outs and scrubbing are on Opt-outs and scrubbing.
#Every sub-account at once
There is no single call that changes all of your sub-accounts. Make one call each: page through List sub-accounts with before_id while has_more is true, and for each id send POST /v1/compliance/night-texting with that id as X-Sub-Account-Id. Turning it off needs only {"enabled": false}. Turning it on needs the confirmation_text as well, and records that agreement for each sub-account, so only do it for sub-accounts whose contacts at night asked to hear from them. Use the owner’s or an admin’s key: a teammate’s key gets OWNER_ONLY. Read each result back with Get texting at night.
const base = 'https://api.tryready.com/v1';
const h = { 'X-API-Key': process.env.READY_API_KEY, 'Content-Type': 'application/json' };
let before = '';
for (;;) {
const page = await (await fetch(`${base}/sub-accounts?limit=200${before}`, { headers: h })).json();
for (const sub of page.data) {
await fetch(`${base}/compliance/night-texting`, {
method: 'POST',
headers: { ...h, 'X-Sub-Account-Id': String(sub.id) },
body: JSON.stringify({ enabled: false }),
});
}
if (!page.has_more) break;
before = `&before_id=${page.next_before_id}`;
}
Endpoints
#Get texting at night
Whether the account’s Texting at night setting is on (Settings → Compliance, in the Sending windows & auto-reply card), and the words a caller agrees to when it turns it on. Add X-Sub-Account-Id to read one of your sub-accounts.
Returns
data.enabledbooleantruewhile texting at night is on. Off by default. It stays on until someone turns it off.data.signed_atISO 8601 string | null- When it was turned on, or
nullwhile off. data.attestation_textstring- The statement you agree to when you turn it on.
data.attestation_versionstring- Which wording
attestation_textis. data.required_phrasestring- The
confirmation_textthat turning it on needs:I UNDERSTAND.
curl "https://api.tryready.com/v1/compliance/night-texting" \
-H "X-API-Key: $READY_API_KEY"
const res = await fetch('https://api.tryready.com/v1/compliance/night-texting', {
headers: {
'X-API-Key': process.env.READY_API_KEY,
},
signal: AbortSignal.timeout(35 * 1000),
});
const json = await res.json().catch(() => ({}));
if (!res.ok || json.success === false) {
throw new Error(`${res.status}${json.error_code || json.code ? ' ' + (json.error_code || json.code) : ''}: ${json.error || json.message || res.statusText} (request ${res.headers.get('x-request-id')})`);
}
import os, requests
r = requests.get(
"https://api.tryready.com/v1/compliance/night-texting",
headers={"X-API-Key": os.environ["READY_API_KEY"]},
timeout=35,
)
data = r.json() if r.headers.get("content-type", "").startswith("application/json") else {}
if not r.ok or data.get("success") is False:
raise RuntimeError(f'{r.status_code} {data.get("error_code") or data.get("code") or ""}: {data.get("error") or data.get("message") or r.reason} (request {r.headers.get("x-request-id")})')
{
"success": true,
"data": {
"enabled": false,
"signed_at": null,
"attestation_text": "Everyone this account texts at night asked us to text them, or bought from us or asked about our business recently. Night texts are replies or follow ups to that, not new promotions to cold contacts. We choose what, when and who we text, and we’re responsible for following state laws.",
"attestation_version": "night-v1-2026-11-18",
"required_phrase": "I UNDERSTAND"
}
}
#Turn texting at night on or off
While it’s on, a 1:1 text or an API text (POST /v1/messages) to a contact who has texted the account before can go out during quiet hours. Campaigns, drips, automations, /v1/messages/bulk and texts to people who never texted the account still wait for morning. So do texts to Maryland, Mississippi, Pennsylvania, Florida and Oklahoma numbers, texts to Utah on Sundays and holidays, numbers whose time zone Ready can’t tell, and the extra quiet hours the account set itself. Needs the account owner’s key or an admin’s. An agency or platform turns it on for one of its sub-accounts by adding X-Sub-Account-Id. The setting is per account: a sub-account doesn’t get its parent’s setting, and turning it on for one sub-account changes nothing on the others.
attestation_text as the account’s signed statement, with the time, your IP address and the key used. Only send "enabled": true for an account whose contacts at night are people who asked to hear from it.Parameters
X-Sub-Account-Idinteger · headerOptional- The sub-account to change, one you manage (Sub-accounts). Leave it out to change your own account.
enabledbooleanRequiredtrueturns it on,falseturns it off. A value that isn’ttrueleaves it off.confirmation_textstringRequired to turn onI UNDERSTAND, your agreement toattestation_text. Turning it off needs nothing.
Returns
The same data as Get texting at night, as it is now.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | attestation_required | "enabled": true without "confirmation_text": "I UNDERSTAND". Nothing changed. |
| 403 | OWNER_ONLY | The key belongs to a teammate who isn’t the owner or an admin. |
| 403 | sub_account_forbidden | X-Sub-Account-Id names an account that isn’t one of your sub-accounts. Nothing changed. |
| 404 | sub_account_not_found | No account has that X-Sub-Account-Id. |
| 500 | internal_error | Failed on our side. Read it back with Get texting at night, then try again. |
curl -X POST "https://api.tryready.com/v1/compliance/night-texting" \
-H "X-API-Key: $READY_API_KEY" \
-H "X-Sub-Account-Id: 12345" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"confirmation_text": "I UNDERSTAND"
}'
const res = await fetch('https://api.tryready.com/v1/compliance/night-texting', {
method: 'POST',
headers: {
'X-API-Key': process.env.READY_API_KEY,
'X-Sub-Account-Id': '12345',
'Content-Type': 'application/json',
},
body: JSON.stringify({ "enabled": true, "confirmation_text": "I UNDERSTAND" }),
});
const json = await res.json().catch(() => ({}));
if (!res.ok || json.success === false) {
throw new Error(`${res.status}${json.error_code || json.code ? ' ' + (json.error_code || json.code) : ''}: ${json.error || json.message || res.statusText} (request ${res.headers.get('x-request-id')})`);
}
import os, requests
r = requests.post(
"https://api.tryready.com/v1/compliance/night-texting",
headers={"X-API-Key": os.environ["READY_API_KEY"], "X-Sub-Account-Id": "12345"},
json={"enabled": True, "confirmation_text": "I UNDERSTAND"},
timeout=30,
)
data = r.json() if r.headers.get("content-type", "").startswith("application/json") else {}
if not r.ok or data.get("success") is False:
raise RuntimeError(f'{r.status_code} {data.get("error_code") or data.get("code") or ""}: {data.get("error") or data.get("message") or r.reason} (request {r.headers.get("x-request-id")})')
{
"success": true,
"data": {
"enabled": true,
"signed_at": "2026-11-25T18:04:11.000Z",
"attestation_text": "Everyone this account texts at night asked us to text them, or bought from us or asked about our business recently. Night texts are replies or follow ups to that, not new promotions to cold contacts. We choose what, when and who we text, and we’re responsible for following state laws.",
"attestation_version": "night-v1-2026-11-18",
"required_phrase": "I UNDERSTAND"
}
}
{
"success": false,
"error": "Send confirmation_text \"I UNDERSTAND\" to agree to: Everyone this account texts at night asked us to text them, …",
"code": "attestation_required",
"error_code": "attestation_required",
"required_phrase": "I UNDERSTAND",
"attestation_text": "Everyone this account texts at night asked us to text them, …"
}