Scheduled Emails

Schedule emails for future delivery and manage them with list, cancel, and reschedule operations.

POST/v1/sendAPI Key

Schedule an email by including scheduledFor in the send request.

ParameterTypeInDescription
fromrequiredstringbodySender email address
torequiredstring[]bodyArray of recipient emails
subjectrequiredstringbodyEmail subject
htmlstringbodyHTML body
textstringbodyPlain text body
scheduledForrequiredstringbodyISO 8601 datetime, must be future, max 30 days
timezonestringbodyTimezone (e.g., "America/New_York")

Request

bash
curl -X POST https://your-posthawk-instance.com/v1/send \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{
    "from": "hello@yourdomain.com",
    "to": ["user@example.com"],
    "subject": "Your weekly report",
    "html": "<h1>Weekly Report</h1><p>Here are your stats...</p>",
    "scheduledFor": "2025-06-15T09:00:00Z",
    "timezone": "America/New_York"
  }'

Response

json
{
  "success": true,
  "scheduled": true,
  "id": "scheduled-uuid",
  "scheduledFor": "2025-06-15T09:00:00.000Z",
  "message": "Email scheduled successfully",
  "statusUrl": "/scheduled/scheduled-uuid"
}
GET/scheduledAPI Key

List all scheduled emails with optional filtering and pagination.

ParameterTypeInDescription
statusstringqueryFilter by status: pending, processing, sent, failed, cancelled
limitnumberqueryPagination limit
offsetnumberqueryPagination offset

Response

json
{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "from": "hello@yourdomain.com",
      "to": ["user@example.com"],
      "subject": "Weekly Report",
      "scheduled_for": "2025-06-15T09:00:00Z",
      "status": "pending"
    }
  ],
  "total": 1
}
GET/scheduled/:idAPI Key

Get details of a specific scheduled email.

ParameterTypeInDescription
idrequiredstringpathScheduled email UUID

Response

json
{
  "success": true,
  "data": {
    "id": "uuid",
    "from": "hello@yourdomain.com",
    "to": ["user@example.com"],
    "subject": "Weekly Report",
    "html": "<h1>Weekly Report</h1>...",
    "scheduled_for": "2025-06-15T09:00:00Z",
    "status": "pending",
    "created_at": "2025-06-01T12:00:00Z"
  }
}
DELETE/scheduled/:idAPI Key

Cancel a pending scheduled email.

ParameterTypeInDescription
idrequiredstringpathScheduled email UUID

Response

json
{
  "success": true,
  "data": { "id": "uuid", "status": "cancelled" },
  "message": "Scheduled email cancelled successfully"
}
PATCH/scheduled/:id/rescheduleAPI Key

Reschedule a pending email to a new time.

ParameterTypeInDescription
idrequiredstringpathScheduled email UUID
scheduledForrequiredstringbodyNew ISO 8601 datetime

Request

bash
curl -X PATCH https://your-posthawk-instance.com/scheduled/uuid/reschedule \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{ "scheduledFor": "2025-06-20T14:00:00Z" }'

Response

json
{
  "success": true,
  "data": { "id": "uuid", "scheduled_for": "2025-06-20T14:00:00Z" },
  "message": "Email rescheduled successfully"
}