API reference

Send email from your app

Send an email, check on it, and connect your own SMTP. Every request uses an API key from your dashboard, and API sends follow the same limits as the dashboard.

Base URL and authentication

https://europeanunion.primeglobalhub.online

Send your key in the Authorization header asBearer YOUR_API_KEY. Create keys on the API keys page. Keep them secret and never put them in browser code.

POST

/v1/emails

Sends an email. Returns 201 with { id, status }.

FieldTypeNotes
tostring or string[]Required. One address, or up to 50.
subjectstringRequired. Up to 200 characters.
htmlstringThe email body as HTML. Send html, text, or both.
textstringA plain-text version of the body.
senderstringOptional. "site" for site mail (the default), "smtp:<id>" to send through one of your own SMTP accounts, or "domain:<id>" to send from one of your verified domains.
from_emailstringRequired with a "domain:<id>" sender. Must be an address at that domain, like [email protected].
from_namestringOptional. The name shown next to the From address.
reply_tostringOptional. Where replies should go.
curl -X POST https://europeanunion.primeglobalhub.online/v1/emails \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["[email protected]"],
    "subject": "Your order has shipped",
    "html": "<p>It is on the way!</p>"
  }'
GET

/v1/emails/:id

Checks on an email you sent. Status is queued, sent or failed.

{
  "id": 1042,
  "status": "sent",
  "to": ["[email protected]"],
  "subject": "Your order has shipped",
  "created_at": "2026-11-07T10:15:00Z",
  "sent_at": "2026-11-07T10:15:02Z",
  "error": null
}
POST

/v1/smtp-accounts

Connects one of your own SMTP accounts, so you can send through it with "sender": "smtp:<id>". We log in to the SMTP server before saving (nothing is sent). Returns 201.

FieldTypeNotes
labelstringRequired. A name only you see, up to 60 characters.
hoststringRequired. The SMTP host, like mail.yourdomain.com.
portnumberRequired. Usually 465 (SSL/TLS) or 587 (STARTTLS).
securebooleanRequired. true for SSL/TLS (465), false for STARTTLS (587).
usernamestringThe SMTP username.
passwordstringThe SMTP password.
from_emailstringRequired. The address mail is sent from.
from_namestringOptional. The name shown next to the From address.
modestringOptional. "send_receive" or "send_only". See below.
imapobjectOptional. Receiving details to use instead of our guess: { "enabled": true, "host", "port", "secure", "username", "password" }. Leave the password out to reuse the SMTP one.

mode

  • send_receive: we also open the mailbox (same login, port 993) so its new mail shows in your Inbox. If that fails, nothing is saved and you get 422 receiving_failed with the reason and our best guess.
  • send_only: sending only. The mailbox is never read.
  • Left out: we try receiving, and if it fails the account is still saved as send only. receiving in the response says which, with the reason.

Sending-only services (SendGrid, Mailgun, Amazon SES, Brevo, Postmark and the like) have no inbox: use send_only, or pass imap with your From address’s own mailbox.

curl -X POST https://europeanunion.primeglobalhub.online/v1/smtp-accounts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Work email",
    "host": "mail.yourdomain.com",
    "port": 465,
    "secure": true,
    "username": "[email protected]",
    "password": "YOUR_SMTP_PASSWORD",
    "from_email": "[email protected]",
    "mode": "send_receive"
  }'
{
  "ok": true,
  "account": { "id": 12, "label": "Work email", "mode": "send_receive", "from_email": "[email protected]", … },
  "receiving": { "enabled": true, "host": "mail.yourdomain.com" }
}

GET /v1/smtp-accounts lists your SMTP accounts, with each one’s id and mode.

Errors

Errors come back as { "error": "code", "message": "…" }.

StatusCodeMeaning
400invalid_inputA field is missing or wrong. The message says which.
401invalid_api_keyThe key is missing, wrong, or revoked.
403demo_limitThis is a demo site: each account can send 1 email in total.
409sending_not_configuredSite mail isn’t set up yet. Send through your own SMTP instead.
409domain_not_verifiedThat domain isn’t verified yet. Finish its DNS setup under Senders.
400smtp_limitYou already have the most SMTP accounts you can add (10).
422smtp_login_failedAdding an SMTP account: we couldn’t log in to send. The message says why.
422receiving_failedAdding with mode "send_receive": sending works but the mailbox couldn’t be read. Nothing was saved; receiving.guess has our best guess.
429limit_reachedYou’ve used your monthly emails or hit your hourly cap.
429too_many_requestsMore than 60 requests a minute on one key. Wait and retry.

Limits

  • Up to 50 recipients per request.
  • 60 requests a minute per key.
  • Site mail and your own domains count each recipient toward your monthly emails. Your own SMTP is unlimited.

Other apps

Want to send from other apps (WordPress, Outlook…)? Connect your own SMTP under Senders — it’s unlimited.

© 2026 Ambassador and Head of Delegation. · Home