Add domain
Purpose
This API adds a new domain to the ZeptoMail account.
Request URL
Method : POST
https://api.zeptomail.com/v1.1/domains
OAuth scope
The steps to generate and use OAuth token can be found here.
scope=Zeptomail.Domains.All
or
scope=Zeptomail.Domains.CREATE
ALL -This gives full CRUD (Create, Read, Update and Delete) access to all domain APIs.
CREATE - This allows access only to CREATE operations.
Steps to generate the Mail Agent key
Select the Mail Agent that you want to connect to your application.
- Navigate to the SMTP/API tab. Go to the API section.
- Copy the Mail Agent alias from this section.
Mail Agents >> API section >> Copy the Mail Agent alias
Request Body (JSON object)
- domain_name *String
- Name of the domain to be added. (Maximum length=100 characters).
- mailagent_keys *Array
- Represents the Mail Agent(s) with which the domain(s) should be associated. This is also known as Mail Agent alias.
- sub_domain_prefix*String
- Prefix of the subdomain that will be used to capture bounced emails. (Maximum length=100 characters).
Note:
* - Mandatory parameter
Sample request
Copiedcurl "https://api.zeptomail.in/v1.1/domains"
-X POST
-H "Authorization : Zoho-oauthtoken ***"\
-H "Content-Type : application/json" \
-d '{
"domain_name": "zylker.com",
"sub_domain_prefix": "bounce",
"mailagent_keys":
[
"5a57413991a0a232"
]
}
Sample response
Copied {
"data":
{
"associated_mailagents":
[
"33cf52b1ecde1da0"
],
"domain_name": "domains.zylker.com",
"domain_key": "1c7a8298da361",
"dkim":
{
"public_key": "k=rsa; p=MI***",
"host": "5203937._domainkey.domains.zylker.com",
"selector": 5203937,
"status": "unverified"
},
"cname":
{
"host": "bounce.domains.zylker.com",
"cname_record": "cluster90.zeptomail.com",
"status": "unverified"
},
"is_restricted_senders": false,
"status": "unverified"
},
"status": "success"
}