Email providers
List and connect the sending mailboxes of your Emelia account, change their sender name, set their custom tracking domain, enable their warmup and run a deliverability diagnosis by API.
An email provider is a sending mailbox connected to Emelia: a Google or Microsoft account, or any SMTP and IMAP mailbox. Campaigns send from them, through the identities of each campaign.
List your mailboxes
GET/email-providers
curl https://api.emelia.io/email-providers \
-H "Authorization: $EMELIA_API_KEY"Each mailbox comes with the campaigns that use it. Passwords are always masked (********). There is no pagination: you get every mailbox in one response. The _id is what you put in identities[].email of a campaign.
Connect an SMTP and IMAP mailbox
POST/email-providers
curl -X POST https://api.emelia.io/email-providers \
-H "Authorization: $EMELIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"senderName": "Marie Martin",
"senderEmail": "marie.martin@yourcompany.com",
"emailType": "SMTP",
"smtp": { "login": "marie.martin@yourcompany.com", "password": "app-password", "server": "smtp.yourcompany.com", "port": 465, "ssl": true },
"imap": { "login": "marie.martin@yourcompany.com", "password": "app-password", "server": "imap.yourcompany.com", "port": 993, "ssl": true }
}'Emelia tests the SMTP and IMAP credentials before saving the mailbox. The number of mailboxes is limited by your plan. Google and Microsoft accounts are connected in the Emelia app, with their own sign in.
To fix the credentials of a disconnected mailbox, use Update a mailbox: masked passwords (********) are kept as stored. Change the sender name works on every type of mailbox, without a new test.
Tracking domains
Tracked links and the open pixel use a shared Emelia domain by default. A tracking domain replaces it with a subdomain of your own, such as track.yourcompany.com, which is better for deliverability. One domain can serve several mailboxes.
Add the domain
POST/domains/createcurl -X POST https://api.emelia.io/domains/create \
-H "Authorization: $EMELIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": "track.yourcompany.com"}'The domain must be a subdomain: yourcompany.com is refused. It is saved in lowercase. Adding a domain that is already in your account returns it.
Point it to Emelia
At your DNS host, create a CNAME record from the subdomain (track) to emelia.link. Emelia checks the record about a minute after the domain is added, then every 15 minutes, and generates the HTTPS certificate. The domain then goes from PENDING to OK.
If the record is still missing after about 6 checks, the domain goes DISABLED and you receive an email. Fix the record, then add the domain again: its verification starts over.
Attach it to mailboxes
POST/domains/assigncurl -X POST https://api.emelia.io/domains/assign \
-H "Authorization: $EMELIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"providerIds": ["6650f1a2b839d80011c5a0aa", "6650f1a2b839d80011c5a0ab"], "domainId": "6650f1a2b839d80011c5d0a1"}'providerIds are the _id of your mailboxes, domainId the _id of the domain. You can attach a PENDING domain right away: links keep the shared domain until it is OK. A DISABLED domain cannot be attached. The response gives the number of mailboxes changed in count.
/domains
Lists your tracking domains with their status. Each mailbox of GET /email-providers shows its domain in customDomain.
To detach a domain from mailboxes without deleting it, send "domainId": null to POST /domains/assign.
/domains/{providerId}
Deletes the tracking domain of a mailbox from your account: every mailbox that used it goes back to the shared Emelia domain. The path takes the mailbox id, not the domain id. Add ?onlyUnlink=true to only detach it from this mailbox.
Errors come with HTTP 400 and a code, such as TRACKING_DOMAIN_INVALID, TRACKING_DOMAIN_TAKEN or TRACKING_DOMAIN_DISABLED. See Errors.
Warmup
Warmup builds the sending reputation of a mailbox before and while it prospects.
GET/email-providers/warmup
POST/email-providers/warmup/enable
curl -X POST https://api.emelia.io/email-providers/warmup/enable \
-H "Authorization: $EMELIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"providerId": "6650f1a2b839d80011c5a0aa"}'- Enabling the warmup needs an active subscription.
providerIdtakes the id of the mailbox or of its warmup. - Some hosts cannot be warmed up: the call fails with
WARMUP_PROVIDER_UNSUPPORTED. GET /email-providers/warmupreturns the state of every mailbox (running or not, statistics, diagnosis), without pagination: apageparameter is ignored. The_idof an item is the warmup id.- To turn a warmup off, use the Emelia app.
Deliverability diagnosis
POST/email-providers/warmup/check-health
Asks for a new DNS, sending and blacklist diagnosis of a mailbox, from its warmup id ({"warmupId": "..."}). The result appears a few minutes later in health of GET /email-providers/warmup. This route answers its errors as {"success": false, "message": "..."}.
Remove a mailbox
DEL/email-providers/{providerId}
Removes the mailbox from your account. Detach it from your running campaigns first, with Set the sender identities.