Domain authentication and validation
You can authenticate and validate your domains after creating and managing them. You need a domain name which is valid so that it can be authenticated. To check out the public endpoints, you can go to API reference > Domains.
1. Validate domain configuration
You can use the endpoint https://api.brevo.com/v3/senders/domains/{domainName}
with the GET
method to validate your domain. You can use the cURL request below to send a request to the endpoint.
curl --request GET \
--url https://api.brevo.com/v3/senders/domains/mycompany.com \
--header 'accept: application/json' \
--header 'api-key: '
This endpoint shows the configurations of a specific domain. There is only one attribute for this endpoint domainName
which you have to append with the URL in the cURL request. It is defined below in the table:
Attribute | Datatype | Description | Value |
---|---|---|---|
domainName | String | Name of the domain | mycompany.com |
Response
A sample response for the request would be something like:
{
"domain": "mycompany.com",
"verified": false,
"authenticated": false,
"dns_records": {
"dkim_record": {
"type": "TXT",
"value": "k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDeMVIzrCa3T14JsNY0IRv5/2V1/v2itlviLQBwXsa7shBD6TrBkswsFUToPyMRWC9tbR/5ey0nRBH0ZVxp+lsmTxid2Y2z+FApQ6ra2VsXfbJP3HE6wAO0YTVEJt1TmeczhEd2Jiz/fcabIISgXEdSpTYJhb0ct0VJRxcg4c8c7wIDAQAB",
"host_name": "mail._domainkey.",
"status": false
},
"brevo_code": {
"type": "TXT",
"value": "brevo-code:e760f020e6d438149540cfc757e99b5a",
"host_name": "",
"status": false
}
}
}
In the JSON format, the domains configurations are shown and if the domain is verified and authenticated. You can find some response codes below and their description.
Response code | Message | Description |
---|---|---|
200 | Domain configuration | It shows the status of domain verification and authentication. |
400 | Bad request | Request fails due to a bad request involving incorrect or missing parameters etc. |
404 | Domain does not exist | Request fails because the domain does not exist. |
2. Authenticate a domain
You can use the endpoint https://api.brevo.com/v3/senders/domains/{domainName}/authenticate
with the PUT
method to authenticate a domain. The cURL request below can be utilised to send a request to the endpoint.
curl --request PUT \
--url https://api.brevo.com/v3/senders/domains/mycompany.com/authenticate \
--header 'accept: application/json' \
--header 'api-key: '
You can put the attribute domainName
in the url of the cURL request as mentioned here https://api.brevo.com/v3/senders/domains/{domainName}/authenticate
. The attribute is mentioned in the table below:
Attribute | Datatype | Description | Value |
---|---|---|---|
domainName | String | Name of the domain | mycompany.com |
How to get your domain verified?
There are three ways to authenticate your domain:
- DNS records: You need the Brevo record to verify your domain. To authenticate the domain, configure your domain with other remaining DNS records.
- Host a file: You can host a file in the root directory of the domain.
- Send an email: You can send email for a verification code which will verify the domain is authentic.
Response
A sample response would be something like:
{
"domain_name": "mycompany.com",
"message": "Domain has been authenticated successfully."
}
A few response codes and their descriptions are mentioned below in the table:
Response code | Message | Description |
---|---|---|
200 | Domain authenticated | The domain is authenticated. |
400 | Bad request | Bad request due to invalid or missing parameters. It can also be due to a values mismatch with DKIM records and Brevo code. |
404 | Domain does not exist | Domain does not exist in the database. |
Updated 11 months ago