Domain creation and management
Domains are used for authenticating and verifying the senders so that a user knows that the email is being sent from a genuine source. You can check out the endpoints for creating and managing domains at API reference > Domains.
1. Creating a new domain
You can use the endpoint https://api.brevo.com/v3/senders/domainswith the POST method to send a request to the API for creating a new domain. You can use the cURL request below for this endpoint.
You can add your API key in the header api-key above in the cURL request. This endpoint only has one body parameter which is defined in the table below.
Response
You will receive a success response something like this below:
On the other hand, A bad request response would be something like this:
You can view the responses for the request you send below in the table:
2. Getting the list of your domains
You can use this endpoint to retrieve created domains. You can use the endpoint https://api.brevo.com/v3/senders/domains using the GET method. You can use the cURL request below
No attributes for getting the list of your domains
There are no prominent attributes for getting the list of your domains. The request will use your API key and the endpoint to check the domains you have created and it will display them to you in response.
Response
A sample response would return all the domains you have created just like in the below JSON format.
Response codes for the endpoint are mentioned below in a table.
3. Delete a domain
You can delete a domain by using the endpoint https://api.brevo.com/v3/senders/domains/{domainName} with the DELETE method. You can put the domain name in endpoint URL in the cURL request as shown below.
A sample and appropriate response would return null which shows that domain has been deleted. This endpoint only uses domainName as an attribute which is mentioned in the table below.
Response