Price a text
quote_site_message
Works out what one text would cost before it is sent.
It gives the price the send form in the Messages tab shows. credits is null when the number or its country cannot be priced. segments is how many SMS parts the text takes, and an emoji or a character outside the plain SMS alphabet makes each part shorter. contactFee is true for the first text to that number this calendar month, which adds a small fee once. includedCredits is the part of the price the credits for texts the plan includes this calendar month cover, included is true when they cover all of it so the text costs the workspace nothing, and includedLeft is how many included credits are left. planRequired is true for a United States number on Free, which is refused. See Prices and credits.
Request
Call it with a POST to https://api.modulify.ai/v1/quote_site_message, sending the inputs below as a JSON object. The token needs the config:read scope.
It only reads and changes nothing, so retrying it is safe.
curl -X POST https://api.modulify.ai/v1/quote_site_message \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"projectId":"PROJECT_ID","template":"TEMPLATE","to":"TO"}'Over MCP, the same method is the quote_site_message tool.
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. |
Response
Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.