API documentation

Send mail programmatically with a per-mailbox API key. Available on plans with API access — see Pricing for which ones.

Authentication

Every request needs an Authorization header carrying a Bearer token. Generate one from webmail Settings → API Keys — the raw token is shown once, at creation.

Only mailboxes on a plan with API access can generate a key or send through this endpoint. Sending from a mailbox whose plan doesn't include it returns a 403.

Sending a message

POST https://api.unet.az/api/v1/send

curl -X POST https://api.unet.az/api/v1/send \
  -H "Authorization: Bearer umk_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["[email protected]"],
    "subject": "Hello from the API",
    "body_text": "Sent with POST /api/v1/send"
  }'

Request fields

FieldTypeDescription
tostring[] (required)One or more recipient email addresses.
ccstring[]Optional CC recipients.
bccstring[]Optional BCC recipients.
subjectstringMessage subject line.
body_textstringPlain-text body.
body_htmlstringHTML body. Send either body_text, body_html, or both.

Response

A successful send returns 201 with the created message, including its id (useful for your own records) and delivery_status, which starts as "pending" — delivery itself happens asynchronously.

HTTP/1.1 201 Created

{
  "id": 149,
  "subject": "Hello from the API",
  "direction": "outbound",
  "delivery_status": "pending",
  "sent_at": "2026-08-01T08:06:06.000000Z",
  "recipients": [
    { "type": "to", "address": "[email protected]" }
  ]
}

Rate limits

Every plan has hourly and/or monthly send limits. These are shared across every sending channel on the same mailbox — webmail, the API, and SMTP submission all draw from the same pool, not separate ones. Going over either limit returns 429 with a machine-readable error code:

HTTP/1.1 429 Too Many Requests

{
  "error": "hour_limit_exceeded",
  "message": "You've reached your Pro plan's limit of 100 sent messages per hour."
}

Error responses

401Missing or invalid Bearer token.
403The mailbox's plan doesn't include API access.
422Validation failed, or the message would exceed the mailbox's storage quota.
429hour_limit_exceeded or month_limit_exceeded — over the plan's send-rate limit for that window.