Tovanix
Tovanix

SMTP Email API

A sending API for transactional mail — signup verification, order notifications, password resets — available over both standard SMTP and an HTTP API.

  • Two ways in: keep your existing SMTP client with zero code changes, or switch to the HTTP API for finer-grained receipts
  • Templates: manage templates centrally and pass only variables at send time
  • Batch sending: many recipients per request, each with its own receipt
  • Delivery and bounce webhooks: real-time delivered / bounced / complaint events to protect sender reputation

POST / GET /api/v1/smtp/*

Overview

SMTP Aggregation API provides email sending capabilities. Add your SMTP email accounts and send via a unified API. Supports multi-account smart rotation, auto failover, and quota management.

Purchase subscription -> Add SMTP accounts -> Create API Key -> Call send API

Authentication

SMTP API uses module-specific keys (prefix smk_) for authentication, supporting two methods:

Login to user console -> SMTP Aggregation API -> API Key Management. Save the key immediately after creation; the full key cannot be viewed again after closing.

Send Email

POST /api/v1/smtp/send

Send an email. System auto-selects the optimal SMTP account (by priority, usage, and health status).

Response Fields

Send an Idempotency-Key header to retry safely: the first successful result is cached, and repeated requests with the same key return the original result without re-sending or double-charging quota.

Scheduled Send Response

With a future send_at, the mail is not sent immediately; a scheduled task is created and the following structure is returned (quota is charged at actual send time):

Returns code: 429 when daily or monthly limit exceeded. Upgrade plan or wait for quota reset.

Batch Send

POST /api/v1/smtp/send/batch

Response Fields

Per-request recipient cap = your plan's max_batch_size (default 10); exceeding it fails immediately. Daily/monthly quota is charged per mail, not per request; recipients on the unsubscribe list are marked failed. Large batches take a while and the request may time out before it returns: send an Idempotency-Key header, and retrying with the same value returns the first result instead of sending the whole batch again.

Template Send

POST /api/v1/smtp/send/template

Response Fields

Template send supports durable idempotency: add Idempotency-Key: <unique-string> to the request headers. The intent is recorded and persisted by (user + API Key + key) and survives a process restart or Redis loss. Rules: (1) a retry with the same key and same body returns the original result without re-delivering or re-charging quota; (2) the same key with a different body returns 409 conflict — use a new key; (3) while the first request is still in progress (pending) a retry returns 409 — retry later with the same key; (4) a failed intent cannot be reopened and returns 409 — start over with a new key. Omitting the header disables idempotency (treated as a normal send).

Query Quota

GET /api/v1/smtp/quota

Query remaining sending quota for the current subscription.

Query Send Status

GET /api/v1/smtp/status/:message_id

Query email send status by message_id returned from the send API.

Bounce/Complaint Report

POST /api/v1/smtp/inbound

Report a bounce or complaint event: the address is automatically added to the suppression list and the matching send log is flagged; future sends skip it to protect your sender reputation. Provide at least one of email / message_id.

Frequently Asked Questions

We already use SMTP — do we have to rewrite anything?

No. Point your existing SMTP client at the host, port and credentials Tovanix gives you and you are done. Move to the HTTP API only when you want finer delivery and bounce receipts.

How should bounces and complaints be handled?

Both are pushed to you in real time via webhooks. Add the address to your suppression list and stop sending to it immediately — that is what keeps your sending domain out of spam folders.

Related pages: SMTP Aggregation API · API Documentation · SMS Verification

Loading…