import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const domain = await client.domains.create({ domain: 'x' });
console.log(domain.id);{
"id": "<string>",
"domain": "<string>",
"status": "pending",
"canReceiveEmails": true,
"hasMxRecords": true,
"domainProvider": "<string>",
"providerConfidence": "<string>",
"dnsRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"isRequired": true,
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"mailFromDomain": "<string>",
"mailFromDomainStatus": "<string>",
"dnsConflict": {
"hasConflict": true,
"message": "<string>",
"conflictType": "mx",
"existingRecords": [
{
"type": "<string>",
"value": "<string>"
}
]
},
"parentDomain": "<string>",
"message": "<string>"
}Add a new domain for email receiving. Automatically initiates verification and returns required DNS records. Subdomains inherit verification from their verified parent domain.
import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const domain = await client.domains.create({ domain: 'x' });
console.log(domain.id);{
"id": "<string>",
"domain": "<string>",
"status": "pending",
"canReceiveEmails": true,
"hasMxRecords": true,
"domainProvider": "<string>",
"providerConfidence": "<string>",
"dnsRecords": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"isRequired": true,
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"mailFromDomain": "<string>",
"mailFromDomainStatus": "<string>",
"dnsConflict": {
"hasConflict": true,
"message": "<string>",
"conflictType": "mx",
"existingRecords": [
{
"type": "<string>",
"value": "<string>"
}
]
},
"parentDomain": "<string>",
"message": "<string>"
}Your Inbound API key. Include it in the Authorization header as: Bearer
1 - 253Response for status 201
pending, verified, failed Show child attributes
Show child attributes
Was this page helpful?