EmailAlias Docs
Everything you need to integrate with EmailAlias — from getting started to full API reference.
Getting Started
Quick Start
Create an account
Sign up at emailalias.io/signup — no credit card required.
Get your API key
After logging in, navigate to Settings → API Keys to generate your access token.
Make your first API call
Use the API to create your first alias programmatically.
curl -X POST https://api.emailalias.io/api/aliases \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"label": "shopping"}'Authentication
All API requests require a Bearer token in the Authorization header. You can use either an API key (recommended) or a JWT token.
API Key (Recommended)
Generate from Settings → API Keys. Premium plan required. Keys don't expire.
Authorization: Bearer ea_live_...
JWT Token
Obtained via the magic-link login flow. Expires after 24 hours.
Authorization: Bearer eyJ...
Security: API keys are hashed before storage — we never store the raw key. Keep your key secret. If compromised, delete it from Settings and create a new one.
Guides
Creating Your First Alias
- 1. Log in to your dashboard and click Create Alias.
- 2. Choose a type: Random (auto-generated), Custom (your own name), Service (per-app), or Tagged.
- 3. Select a domain — system domains (email91.com) or your verified custom domain.
- 4. Add an optional label (e.g., "Shopping", "Newsletter") for easy identification.
- 5. Click Create — your alias is immediately active and ready to receive emails.
# Via API
curl -X POST https://api.emailalias.io/api/aliases \
-H "Authorization: Bearer ea_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"alias_type": "random", "label": "Shopping", "domain": "email91.com"}'DNS Configuration for Custom Domains
Every custom domain requires 4 DNS records for full email authentication:
| Record | Type | Value |
|---|---|---|
| MX | MX | 10 inbound-smtp.us-east-1.amazonaws.com |
| SPF | TXT | v=spf1 include:amazonses.com ~all |
| DMARC | TXT | v=DMARC1; p=quarantine; rua=mailto:dmarc@emailalias.io |
| DKIM | CNAME | Auto-generated via SES |
Domain is verified only when ALL checks pass (MX + SPF + DKIM + DMARC + ownership TXT).
Replying from Aliases
Premium users can send emails from any alias. The recipient only sees the alias address.
curl -X POST https://api.emailalias.io/api/send-email \
-H "Authorization: Bearer ea_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"alias_id": "uuid-of-your-alias",
"to_email": "recipient@example.com",
"subject": "Hello",
"body": "Sent from my alias!"
}'Breach Alert Response Guide
When an alias appears in a data breach:
- 1. You'll receive an exposure alert in your dashboard and via email.
- 2. Identify which alias was compromised — each service has its own alias.
- 3. Disable the compromised alias to stop receiving spam/phishing.
- 4. Create a new alias for that service and update your account there.
- 5. Your real email remains safe — only the alias was exposed.
# Check exposure via API
curl https://api.emailalias.io/api/analytics/exposure \
-H "Authorization: Bearer ea_live_YOUR_KEY"
# Disable compromised alias
curl -X PATCH https://api.emailalias.io/api/aliases/ALIAS_ID \
-H "Authorization: Bearer ea_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"active": false}'API Key Management
Premium users can create up to 5 API keys for programmatic access.
- • Go to Settings → API Keys and click Create.
- • Name your key (e.g., "Production", "CI/CD").
- • Copy the key immediately — it's only shown once.
- • Use the key as a Bearer token in the Authorization header.
- • Delete and rotate keys anytime from Settings.
API keys are prefixed with ea_live_ and never expire. Delete a key to revoke access.
Rate Limits
| Plan | Rate Limit | Burst |
|---|---|---|
| Free | 60 requests/minute | 10 requests/second |
| Premium | 300 requests/minute | 30 requests/second |
Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset.
Authentication
Passwordless magic-link authentication. No passwords to remember or leak.
/api/auth/magic-linkSend a magic link to the user's email for passwordless login.
{ "email": "user@example.com" }{ "message": "Magic link sent to your email" }/api/auth/verifyVerify a magic link token and receive an access token.
{ "token": "abc123..." }{ "access_token": "eyJ...", "token_type": "bearer", "user": { ... } }/api/auth/meAuth RequiredGet the currently authenticated user's profile.
{ "id": "uuid", "email": "...", "plan": "free|premium", "alias_count": 3 }Aliases
Create, manage, and monitor your encrypted email aliases.
/api/aliasesAuth RequiredList all aliases for the authenticated user.
{ "aliases": [{ "id": "uuid", "address": "abc@emailalias.io", "label": "shopping", "enabled": true, "emails_forwarded": 42, "created_at": "..." }] }/api/aliasesAuth RequiredCreate a new encrypted email alias.
{ "label": "shopping", "domain_id": null }{ "id": "uuid", "address": "x7k9m@emailalias.io", "label": "shopping", "enabled": true }/api/aliases/{alias_id}Auth RequiredUpdate an alias (toggle enabled/disabled, change label).
{ "enabled": false, "label": "old-shopping" }{ "id": "uuid", "address": "...", "enabled": false, "label": "old-shopping" }/api/aliases/{alias_id}Auth RequiredPermanently delete an alias. This action cannot be undone.
{ "message": "Alias deleted" }/api/aliases/{alias_id}/statsAuth RequiredGet forwarding statistics and breach status for a specific alias.
{ "emails_forwarded": 42, "emails_blocked": 5, "last_forwarded_at": "...", "breach_detected": false }Custom Domains
Add and verify custom domains for branded aliases. Premium plan required.
/api/domainsAuth RequiredList all custom domains for the authenticated user.
{ "domains": [{ "id": "uuid", "domain": "example.com", "verified": true, "dns_records": [...] }] }/api/domainsAuth RequiredAdd a new custom domain. Returns DNS records to configure.
{ "domain": "example.com" }{ "id": "uuid", "domain": "example.com", "verified": false, "dns_records": [{ "type": "MX", "name": "@", "value": "mx.emailalias.io", "priority": 10 }, { "type": "TXT", "name": "@", "value": "v=spf1 include:emailalias.io ~all" }] }/api/domains/{domain_id}/verifyAuth RequiredTrigger DNS verification for a custom domain.
{ "verified": true, "domain": "example.com" }/api/domains/{domain_id}Auth RequiredRemove a custom domain and all associated aliases.
{ "message": "Domain removed" }Billing & Subscription
Manage subscriptions and billing via Stripe integration.
/api/billing/create-checkoutAuth RequiredCreate a Stripe checkout session for Premium subscription.
{ "price_id": "price_monthly|price_yearly", "success_url": "...", "cancel_url": "..." }{ "checkout_url": "https://checkout.stripe.com/..." }/api/billing/portalAuth RequiredCreate a Stripe billing portal session for subscription management.
{ "portal_url": "https://billing.stripe.com/..." }/api/billing/subscriptionAuth RequiredGet the current user's subscription status.
{ "plan": "premium", "status": "active", "current_period_end": "...", "cancel_at_period_end": false }/api/billing/webhookStripe webhook endpoint for subscription lifecycle events (server-to-server).
{ "received": true }Exposure Intelligence
Monitor aliases for data breaches and exposure events.
/api/exposure/breachesAuth RequiredList all detected breaches affecting your aliases.
{ "breaches": [{ "alias_id": "uuid", "alias_address": "...", "breach_name": "ExampleCorp", "breach_date": "2025-01-15", "exposed_data": ["email", "password_hash"], "detected_at": "..." }] }/api/exposure/scoreAuth RequiredGet your overall exposure risk score based on alias activity.
{ "score": 15, "risk_level": "low", "total_aliases": 12, "exposed_aliases": 1, "recommendations": [...] }Error Codes
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Invalid request body or missing required fields. |
| 401 | Unauthorized | Missing or invalid authentication token. |
| 403 | Forbidden | Insufficient permissions (e.g., free plan accessing premium features). |
| 404 | Not Found | The requested resource does not exist. |
| 409 | Conflict | Resource already exists (e.g., duplicate domain). |
| 422 | Unprocessable Entity | Validation error in request body. |
| 429 | Too Many Requests | Rate limit exceeded. Retry after the interval in X-RateLimit-Reset. |
| 500 | Internal Server Error | An unexpected error occurred. Contact support if this persists. |
// Error response format
{
"detail": "Human-readable error message",
"code": "ERROR_CODE",
"status": 400
}SDKs & Libraries
Official client libraries coming soon. In the meantime, use any HTTP client with our REST API:
import requests
headers = {"Authorization": "Bearer YOUR_API_KEY"}
r = requests.post(
"https://api.emailalias.io/api/aliases",
json={"label": "shopping"},
headers=headers,
)
print(r.json())const res = await fetch(
"https://api.emailalias.io/api/aliases",
{
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ label: "shopping" }),
}
);
const data = await res.json();Ready to integrate?
Create a free account and start building with the EmailAlias API.