30409: This message cannot be canceled
MESSAGING
ERROR
This error occurs when you try to cancel a message that is no longer in the scheduled state. Twilio lets you cancel a scheduled message by updating the Message resource and setting Status to canceled. The canceled status applies only to messages scheduled with a Messaging Service.
- You attempted to cancel the message after it had already moved past
scheduled. Cancellation applies only to scheduled messages, so this is the only point at which cancellation is available. - The message was not created as a scheduled message with a Messaging Service. The
canceledstatus is only available for scheduled messages sent with a Messaging Service. - The message had already reached a later lifecycle state such as
queued,sending,sent,delivered,failed, orundelivered. In that case, canceling it through theMessageresource is no longer available.
- Cancel the message while it is still
scheduledby updating theMessageresource and settingStatustocanceled. - Check the current
Statusof theMessageresource before sending the cancellation request. If the status is no longerscheduled, create a new message instead of trying to cancel the existing one. - Use Messaging Service scheduled messages when you need cancellation support, since the documented cancellation flow applies to that message type.