Send Email
Send an email from your custom domain
POST
/email/sendRequires
Bearer authenticationSend an email from one of your verified custom domain addresses. Supports HTML content, CC/BCC, and threading for replies.
Request Body
fromAddressIdstringrequiredThe ID of the email address to send from. Must belong to a verified domain in your organization.
tostring | string[]requiredRecipient email address(es).
subjectstringrequiredEmail subject line.
bodyTextstringPlain text email body.
bodyHtmlstringHTML email body. Falls back to bodyText if not provided.
ccstring | string[]CC recipient(s).
bccstring | string[]BCC recipient(s).
replyTostringReply-to address if different from sender.
inReplyTostringMessage-ID of the email being replied to (for threading).
threadIdstringThread ID to continue an existing conversation.
POST
/email/sendcurl -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>" }'
const response = await fetch( 'https://api.vastal.agency/v1/email/send', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ 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>' }) } ); const data = await response.json();
import requests response = requests.post( 'https://api.vastal.agency/v1/email/send', headers={ 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ '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>' } ) data = response.json()
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" }