Skip to main content

Email API Overview

Enterprise-grade transactional and marketing email with 99.9% deliverability, reusable templates, attachments, and real-time open/click tracking — all through a single REST API.

Base URL​

https://api.afriroute.ai

All requests are authenticated with a Bearer token:

Authorization: Bearer $AFRIROUTE_API_KEY

What You Can Do​

CapabilityEndpointGuide
Send a single emailPOST /v1/email/sendSend Email
Send bulk emailPOST /v1/email/bulkSend Email
Manage reusable templates/v1/email/templatesTemplates
Attach files (PDF, images, etc.)POST /v1/email/sendAttachments
Track opens, clicks & bounces/v1/email/analyticsTracking

Quick Start​

curl -X POST https://api.afriroute.ai/api/v1/email/send \
-H "Authorization: Bearer $AFRIROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Welcome to AfriRoute",
"html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>"
}'

A successful request returns a message_id you can use to track delivery:

{
"status": "queued",
"message_id": "email_7K8L9M0N",
"to": "[email protected]",
"from": "[email protected]",
"created_at": "2026-05-28T10:30:00Z"
}

Authentication Methods​

Pass your API key as a Bearer token on every request:

-H "Authorization: Bearer $AFRIROUTE_API_KEY"

SMTP Relay​

For systems that already speak SMTP, use the relay with your generated SMTP credentials:

SettingValue
Hostsmtp.afriroute.ai
Port587 (STARTTLS) or 465 (SSL)
UsernameYour SMTP username
PasswordYour SMTP password

Deliverability​

To reach the inbox reliably, verify your sending domain and publish the records AfriRoute provides:

# SPF
v=spf1 include:spf.afriroute.ai ~all

# DKIM — signed automatically once your domain is verified
# DMARC
v=DMARC1; p=quarantine; rua=mailto:[email protected]

Verify a domain:

curl -X POST https://api.afriroute.ai/api/v1/email/domains \
-H "Authorization: Bearer $AFRIROUTE_API_KEY" \
-d '{"domain": "yourcompany.com"}'

Rate Limits​

PlanRequests/secEmails/month
Starter1010,000
Pro50100,000
EnterpriseCustomUnlimited

Exceeding your limit returns 429 RATE_LIMIT_EXCEEDED. Implement exponential back-off and retry.

Best Practices​

  • Verify your domain before sending in production for SPF/DKIM/DMARC alignment.
  • Warm up new domains — start at ~100 emails/day and ramp gradually.
  • Always include a plain-text part alongside HTML for accessibility and spam scoring.
  • Add an unsubscribe link to marketing email (required by CAN-SPAM and GDPR).
  • Listen to webhooks for accurate delivery, bounce, and complaint handling.

Errors​

All errors follow a consistent shape:

{
"error": {
"code": "DOMAIN_NOT_VERIFIED",
"message": "Please verify your sending domain first"
}
}
CodeMeaning
INVALID_EMAILRecipient address is malformed
DOMAIN_NOT_VERIFIEDSending domain has not been verified
RATE_LIMIT_EXCEEDEDToo many requests — back off and retry
ATTACHMENT_TOO_LARGETotal message size exceeds limit

Last Updated: May 2026 · Need help? Contact Support →