List all domains.
const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({page: 123, pageSize: 123})
};
fetch('https://api.simpleemailapi.dev/v1.DomainService/ListDomains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "<string>",
"domain": "<string>",
"status": "DOMAIN_STATUS_UNSPECIFIED",
"region": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastCheckedAt": "2023-11-07T05:31:56Z",
"summary": {
"message": "<string>",
"nextAction": "<string>",
"recordsPending": 123,
"recordsConfigured": 123,
"canSend": true,
"canReceive": true
},
"records": {
"dkimRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
}
],
"spfRecord": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
},
"dmarcRecord": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
},
"mxRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
}
],
"mailFromRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
}
]
}
}
],
"total": 123
}API key authentication. Get your API key from the SimpleEmailAPI dashboard and include it in the Authorization header as: Bearer sea_live_xxxxx
Define the version of the Connect protocol
1 Define the timeout, in ms
const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({page: 123, pageSize: 123})
};
fetch('https://api.simpleemailapi.dev/v1.DomainService/ListDomains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "<string>",
"domain": "<string>",
"status": "DOMAIN_STATUS_UNSPECIFIED",
"region": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastCheckedAt": "2023-11-07T05:31:56Z",
"summary": {
"message": "<string>",
"nextAction": "<string>",
"recordsPending": 123,
"recordsConfigured": 123,
"canSend": true,
"canReceive": true
},
"records": {
"dkimRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
}
],
"spfRecord": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
},
"dmarcRecord": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
},
"mxRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
}
],
"mailFromRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123,
"recordType": "RECORD_TYPE_UNSPECIFIED",
"status": "RECORD_STATUS_UNSPECIFIED",
"nameShort": "<string>",
"discoveredValue": "<string>",
"instructions": "<string>"
}
]
}
}
],
"total": 123
}