Send Email
Send transactional emails immediately or schedule them for later delivery.
POST
/v1/sendAPI KeySend an email immediately, or schedule it for future delivery by including scheduledFor.
| Parameter | Type | In | Description |
|---|---|---|---|
fromrequired | string | body | Sender email address |
torequired | string[] | body | Array of recipient email addresses |
cc | string[] | body | Array of CC email addresses |
bcc | string[] | body | Array of BCC email addresses |
replyTo | string | body | Reply-to email address |
subjectrequired | string | body | Email subject line. Not required if templateId is provided. |
html | string | body | HTML email body. Either html or text is required (unless templateId is provided). |
text | string | body | Plain text email body |
templateId | string | body | UUID of an email template. Overrides subject/html/text with template content. |
variables | Record<string, string> | body | Key-value pairs for template variable substitution |
scheduledFor | string | body | ISO 8601 datetime for scheduled delivery. Must be in the future, max 30 days ahead. |
timezone | string | body | Timezone for the scheduled time (e.g., "America/New_York") |
headers | Record<string, string> | body | Custom 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 KeyCheck the delivery status of a sent email.
| Parameter | Type | In | Description |
|---|---|---|---|
jobIdrequired | string | path | Job ID returned from the send endpoint |
Response
json
{
"userId": "user-uuid",
"status": "completed",
"result": { "messageId": "ses-message-id" }
}