Overview
The Scheduled Messages API allows you to schedule messages to be sent at specific times or on a recurring schedule. Messages are processed by a background job queue.List Scheduled Messages
GET/scheduled
Retrieve all scheduled messages for the authenticated user with pagination.
Query Parameters
Filter by status:
pending, paused, completed, or allFilter by schedule type:
once, recurring, or allPage number
Response
Paginated scheduled messages
Array of scheduled message objects
Scheduled message ID
Associated webhook ID
Associated template ID (nullable)
Message payload (same as send message)
Either
once or recurringISO timestamp for one-time messages
Recurrence configuration for recurring messages
User’s timezone (IANA format)
ISO timestamp of next scheduled send
Status:
pending, paused, completedNumber of times message has been sent
Maximum sends before completing (nullable)
Current page number
Items per page (20)
Total scheduled messages
Response
Create Scheduled Message
POST/scheduled
Schedule a new message for one-time or recurring delivery.
Request Body
Webhook ID to send message through
Optional template ID to use
Either
once or recurringISO 8601 timestamp (required if schedule_type is
once)Recurrence configuration (required if schedule_type is
recurring)Frequency:
daily, weekly, monthlyTime in HH:MM format (24-hour)
Array of day numbers (0-6, Sunday=0) for weekly frequency
Day of month (1-31) for monthly frequency
User’s timezone in IANA format (e.g.,
America/New_York, Europe/London)Maximum number of times to send (for recurring). Null = unlimited
File attachments (multipart/form-data). Max 10 files, 10MB each
Response
Returns302 redirect to /scheduled with success message.
Update Scheduled Message
PUT/PATCH/scheduled/{id}
Update a scheduled message. Only allowed if the message hasn’t been sent yet (send_count is 0).
Path Parameters
Scheduled message ID
Request Body
Same structure as Create Scheduled Message. Additional fields:Array of file IDs to remove
Response
Returns302 redirect to /scheduled with success message.
Delete Scheduled Message
DELETE/scheduled/{id}
Permanently delete a scheduled message and all associated files.
Path Parameters
Scheduled message ID
Response
Returns302 redirect to /scheduled with success message.
Pause Scheduled Message
POST/scheduled/{id}/pause
Pause a scheduled message to prevent it from being sent.
Path Parameters
Scheduled message ID
Response
Returns302 redirect back with success message.
Status changes from pending to paused.
Resume Scheduled Message
POST/scheduled/{id}/resume
Resume a paused scheduled message.
Path Parameters
Scheduled message ID
Response
Returns302 redirect back with success message.
Status changes from paused to pending and next_send_at is recalculated.
Recurrence Patterns
Daily Recurrence
Sends every day at the specified time.Weekly Recurrence
Sends on specific days of the week.Monthly Recurrence
Sends on a specific day of each month.Timezone Support
All scheduled messages respect the user’s timezone. Times are stored in UTC but calculated based on the provided timezone.Common Timezones
America/New_York- Eastern Time (US)America/Chicago- Central Time (US)America/Denver- Mountain Time (US)America/Los_Angeles- Pacific Time (US)Europe/London- GMT/BSTEurope/Paris- CET/CESTAsia/Tokyo- Japan Standard TimeAustralia/Sydney- AEST/AEDTUTC- Coordinated Universal Time
Use IANA timezone database names. See full list.
Status Lifecycle
File Attachments
Scheduled messages can include file attachments:- Files are stored locally in
storage/app/scheduled_messages/{id}/ - Maximum 10 files per message
- Maximum 10MB per file
- Supported formats: jpg, jpeg, png, gif, webp, mp4, mov, avi
- Files are automatically deleted when message is deleted
File Upload
Background Processing
Scheduled messages are processed by Laravel’s queue system:- A scheduled job runs every minute
- Checks for messages where
next_send_at <= now()andstatus = 'pending' - Sends the message via Discord webhook
- Updates
send_countand calculatesnext_send_atfor recurring messages - Changes status to
completedif:- One-time message already sent
- Recurring message reached
max_sends
Authorization
| Operation | Permission Required |
|---|---|
| List | Owner (user_id matches) |
| Create | Authenticated + webhook access |
| View | Owner |
| Update | Owner |
| Delete | Owner |
| Pause/Resume | Owner |
Users can only manage their own scheduled messages. There’s no sharing functionality for scheduled messages.
Best Practices
Timezone Awareness
Timezone Awareness
Always specify the user’s local timezone, not UTC. The system handles timezone conversion automatically.
Use Templates
Use Templates
For recurring messages, use templates to easily update message content without recreating the schedule.
Set Max Sends
Set Max Sends
For time-limited campaigns, set
max_sends to prevent infinite recurring messages.Test First
Test First
Create a one-time scheduled message in the near future to test before setting up recurring schedules.
Monitor Send Count
Monitor Send Count
Check
send_count regularly to ensure messages are being delivered as expected.Pause Instead of Delete
Pause Instead of Delete
Temporarily disable messages with pause instead of deleting, so you can resume later without recreating.
Error Handling
Common Errors
- Invalid webhook: Webhook doesn’t exist or user doesn’t have access
- Invalid timezone: Timezone string not recognized
- Past timestamp: Scheduled time is in the past (one-time messages)
- Invalid recurrence: Missing required fields for recurring messages
- Cannot edit sent message: Trying to edit a message that already sent
Failed Sends
If a scheduled message fails to send:- Error is logged in application logs
next_send_atis still updated for recurring messages- Message remains in
pendingstatus - Check webhook validity and Discord API status
