Scheduled Emails

Schedule emails to be sent at a specific time in the future.

Scheduling an Email

Add the scheduledAt field with an ISO 8601 datetime:

curl -X POST https://getmailer.co/api/emails \
  -H "Authorization: Bearer gm_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "[email protected]",
    "to": "[email protected]",
    "subject": "Good morning!",
    "html": "<p>This email was scheduled in advance.</p>",
    "scheduledAt": "2024-01-20T09:00:00Z"
  }'

Constraints

  • Maximum delay: 7 days from now
  • Minimum delay: 1 minute from now
  • Timezone: Use UTC (Z suffix) or specify offset

Response

Scheduled emails return with status: "scheduled":

{
  "id": "clx1abc123def456",
  "from": "[email protected]",
  "to": ["[email protected]"],
  "subject": "Good morning!",
  "status": "scheduled",
  "scheduledAt": "2024-01-20T09:00:00Z"
}

Canceling Scheduled Emails

Cancel a scheduled email before it's sent:

DELETE https://getmailer.co/api/emails/:id
curl -X DELETE https://getmailer.co/api/emails/clx1abc123def456 \
  -H "Authorization: Bearer gm_your_api_key"
Note: Only emails with status: "scheduled" can be canceled. Once an email starts sending, it cannot be stopped.

Listing Scheduled Emails

Filter emails to show only scheduled ones:

curl "https://getmailer.co/api/emails?status=scheduled" \
  -H "Authorization: Bearer gm_your_api_key"

Time Format Examples

FormatExample
UTC2024-01-20T09:00:00Z
With offset2024-01-20T09:00:00+05:30
Negative offset2024-01-20T09:00:00-08:00

Related

Scheduled Emails - GetMailer Docs | GetMailer