Sender creation and management

You can check out the API public reference endpoints for senders at API Reference > Senders. We will talk through the endpoints one by one starting from Create a new sender.

1. Create a new sender

You can use the endpoint https://api.brevo.com/v3/senders for this API call with the calling method POST. The cURL request for this endpoint will be like this:

curl --request POST \
     --url https://api.brevo.com/v3/senders \
     --header 'accept: application/json' \
     --header 'api-key: ' \
     --header 'content-type: application/json' \
     --data '
{
     "ips": [
          {
               "ip": "123.98.689.7",
               "domain": "mycompany.com",
               "weight": 50
          }
     ],

The parameters for this endpoint are mentioned in the table below.

AttributeDatatypeDescriptionValue
nameStringFrom Name to use for the senderNewsletter
emailStringFrom email to use for the sender. A verification email will be sent to this address.[email protected]
ipsArray of objectsMandatory in case of dedicated IP. IPs to associate to the senderIP objects

Since ips is an array of objects, it has sub attributes which are:

AttributeDatatypeDescriptionValue
ipStringDedicated IP available in your account123.98.689.7
domainStringDomain of the IPmycompany.com
weightInt64Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs.50

📘

Using ips as array of objects

You can also use multiple ips as dedicated ips which you can associate to the sender.


Response

Response codeMessageDescription
201Sender createdSender has been created
400Bad requestBad API request has been sent involving wrong formats for parameters.

2. Update a sender

You can start updating your existing sender by using the endpoint https://api.brevo.com/v3/senders/{senderId} with the calling method PUT. To call the endpoint, the cURL request below can be used:

curl --request PUT \
     --url https://api.brevo.com/v3/senders/24 \
     --header 'accept: application/json' \
     --header 'api-key: ' \
     --header 'content-type: application/json' \
     --data '
{
     "ips": [
          {
               "ip": "123.98.689.7",
               "domain": "mycompany.com",
               "weight": 50
          }
     ],
     "name": "Newsletter",
     "email": "[email protected]"
}
'

The attributes of Update a sender are in two parts, path params and body params.


Path params

AttributeDatatypeDescriptionValue
senderIdInt64Id of the sender24

Body params

AttributeDatatypeDescriptionValue
nameStringFrom Name to use for the senderNewsletter
emailStringFrom email to use for the sender. A verification email will be sent to this address.[email protected]
ipsArray of objectsMandatory in case of dedicated IP. IPs to associate to the senderIP objects

Since ips is an array of objects, it has sub attributes which are:

ipStringDedicated IP available in your account123.98.689.7
domainStringDomain of the IPmycompany.com
weightInt64Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs.50

Response

Response codeDescriptionMessage
204This shows a success message that the sender has been updatedSender updated
400This response is shown when there is a missing or invalid parameter etc.Bad request
404This response code is shown in case when sender ID is unavailable or wrong.Sender ID not found

3. Get the list of all your senders

You can use the endpoint https://api.brevo.com/v3/senders with the calling method GET. The cURL request for this endpoint is mentioned below:

curl --request GET \
     --url 'https://api.brevo.com/v3/senders?ip=192.168.8.138&domain=mydomain.com' \
     --header 'accept: application/json' \
     --header 'api-key: '

The attributes for this endpoint are defined in the table below:

AttributeDatatypeDescriptionValue
ipStringFilter your senders for a specific ip192.168.8.138
domainStringFilter your senders for a specific domainmydomain.com

Response

Response codeMessageDescription
200List of sendersDisplays the list of senders.
400Bad requestThis response is shown due to invalid or wrong parameters.

Delete a sender

You can use the endpoint https://api.brevo.com/v3/senders/{senderId} with the method DELETE. If you want to implement this endpoint in your preferred language, you can use the below code.

The cURL request for this endpoint is below.

curl --request DELETE \
     --url https://api.brevo.com/v3/senders/245 \
     --header 'accept: application/json' \
     --header 'api-key: '

There is only one attribute for deleting a sender which is senderId. You get the senderId after your create the sender and the API returns an Id in the response which is your senderId.

AttributeDatatypeDescriptionValue
senderIdInt64Id of the sender245

Response

Response codeMessageDescription
204Sender deletedSender has been deleted successfully.
400Bad requestRequest may have invalid or missing parameters or problems in the request etc.
404Sender Id not foundSender Id to be deleted is not found