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
| Capability | Endpoint | Guide |
|---|---|---|
| Send a single email | POST /v1/email/send | Send Email |
| Send bulk email | POST /v1/email/bulk | Send Email |
| Manage reusable templates | /v1/email/templates | Templates |
| Attach files (PDF, images, etc.) | POST /v1/email/send | Attachments |
| Track opens, clicks & bounces | /v1/email/analytics | Tracking |
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
API Key (recommended)
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:
| Setting | Value |
|---|---|
| Host | smtp.afriroute.ai |
| Port | 587 (STARTTLS) or 465 (SSL) |
| Username | Your SMTP username |
| Password | Your 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
| Plan | Requests/sec | Emails/month |
|---|---|---|
| Starter | 10 | 10,000 |
| Pro | 50 | 100,000 |
| Enterprise | Custom | Unlimited |
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"
}
}
| Code | Meaning |
|---|---|
INVALID_EMAIL | Recipient address is malformed |
DOMAIN_NOT_VERIFIED | Sending domain has not been verified |
RATE_LIMIT_EXCEEDED | Too many requests — back off and retry |
ATTACHMENT_TOO_LARGE | Total message size exceeds limit |
Related Resources
Last Updated: May 2026 · Need help? Contact Support →