Scheduled Messages API
Schedule template-based WhatsApp sends from your CRM, ERP, or custom platform using API key authentication. ChatYug's background processor fires at the scheduled time; poll the report endpoint for per-recipient delivery status.
Prerequisites
- Active ChatYug API key (
Authorization: Bearer ck_…) - Automation permission enabled on the WABA (portal → Automation). Write endpoints return
AUTOMATION_ACCESS_DENIEDwithout it. - Template must be APPROVED in Meta before scheduling
- Valid
phoneNumberIdfor the sending number
Base URL
https://chatyug.com/api/external
Endpoints
| Method | Path | Purpose |
|---|---|---|
| POST | /scheduled-messages | Create ONE_TIME or RECURRING schedule |
| GET | /scheduled-messages | List schedules (filter by status, type, page) |
| GET | /scheduled-messages/:scheduleId | Schedule detail + recipients |
| GET | /scheduled-messages/:scheduleId/report | Delivery report |
| DELETE | /scheduled-messages/:scheduleId | Cancel pending schedule |
| POST | /scheduled-messages/upload-csv | Validate CSV recipients |
| POST | /scheduled-messages/:scheduleId/run-now | Queue immediate execution |
Create schedule
curl -X POST https://chatyug.com/api/external/scheduled-messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"scheduleName": "Monday promo",
"scheduleType": "ONE_TIME",
"templateName": "order_update",
"templateLanguage": "en",
"scheduledDate": "2026-07-25",
"scheduledTime": "10:30",
"timezone": "Asia/Kolkata",
"recipients": [
{ "phoneNumber": "919876543210", "variables": { "1": "Rahul", "2": "ORD-991" } }
]
}'
Timezone and time format
Default timezone is Asia/Kolkata. Use ISO date YYYY-MM-DD and 24-hour time HH:mm (or HH:mm:ss).
Recipient variables
Map keys in variables to template placeholders {{1}}, {{2}}, etc.
Recurring schedules
Set scheduleType to RECURRING and include recurrencePattern, recurrenceInterval, recurrenceDays, and optional recurrenceEndDate — same fields as the portal scheduler.
CSV upload
Multipart field csvFile. CSV must include a phone column (phone, Phone, or phone_number). Returns validated rows for use in the create payload.
Error codes
| Code | When |
|---|---|
AUTOMATION_ACCESS_DENIED | WABA lacks automation permission |
TEMPLATE_NOT_APPROVED | Template not approved in Meta |
VALIDATION_ERROR | Missing or invalid fields |
Portal alternative: Scheduled Messages in the portal offers the same scheduling with a UI. The External API is for integrators who want API-key-only access without portal login.