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_DENIED without it.
  • Template must be APPROVED in Meta before scheduling
  • Valid phoneNumberId for the sending number

Base URL

https://chatyug.com/api/external

Endpoints

MethodPathPurpose
POST/scheduled-messagesCreate ONE_TIME or RECURRING schedule
GET/scheduled-messagesList schedules (filter by status, type, page)
GET/scheduled-messages/:scheduleIdSchedule detail + recipients
GET/scheduled-messages/:scheduleId/reportDelivery report
DELETE/scheduled-messages/:scheduleIdCancel pending schedule
POST/scheduled-messages/upload-csvValidate CSV recipients
POST/scheduled-messages/:scheduleId/run-nowQueue 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

CodeWhen
AUTOMATION_ACCESS_DENIEDWABA lacks automation permission
TEMPLATE_NOT_APPROVEDTemplate not approved in Meta
VALIDATION_ERRORMissing 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.