SendBaba API
Reference
Transactional and marketing email infrastructure built for Africa. 42+ endpoints. 4 AI tools.
Authentication
All API requests require a Bearer token in the Authorization header. Get your API key from Dashboard → Settings → API Keys.
Bearer YOUR_KEY on every request.Authorization: Bearer sb_live_your_api_key_here
Quick Start
Send your first email in under 2 minutes.
curl -X POST https://api.sendbaba.com/api/v1/emails/send \ -H "Authorization: Bearer sb_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "from": "hello@yourdomain.com", "to": "recipient@example.com", "subject": "Hello from SendBaba!", "html": "<h1>It works!</h1>" }'
{
"success": true,
"data": { "id": "e72f9a01-3b44...", "status": "sent" }
}Send Email
Send a single transactional email. Supports HTML, plain text, CC, BCC, reply-to, tags and metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | required | Sender email — must be a verified domain |
| to | string | array | required | Recipient email(s) |
| subject | string | required | Email subject line |
| html | string | optional | HTML body content |
| text | string | optional | Plain text fallback |
| reply_to | string | optional | Reply-to address |
| cc | string | array | optional | CC recipients |
| bcc | string | array | optional | BCC recipients |
| tags | array | optional | Tags for analytics grouping |
| metadata | object | optional | Custom key-value data returned in webhooks |
html or text is required.Templates
Store reusable HTML templates server-side. Send by ID using {{variable}} merge tags.
Clone a public library template into your account. Returns a new template_id ready to use.
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | required | Recipient email |
| template_id | string | required | Template UUID |
| variables | object | optional | Key-value pairs to substitute |
| subject | string | optional | Override template subject |
Webhooks
Receive real-time HTTP POST notifications for email events. All payloads are signed with HMAC-SHA256.
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | required | HTTPS endpoint to receive events |
| events | array | optional | Events to subscribe (default: all) |
Events Reference
| Event | Description |
|---|---|
| email.sent | Accepted by recipient mail server |
| email.delivered | Confirmed delivery to inbox |
| email.opened | Recipient opened the email |
| email.clicked | Recipient clicked a tracked link |
| email.bounced | Hard or soft bounce |
| email.complained | Marked as spam |
| email.unsubscribed | Recipient unsubscribed |
Verify Signatures
const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(rawBody).digest('hex'); return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
Sub-Accounts
Isolate sending streams per product, client, or email type. Each sub-account has its own API key, limits, and stats.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | required | Sub-account name |
| daily_limit | integer | optional | Max emails/day (default: 10,000) |
| monthly_limit | integer | optional | Max emails/month (default: 300,000) |
Email Validation
Validate emails before sending. Checks format, MX records, typo domains, disposable addresses, and suppression list.
{ "email": "john@gmial.com", "check_mx": true }AI-Powered Tools
4 AI endpoints powered by Claude. Analyze campaigns, generate subject lines, write emails, and detect spam.
| Parameter | Type | Description |
|---|---|---|
| type | string | deliverability | subject | content | timing | full |
| subject | string | Subject line to analyze |
| html | string | HTML body for content analysis |
| send_time | string | Proposed send time |
| Parameter | Type | Required | Description |
|---|---|---|---|
| description | string | required | Plain English description of the email |
| brand_name | string | optional | Your brand name |
| brand_color | string | optional | Hex color for buttons |
| tone | string | optional | professional | casual | formal |
| category | string | optional | otp | welcome | auth | transactional |
| save | boolean | optional | Save to account (default: true) |
id is immediately usable with POST /v1/emails/send-template.Error Handling
All errors return JSON. Use the error field as a stable machine-readable code.
{
"success": false,
"error": "domain_not_verified",
"message": "Domain is not verified for your organization"
}| Code | Meaning | Action |
|---|---|---|
| 200 | OK | Request successful |
| 202 | Accepted | Email queued for delivery |
| 400 | Bad Request | Fix request parameters |
| 401 | Unauthorized | Check your API key |
| 404 | Not Found | Resource doesn't exist |
| 429 | Rate Limited | Check X-RateLimit-Reset and retry |
| 500 | Server Error | Retry with exponential backoff |
Rate Limits
Enforced per API key per minute. All responses include these headers.
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 57 X-RateLimit-Reset: 43 # seconds until window resets
| Plan | Price | Req/Min | Emails/Day | Emails/Month |
|---|---|---|---|---|
| Free | $0 | 10 | 100 | 1,000 |
| Starter | $10 | 60 | 1,000 | 10,000 |
| Growth | $49 | 120 | 5,000 | 50,000 |
| Professional | $99 | 200 | 15,000 | 150,000 |
| Scale | $199 | 300 | 30,000 | 300,000 |
| Business | $299 | 500 | 50,000 | 500,000 |
| Enterprise | Custom | 1,000+ | Custom | Custom |
SMTP Relay
Connect any app that supports SMTP — WordPress, WooCommerce, Laravel, Django — to SendBaba's delivery infrastructure.
| Setting | Value |
|---|---|
| Host | smtp.sendbaba.com |
| Port (TLS) | 587 |
| Port (SSL) | 465 |
| Encryption | TLS / STARTTLS / SSL |
| Username | Dashboard → Settings → SMTP |
| Auth Method | LOGIN or PLAIN |
const transporter = nodemailer.createTransport({ host: 'smtp.sendbaba.com', port: 587, secure: false, auth: { user: 'your_smtp_username', pass: 'your_smtp_password' } });
Connect Gmail to SendBaba
Send from your verified SendBaba domain directly inside Gmail with full DKIM/SPF/DMARC authentication.
