Send Email

Send an email from your custom domain

POST/email/send
Requires Bearer authentication

Send an email from one of your verified custom domain addresses. Supports HTML content, CC/BCC, and threading for replies.

Request Body

fromAddressIdstringrequired

The ID of the email address to send from. Must belong to a verified domain in your organization.

tostring | string[]required

Recipient email address(es).

subjectstringrequired

Email subject line.

bodyTextstring

Plain text email body.

bodyHtmlstring

HTML email body. Falls back to bodyText if not provided.

ccstring | string[]

CC recipient(s).

bccstring | string[]

BCC recipient(s).

replyTostring

Reply-to address if different from sender.

inReplyTostring

Message-ID of the email being replied to (for threading).

threadIdstring

Thread ID to continue an existing conversation.

POST/email/send
curl -X POST "https://api.vastal.agency/v1/email/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "fromAddressId": "addr_abc123",
  "to": "client@example.com",
  "subject": "Re: Your inquiry",
  "bodyText": "Thank you for reaching out...",
  "bodyHtml": "<p>Thank you for reaching out...</p>"
}'
200Success
{
"success": true,
"message": {
  "id": "msg_def456",
  "thread_id": "thr_xyz789",
  "direction": "outbound",
  "status": "sent",
  "from_address": "hello@yourbusiness.com",
  "to_addresses": ["client@example.com"],
  "subject": "Re: Your inquiry",
  "sent_at": "2024-01-20T11:45:00Z"
},
"messageId": "1705750123.abc123@yourbusiness.com"
}
400Bad Request
{
"error": "fromAddressId, to, and subject are required"
}