Cancel scheduled SMS
POST/api/v1/sms/cancel
Cancel messages you scheduled through the API, as long as they are still waiting for their delay time. A cancelled message is removed and is never sent. Use the apiMessageId from messageIds[].apiMessageId in the response from Send SMS or Send multiple SMS messages.
You can cancel 1 to 100 messages in one request. Each id is handled on its own and ends up in either cancelled or failed, the latter with a reason. Only messages scheduled through the API can be cancelled here, not messages scheduled in the HelloSMS web app or by campaigns. Messages are looked up on the account of the API credentials you use, so use the credentials of the account that sent the message.
The request succeeds (200, status: success) when at least one message was cancelled, even if others failed, so check failed on a 200 too. It returns 400 with status: failed only when nothing was cancelled. The 400 response then still carries cancelled and failed, so you can see why each id failed.
Request
- application/json
- Body
- Cancel one message
- Cancel several messages
Body
The apiMessageId of the scheduled message, or an array of up to 100 of them.
- string
- string[]
apiMessageId objectrequired
The id of the scheduled message to cancel, or an array of up to 100 ids. Each id is the apiMessageId from messageIds[] in the response from Send SMS or Send multiple SMS, and is at most 50 characters.
Possible values: <= 50 characters
{
"apiMessageId": "api-638ca85eb5c808.02026978"
}
{
"apiMessageId": [
"api-638ca85eb5c808.02026978",
"api-638ca85eb647c8.05808165"
]
}
Responses
- 200
- 400
- 401
At least one message was cancelled. Check failed for any ids that could not be cancelled.
Nothing was cancelled. Either the request was invalid, or every id is listed in failed with a reason.
Unauthorized.