Preview message cost
preview_message_costCalculate SMS/MMS cost before sending: get segment count, unit price, total cost, and destination country without sending the message or incurring charges.
Instructions
Price one message before sending (GET /api/v1/sms/messages/cost-preview): segment count, unit cost, total cost, currency and destination country for a sender, recipient and text. Sends nothing and is not billed. Use it before send_message to show the user the price; the real charge is per recipient and per segment, so multiply by the number of recipients. RCS cannot be previewed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient, E.164; its country decides the unit price. | |
| from | Yes | Your Vobiz messaging number, E.164 (see list_messaging_numbers). | |
| text | No | Message body; its length and characters decide the segment count. | |
| channel | No | Channel to price: sms (default) or mms. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | True on success; false when the result is an error (then error, message and retryable are set). | |
| preview | No |