Send Email

Send transactional emails immediately or schedule them for later delivery.

POST/v1/sendAPI Key

Send an email immediately, or schedule it for future delivery by including scheduledFor.

ParameterTypeInDescription
fromrequiredstringbodySender email address
torequiredstring[]bodyArray of recipient email addresses
ccstring[]bodyArray of CC email addresses
bccstring[]bodyArray of BCC email addresses
replyTostringbodyReply-to email address
subjectrequiredstringbodyEmail subject line. Not required if templateId is provided.
htmlstringbodyHTML email body. Either html or text is required (unless templateId is provided).
textstringbodyPlain text email body
templateIdstringbodyUUID of an email template. Overrides subject/html/text with template content.
variablesRecord<string, string>bodyKey-value pairs for template variable substitution
scheduledForstringbodyISO 8601 datetime for scheduled delivery. Must be in the future, max 30 days ahead.
timezonestringbodyTimezone for the scheduled time (e.g., "America/New_York")
headersRecord<string, string>bodyCustom email headers

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": "Welcome to Posthawk",
    "html": "<h1>Hello!</h1><p>Welcome aboard.</p>"
  }'

Response

json
{
  "success": true,
  "scheduled": false,
  "jobId": "abc-123-def",
  "message": "Email queued for sending",
  "statusUrl": "/v1/send/abc-123-def"
}
GET/v1/send/:jobIdAPI Key

Check the delivery status of a sent email.

ParameterTypeInDescription
jobIdrequiredstringpathJob ID returned from the send endpoint

Response

json
{
  "userId": "user-uuid",
  "status": "completed",
  "result": { "messageId": "ses-message-id" }
}