Email API Integration Guide
Everything developers need to integrate NexusProMail correctly — authentication, API key security, webhook implementation, rate limit handling, error patterns and sending architecture decisions.
This is an operational integration guide. Transactional email API overview → · Full endpoint reference →
Quick Answer
The NexusProMail API is a REST API authenticated with a Bearer token. Send your API key in every request as Authorization: Bearer YOUR_API_KEY. Register webhooks to receive real-time delivery events. Implement exponential backoff for 429 responses. Use separate sending subdomains for transactional and marketing email.
Key Takeaways
- API keys belong in environment variables — never in source code or client-side JavaScript
- The sandbox key works immediately on signup; production requires DKIM/SPF domain verification
- Every webhook payload is HMAC-SHA256 signed — always verify the signature before processing
- 429 responses include a Retry-After header; use exponential backoff, not a fixed sleep
- Hard bounce webhooks should trigger immediate suppression in your own database
- Use separate sending subdomains for transactional and marketing email to isolate reputation
- The REST API is preferred over SMTP for all new integrations
Authentication
Every API request requires a Bearer token. Keys are scoped per account and can be rotated at any time.
Generate your API key
Sign up for a free account. Your sandbox API key is available immediately in the dashboard under Settings → API Keys. No DNS setup required for initial testing.
Store the key securely
Set your API key as an environment variable (API_KEY or NEXUSPROMAIL_API_KEY). Never hardcode keys in source files or commit them to version control. Use a secrets manager in production.
Add the Authorization header
Every API request requires: Authorization: Bearer YOUR_API_KEY. The header must be present on every request — there is no session-based authentication.
Verify your domain before going live
Add DKIM and SPF records for your sending domain and verify in the dashboard. Without domain verification, sends are limited to sandbox. Domain verification takes effect within 24 hours of DNS propagation.
API Key Security — Never do this
Webhook Events
Register a webhook endpoint to receive real-time events for every delivery outcome. Payloads are signed with HMAC-SHA256.
| Event | Description | Recommended action |
|---|---|---|
delivered | Email accepted by the receiving mail server | Update delivery status in your database |
opened | Recipient opened the email (pixel tracked) | Trigger engagement workflows, update last-active timestamp |
clicked | Recipient clicked a tracked link in the email | Record engagement, trigger conversion workflows |
bounced.hard | Permanent delivery failure — address does not exist | Suppress address immediately in your own database |
bounced.soft | Temporary delivery failure — retry in progress | Monitor; treat as hard bounce after 3+ consecutive failures |
complained | Recipient marked the email as spam | Suppress immediately; investigate send that triggered complaint |
unsubscribed | Recipient clicked the unsubscribe link | Update subscription status; stop all marketing sends to this address |
Rate Limiting
The API enforces per-key rate limits. A 429 response includes a Retry-After header with the wait time in seconds. Use exponential backoff — not a fixed delay.
Error Reference
400Bad RequestCause: Malformed JSON or missing required field
Fix: Check request body against API docs; validate before sending
401UnauthorizedCause: Missing, invalid or expired API key
Fix: Verify Authorization header format: Bearer YOUR_API_KEY
422UnprocessableCause: Valid request but suppressed address, invalid domain, or failed validation
Fix: Check error message body; handle suppression responses by updating your records
429Rate LimitedCause: Request rate exceeded for your plan tier
Fix: Read Retry-After header; implement exponential backoff
500Server ErrorCause: Transient infrastructure issue
Fix: Retry with exponential backoff; raise support ticket if persistent
SMTP vs REST API: When to Use Each
Both methods use the same sending infrastructure. The choice is about your integration layer, not deliverability.
| Factor | REST API | SMTP |
|---|---|---|
| Integration complexity | Low — standard HTTP POST with JSON body | Medium — connection management, MIME encoding |
| Structured responses | Full JSON response with message ID, errors | SMTP reply codes only — limited error detail |
| Suppression enforcement | Automatic — 422 returned for suppressed addresses | Enforced at connection layer — less granular feedback |
| Webhook support | Full webhook event registration via API | Bounce callbacks via VERP — more complex to configure |
| Observability | Message ID in response for correlation; full API logs | Limited — depends on SMTP client logging |
| Legacy system compatibility | Requires HTTP client capability | Compatible with any SMTP-capable system |
| Recommendation | ✓ Use for all new integrations | Use only for legacy or SMTP-only systems |
Subdomain Sending Architecture
Always send email from a subdomain — never from your root domain. This protects your main domain’s reputation if deliverability problems occur.
Recommended architecture: separate subdomains for transactional and marketing email. Each has its own DKIM key, SPF record and sender reputation. Problems with one do not affect the other.
mail.yourdomain.comTransactional email
Password resets, order confirmations, account alerts
Critical — must always reach inbox
news.yourdomain.comMarketing email
Newsletters, promotional campaigns, re-engagement
Important — inbox placement improves with engagement
yourdomain.com (root)Never use for email
Website, search engine presence, security reputation
Protect at all costs — no email sending
Developer FAQ
How do I authenticate with the NexusProMail API?
What is the difference between the sandbox and production API keys?
How do I handle rate limiting in the NexusProMail API?
What webhook events does NexusProMail emit?
How do I verify a webhook signature?
Should I use SMTP or the REST API?
What is subdomain sending and why does it matter?
How do I handle suppressed addresses in my application?
Start building in minutes
Sandbox key ready immediately. No DNS setup required for testing. Production key after domain verification.
Also read: Transactional email API · Email deliverability · Domain warming · Compliance guide