# Domains
Get information about the domain names, their account verification statuses, their activity statistics, and their history.
# Get a list of domains
If you want to have information about multiple domains, use this GET
request:
GET https://api.mailersend.com/v1/domains
# Request parameters
URL parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
page | int | no | ||
limit | int | no | Min: 10 , Max: 100 | Default: 25 |
verified | bool | no |
# Responses
# Valid
Response Code: 200 OK
Response Headers:
Content-Type: application/json
{
"data" : [
{
"id": "1jreeo",
"name": "example.org",
"dkim": true,
"spf": true,
"tracking": false,
"is_verified": true,
"is_cname_verified": false,
"is_dns_active": true,
"is_cname_active": false,
"is_tracking_allowed": false,
"has_not_queued_messages": false,
"not_queued_messages_count": 0,
"domain_settings": {
"send_paused": false,
"track_clicks": true,
"track_opens": true,
"track_unsubscribe": true,
"track_unsubscribe_html": "<p>Click here to <a href=\"{$unsubscribe}\">unsubscribe<\/a><\/p>",
"track_unsubscribe_plain": "Click here to unsubscribe: {$unsubscribe}",
"track_content": true,
"custom_tracking_enabled": false,
"custom_tracking_subdomain": "email"
},
"created_at": "2020-06-10 10:09:48",
"updated_at": "2020-06-10 10:09:48"
}
],
"links": {
"first": "http:\/\/www.mailersend.io\/api\/v1\/domains?page=1",
"last": "http:\/\/www.mailersend.io\/api\/v1\/domains?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http:\/\/www.mailersend.io\/api\/v1\/domains",
"per_page": 25,
"to": 1,
"total": 1
}
}
# Error
Response Code: 422 Unprocessable Entity
See - Validations errors
# Get a single domain
If you want to have information about a single domain name, use this GET
request:
GET https://api.mailersend.com/v1/domains/{domain_id}
# Request parameters
URL parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
domain_id | string | yes |
# Responses
# Valid
Response Code: 200 OK
Response Headers:
Content-Type: application/json
{
"data": {
"id": "yjm4ej",
"name": "example.org",
"dkim": true,
"spf": true,
"mx": false,
"tracking": false,
"is_verified": true,
"is_cname_verified": false,
"is_dns_active": true,
"is_cname_active": false,
"is_tracking_allowed": false,
"has_not_queued_messages": false,
"not_queued_messages_count": 0,
"domain_settings": {
"send_paused": false,
"track_clicks": true,
"track_opens": true,
"track_unsubscribe": true,
"track_unsubscribe_html": "<p>Click here to <a href=\"{$unsubscribe}\">unsubscribe<\/a><\/p>",
"track_unsubscribe_plain": "Click here to unsubscribe: {$unsubscribe}",
"track_content": true,
"custom_tracking_enabled": false,
"custom_tracking_subdomain": "email"
},
"created_at": "2020-06-10 10:09:50",
"updated_at": "2020-06-10 10:09:50"
}
}
# Error
Response Code: 404 Not Found
# Delete a domain
If you want to delete a domain name, use this DELETE
request:
DELETE https://api.mailersend.com/v1/domains/{domain_id}
# Request parameters
URL parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
domain_id | string | yes |
# Responses
# Valid
Response Code: 200 OK
# Error
Response Code: 404 Not Found
# Get recipients for a domain
If you want to have information (creation date, update date, deletion date) about the recipients for a domain name, use this GET
request:
GET https://api.mailersend.com/v1/domains/{domain_id}/recipients
# Request parameters
URL parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
domain_id | string | yes |
Query parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
page | int | no | ||
limit | int | no | Min: 10 , Max: 100 | Default: 25 |
# Responses
# Valid
Response Code: 200 OK
Response Headers:
Content-Type: application/json
{
"data": [
{
"id": "5ee0b174b251345e407c92dc",
"email": "dsanford@example.net",
"created_at": "2020-06-10 10:09:56",
"updated_at": "2020-06-10 10:09:56",
"deleted_at": ""
},
{
"id": "5ee0b174b251345e407c92dd",
"email": "konopelski.nina@example.com",
"created_at": "2020-06-10 10:09:56",
"updated_at": "2020-06-10 10:09:56",
"deleted_at": ""
},
{
"id": "5ee0b174b251345e407c92de",
"email": "hester.howe@example.net",
"created_at": "2020-06-10 10:09:56",
"updated_at": "2020-06-10 10:09:56",
"deleted_at": ""
}
],
"links": {
"first": "https:\/\/www.mailersend.io\/api\/v1\/domains\/7qvdnq\/recipients?page=1",
"last": "https:\/\/www.mailersend.io\/api\/v1\/domains\/7qvdnq?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http:\/\/www.mailersend.io\/api\/v1\/recipients",
"per_page": 25,
"to": 3,
"total": 3
}
}
# Error
Response Code: 422 Unprocessable Entity
See - Validations errors
# Update domain settings
If you want to update a domain name settings, use this PUT
request:
PUT https://api.mailersend.com/v1/domains/{domain_id}/settings
# Request Body
{
"send_paused": true,
"track_clicks": true,
"track_opens": true,
"track_unsubscribe": true,
"track_unsubscribe_html": "<p>Click here to <a href=\"{$unsubscribe}\">unsubscribe<\/a><\/p>",
"track_unsubscribe_plain": "Click here to unsubscribe: {$unsubscribe}",
"track_content": true,
"custom_tracking_enabled": true,
"custom_tracking_subdomain": "email"
}
# Request parameters
URL parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
domain_id | string | yes |
JSON parameters are provided in dot notation
JSON Body Parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
send_paused | bool | No | ||
track_clicks | bool | no | ||
track_opens | bool | no | ||
track_unsubscribe | bool | no | ||
track_content | bool | no | ||
track_unsubscribe_html | string | no | ||
track_unsubscribe_plain | string | no | ||
custom_tracking_enabled | bool | no | ||
custom_tracking_subdomain | string | no |
# Responses
# Valid
Response Code: 200 OK
{
"data": {
"id": "dq3wdj",
"name": "example.org",
"dkim": true,
"spf": true,
"tracking": false,
"is_verified": true,
"is_cname_verified": true,
"is_dns_active": true,
"is_cname_active": true,
"is_tracking_allowed": true,
"has_not_queued_messages": false,
"not_queued_messages_count": 0,
"domain_settings": {
"send_paused": true,
"track_clicks": true,
"track_opens": true,
"track_unsubscribe": true,
"track_unsubscribe_html": "<p>Click here to <a href=\"{$unsubscribe}\">unsubscribe<\/a><\/p>",
"track_unsubscribe_plain": "Click here to unsubscribe: {$unsubscribe}",
"track_content": true,
"custom_tracking_enabled": true,
"custom_tracking_subdomain": "email"
},
"created_at": "2020-06-10 10:09:52",
"updated_at": "2020-06-10 10:09:52"
}
}
# Error
Response Code: 422 Unprocessable Entity
See - Validations errors