
The short answer: send POST /v1/sms/messages/{id}/cancel with the id of the scheduled SMS, before its time comes. Only your own account's messages that are still scheduled can be cancelled. If the credits had already been taken, they go back to the balance.
The usual case: the customer paid before the reminder
|
|
|
|
The same goes for a rebooked appointment, a delivery that changed day or postponed maintenance: cancel the old notice and schedule a new one. How to schedule: scheduling notices through the API.
The possible answers
| Answer | What it means |
| Success | The SMS is cancelled. credits_returned says how many credits came back; since a scheduled message is usually only charged when it goes out, this is often zero. |
| 409 with not_cancellable | Too late: the message already went out, is going out, or was cancelled before. |
| 404 | There is no message with that id in this account. |
| Do not leave cancelling to the last minute. When the time comes the message enters sending and can no longer be cancelled. Cancel as soon as the reason for the notice goes away. |
Retrying safely
Send the Idempotency-Key header on the cancel request too: if the connection drops and your system repeats it, you get the same answer. With a sandbox_ key the API checks everything and changes nothing, which is handy for testing the flow.
| To confirm the result, look up GET /v1/sms/messages/{id}: the status says whether it was cancelled, and charged says whether credits were ever taken. |
|
Want notices that call themselves off when they are no longer needed? See the API page. See the API page |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon) See plans |











