Scheduling
Schedule messages for future delivery by adding a scheduled_for timestamp to any message request. Zend queues the message and sends it at the time you specify, so you can prepare reminders, campaigns, and time-sensitive notifications ahead of time.
Scheduling a message
Add scheduled_for — an ISO 8601 timestamp — to a standard message request. The message is queued and delivered at that time instead of immediately.
{
"to": "+233593152134",
"body": "Reminder: Your appointment is in 1 hour",
"preferred_channels": ["whatsapp"],
"template_id": "12345678912345",
"template_params": {
"appointment_time": "2:00 PM",
"location": "Main Office"
},
"scheduled_for": "2024-01-15T13:00:00Z"
}
Request fields
scheduled_forstring
ISO 8601 date-time for when the message should be delivered, e.g.
2024-01-15T13:00:00Z. Omit it to send immediately.Scheduling in bulk
Apply a single scheduled_for to a batch of messages. Every message in the messages array is delivered at the scheduled time.
{
"messages": [
{"to": "+233593152134", "body": "Happy Birthday! 🎉"},
{"to": "+233593152135", "body": "Happy Birthday! 🎉"},
{"to": "+233593152136", "body": "Happy Birthday! 🎉"}
],
"preferred_channels": ["whatsapp", "sms"],
"scheduled_for": "2024-01-15T09:00:00Z"
}
Cancelling a scheduled message
Cancel a scheduled message before it's sent using its id.
PUT/messages/{id}/cancel
curl -X PUT https://api.tryzend.com/messages/{id}/cancel \
-H "x-api-key: YOUR_API_KEY"
{
"success": true,
"message": "Message cancelled successfully"
}
Note
You can only cancel a message that hasn't been sent yet. Once delivery has started, cancellation no longer applies.