A sender domain is a domain you send from. You add DNS records for SPF, DKIM and tracking, then verify the domain. All commands take APIKey and use the /api/v1/ paths shown. For GET and DELETE, send APIKey in the query string. For POST and PATCH, send it in the JSON body.
New and changed domains wait in Approval Pending until they are verified.
user.senderdomain.create
POST /api/v1/user.senderdomain.
| Parameter | Required | Description |
|---|---|---|
SenderDomain |
Yes | For example acme.com |
LinkTracking, OpenTracking |
No | Turn tracking on or off for mail from this domain |
UnsubscribeLink |
No | Default false |
CustomSubdomain, CustomTrackPrefix |
No | Letters, digits and hyphens, up to 32 characters |
UseTrackingSubdomain |
No | false drops the tracking DNS record |
StrictFlags |
No | Refuse unknown values for the flags above |
curl https://app.emailmarketer.io/api/v1/user.senderdomain \
-H "Content-Type: application/json" \
-d '{ "APIKey": "'"$EM_API_KEY"'", "SenderDomain": "acme.com" }'
{ "Success": true, "DomainID": 12, "SenderDomain": { "DomainID": 12, "SenderDomain": "acme.com", "Status": "Approval Pending" } }
| Code | HTTP | Meaning |
|---|---|---|
| 1 | Missing SenderDomain |
|
| 4 | localhost is not a valid domain |
|
| 5 | 403 | Domain limit reached |
| 6 | Invalid subdomain or prefix | |
| 7 | 400 | The domain could not be created |
| 9 | 422 | Unknown flag value with StrictFlags |
Get the DNS records
GET /api/v1/user.senderdomain.dns?DomainID=12&APIKey=...
curl -G https://app.emailmarketer.io/api/v1/user.senderdomain.dns \
-d APIKey="$EM_API_KEY" \
-d DomainID=12
{ "DomainID": 12, "SenderDomain": "acme.com", "DNSRecords": { "sl.acme.com": { "Type": "CNAME", "Value": "...", "IsVerified": false } } }
Add each record at your DNS host. user.senderdomain.dnshost tells you which DNS host the domain uses.
user.senderdomain.verify
POST /api/v1/user.senderdomain.verify with DomainID. Or send verifyall=true to check up to 25 pending domains at once.
curl https://app.emailmarketer.io/api/v1/user.senderdomain.verify \
-H "Content-Type: application/json" \
-d '{ "APIKey": "'"$EM_API_KEY"'", "DomainID": 12 }'
{ "Success": true, "DomainID": 12, "IsVerified": true, "Status": "Enabled", "DNSRecords": { } }
All commands
| Command | Method and path | Required | Optional |
|---|---|---|---|
user.senderdomain.list |
GET /api/v1/user.senderdomains |
none | none |
user.senderdomain.get |
GET /api/v1/user.senderdomain |
DomainID |
days (1 to 365) adds daily sent, delivered, bounced and complaint counts |
user.senderdomain.create |
POST /api/v1/user.senderdomain |
SenderDomain |
See above |
user.senderdomain.update |
PATCH /api/v1/user.senderdomain |
DomainID |
The create options, and status (Enabled or Disabled). Changing a DNS setting makes new records and sets the domain back to Approval Pending |
user.senderdomain.delete |
DELETE /api/v1/user.senderdomain |
DomainID |
none |
user.senderdomain.verify |
POST /api/v1/user.senderdomain.verify |
DomainID or verifyall |
IncludeTrackingWarning |
user.senderdomain.dns |
GET /api/v1/user.senderdomain.dns |
DomainID |
none |
user.senderdomain.dnshost |
GET /api/v1/user.senderdomain.dnshost |
DomainID |
none |
user.senderdomain.sendtest |
POST /api/v1/user.senderdomain.sendtest |
DomainID, to |
subject |
Examples for the commands not shown above:
# user.senderdomain.list
curl -G https://app.emailmarketer.io/api/v1/user.senderdomains \
-d APIKey="$EM_API_KEY"
# user.senderdomain.get
curl -G https://app.emailmarketer.io/api/v1/user.senderdomain \
-d APIKey="$EM_API_KEY" \
-d DomainID=12 \
-d days=30
# user.senderdomain.update
curl -X PATCH https://app.emailmarketer.io/api/v1/user.senderdomain \
-H "Content-Type: application/json" \
-d '{ "APIKey": "'"$EM_API_KEY"'", "DomainID": 12, "status": "Disabled" }'
# user.senderdomain.delete
curl -X DELETE -G https://app.emailmarketer.io/api/v1/user.senderdomain \
-d APIKey="$EM_API_KEY" \
-d DomainID=12
# user.senderdomain.dnshost
curl -G https://app.emailmarketer.io/api/v1/user.senderdomain.dnshost \
-d APIKey="$EM_API_KEY" \
-d DomainID=12
# user.senderdomain.sendtest
curl https://app.emailmarketer.io/api/v1/user.senderdomain.sendtest \
-H "Content-Type: application/json" \
-d '{ "APIKey": "'"$EM_API_KEY"'", "DomainID": 12, "to": "jane@example.com" }'
Error 2 always means the domain was not found. Other codes:
| Command | Codes |
|---|---|
update |
9 invalid status, 10 an unverified domain cannot be enabled, 11 the domain was suspended by our team, 12 a pending domain cannot be disabled, 13 unknown flag value |
delete |
3 a suspended domain cannot be deleted (HTTP 422) |
sendtest |
3 missing to, 8 invalid recipient, 11 delivery failed (HTTP 502) |
Domains added here are the same domains you use for transactional email. The emailgateway.* commands on Transactional (domains and keys) manage their API keys, SMTP credentials and webhooks.