Send an email
https://api.torvathmail.com/v1/emailsSend subject with html, text or both, or a stored template with its variables. The email is queued and sent within seconds; follow it with Get an email or its events.
Headers
Idempotency-Keystringoptional8 to 64 letters, digits, - or _. Sending again with the same key (from the same API key) returns the first result and sends nothing more.
Body
fromstring or objectrequiredAny address on one of your verified domains.
Fields inside from
emailstringrequirednamestringoptional
tostring or array of stringsrequiredup to 50ccstring or array of stringsoptionalup to 50bccstring or array of stringsoptionalup to 50replyTostringoptionalsubjectstringoptional1 to 998 charactershtmlstringoptionaltextstringoptionalMade from the HTML when left out. Send html, text or both.
attachmentsarray of objectsoptionalup to 20Fields inside attachments
filenamestringrequiredcontentstringrequiredBase64
contentTypestringoptional
metadataobjectoptionalstring valuesUp to 20 keys; returned with every event.
trackobjectoptionalBusiness plan. Off unless asked for. Opens use an invisible image and clicks go through Torvath; machine events (Apple Mail's privacy proxy, link scanners) are marked.
Fields inside track
opensbooleanoptionalclicksbooleanoptional
templatestringoptionalBusiness plan. A stored template's name (made under API in Torvath), in place of subject, html and text.
variablesobjectoptionalstring, number or boolean valuesValues for the template's {{name}} variables; every one is needed. Escaped in the HTML.
Response
idstringrequiredrecipientsintegerrequired
Status codes
200Already sent with this Idempotency-Key201Queued for sending400The request isn't valid. field names the part to fix.bad_requestsuppressedmissing_variables401No API key, or it isn't valid or was revoked.unauthorized403The key or plan doesn't allow this.forbiddenapi_offneeds_business404Nothing with that id or name.not_foundtemplate_not_found409Your organisation's settings or state stop it.events_offdomain_blockedstorage_fullorg_inactive429A limit is reached. Wait, or raise the limit.rate_limiteddaily_limitmonthly_limitspending_limit503Sending is briefly unavailable. Try again shortly.no_providersend_busy
Refusals share one shape. See errors.
Templates
On the Business plan, make templates under Admin → API → Templates, with {{name}} where a detail goes. Send one by name in place of subject, html and text. Every variable needs a value, or the email is refused with missing_variables, so a half-filled email never goes out. Values are made safe in the HTML.
{
"from": "billing@yourcompany.in",
"to": "asha@example.com",
"template": "invoice-ready",
"variables": { "name": "Asha", "amount": "₹500" }
}Open and click tracking
On the Business plan, ask for it per email with "track": { "opens": true, "clicks": true }. It is off unless you ask, and only for emails to one recipient. Links with data-no-track are left alone.
Good to know
- Every address in
to,ccandbcccounts as one recipient towards your allowance. - An address that bounced or reported spam before is refused with
suppressed. Remove it under Admin → API to send to it again. metadataandtagscome back with every event, so you can tie events to your own records.