Send a text
send_site_message
Sends one text from a site to one phone number with one of its templates.
It is a real text that reaches a real person, and its template must be approved. Each site's plan includes credits for texts every calendar month, 2 on Free, 20 on Starter, 20 on Pro and 40 on Enterprise. Each text takes its own price from them, so texts to expensive countries use them up sooner, and what they do not cover is charged in credits to the workspace. It is refused while texting is off, to a country the site may not text, to a number that is blocked or replied STOP, to a US number while the workspace is below Pro (code plan-required), to a US number before the site's business is registered (code registration-required, see get_site_message_registration), to a US number while that registration is in review (code sender-not-ready, which clears once it is approved), to a country marked Registration needed in Countries until its registration is approved (codes registration-required and sender-not-ready), to a country marked Not available (code country-unavailable), and past 30 texts a minute, 5 texts to one number a day or 20 credits a day on Pro. Pass an idempotencyKey so that sending again sends nothing new. The tool tells the client to send only a text you asked for, to a number you gave, and to check both with you first. See Send a text.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
template |
string | Yes | The template key, from list_site_message_templates. |
to |
string | Yes | The phone number in international format, such as +14155551234. |
variables |
object | No | The value of each placeholder, keyed by its name. site is filled with the site's name on its own. |
channel |
string | No | Always sms, the default: texts go out as SMS only. |
idempotencyKey |
string | No | Any unique string for this text. Sending again with the same key sends nothing new, unless the first text failed before it went out, as with a provider error: then it is sent again. |