> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Create a new sender domain

POST https://api.brevo.com/v3/senders/domains
Content-Type: application/json

Creates a new domain in Brevo.

Use this to:
- Add new domains for sending emails
- Set up domain authentication for better deliverability
- Configure DNS records for email authentication
- Establish domain-based sender identities

Key information returned:
- Created domain ID and configuration
- Required DNS records for authentication
- Domain provider detection results
- Setup instructions and next steps

Reference: https://developers.brevo.com/reference/create-domain

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.
- `Authorization` header (bearer token, required) — OAuth 2.0 client_credentials (machine-to-machine) grant. Exchange your app's client_id/client_secret for a short-lived Bearer token.

## Request

### Body (application/json)

This endpoint expects an object.

- `name` (string, required) — Domain name to be added

## Response

### 200

Domain created successfully

- `id` (long, required) — ID of the Domain created
- `domain_name` (string, required) — Domain name
- `message` (string, required) — Success message with next steps
- `domain_provider` (string, optional) — Detected domain provider
- `dns_records` (SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecords, optional) — DNS records required for domain authentication

## Errors

### 400 Bad Request Error

bad request

- `code` (enum, required) — Error code displayed in case of a failure
  - Allowed values: `invalid_parameter`, `missing_parameter`, `out_of_range`, `campaign_processing`, `campaign_sent`, `document_not_found`, `not_enough_credits`, `permission_denied`, `duplicate_parameter`, `duplicate_request`, `method_not_allowed`, `unauthorized`, `account_under_validation`, `not_acceptable`, `bad_request`, `unprocessable_entity`, `Domain does not exist`, `Contact email not found`, `Attribute not found`, `Category id not found`, `Invalid parameters passed`, `Record(s) for identifier not found`, `Returned when query params are invalid`, `Returned when invalid data posted`, `Feed not found`, `Campaign ID not found`, `api-key not found`, `DMARC policy requires domain authentication`, `DNS records not properly configured`, `Invalid OTP code provided`, `OTP code has expired`, `Domain already exists in your account`, `The sum of all IP weights must equal 100`, `Authentication failed`, `Insufficient credits`, `Request already processed`
- `message` (string, required) — Readable message associated to the failure

## Types

### SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecords

DNS records required for domain authentication

- `brevo_code` (SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecordsBrevoCode, required) — Brevo verification code record
- `dkim_record` (SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecordsDkimRecord, required) — DKIM authentication record
- `dmarc_record` (SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecordsDmarcRecord, required) — DMARC policy record

### SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecordsBrevoCode

Brevo verification code record

- `host_name` (string, required) — DNS record hostname
- `type` (string, required) — DNS record type
- `value` (string, required) — DNS record value
- `status` (boolean, required) — Whether the record is properly configured

### SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecordsDkimRecord

DKIM authentication record

- `host_name` (string, required) — DNS record hostname
- `type` (string, required) — DNS record type
- `value` (string, required) — DNS record value
- `status` (boolean, required) — Whether the record is properly configured

### SendersDomainsPostResponsesContentApplicationJsonSchemaDnsRecordsDmarcRecord

DMARC policy record

- `host_name` (string, required) — DNS record hostname
- `type` (string, required) — DNS record type
- `value` (string, required) — DNS record value
- `status` (boolean, required) — Whether the record is properly configured

## Examples

### Successful domain creation with DNS records

**Response**

```json
{
  "id": 5,
  "domain_name": "mycompany.com",
  "message": "Domain added successfully. To authenticate it, add following DNS records",
  "domain_provider": "Cloudflare",
  "dns_records": {
    "brevo_code": {
      "host_name": "@",
      "type": "TXT",
      "value": "brevo-code=abc123def456",
      "status": false
    },
    "dkim_record": {
      "host_name": "mail._domainkey",
      "type": "TXT",
      "value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...",
      "status": false
    },
    "dmarc_record": {
      "host_name": "_dmarc",
      "type": "TXT",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com",
      "status": false
    }
  }
}
```

**SDK Code**

```python Successful domain creation with DNS records
import requests

url = "https://api.brevo.com/v3/senders/domains"

headers = {"api-key": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Successful domain creation with DNS records
const url = 'https://api.brevo.com/v3/senders/domains';
const options = {method: 'POST', headers: {'api-key': '<api-key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Successful domain creation with DNS records
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/senders/domains"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Successful domain creation with DNS records
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/senders/domains")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
```

```java Successful domain creation with DNS records
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/senders/domains")
  .header("api-key", "<api-key>")
  .asString();
```

```php Successful domain creation with DNS records
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/senders/domains', [
  'headers' => [
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp Successful domain creation with DNS records
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/senders/domains");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
IRestResponse response = client.Execute(request);
```

```swift Successful domain creation with DNS records
import Foundation

let headers = ["api-key": "<api-key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/senders/domains")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Domain creation with automatic provider detection

**Response**

```json
{
  "id": 6,
  "domain_name": "example.com",
  "message": "Domain added successfully. To authenticate it, add following DNS records",
  "domain_provider": "GoDaddy",
  "dns_records": {
    "brevo_code": {
      "host_name": "@",
      "type": "TXT",
      "value": "brevo-code=xyz789abc123",
      "status": false
    },
    "dkim_record": {
      "host_name": "mail._domainkey",
      "type": "TXT",
      "value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...",
      "status": false
    },
    "dmarc_record": {
      "host_name": "_dmarc",
      "type": "TXT",
      "value": "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
      "status": false
    }
  }
}
```

**SDK Code**

```python Domain creation with automatic provider detection
import requests

url = "https://api.brevo.com/v3/senders/domains"

headers = {"api-key": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Domain creation with automatic provider detection
const url = 'https://api.brevo.com/v3/senders/domains';
const options = {method: 'POST', headers: {'api-key': '<api-key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Domain creation with automatic provider detection
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/senders/domains"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Domain creation with automatic provider detection
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/senders/domains")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
```

```java Domain creation with automatic provider detection
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/senders/domains")
  .header("api-key", "<api-key>")
  .asString();
```

```php Domain creation with automatic provider detection
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/senders/domains', [
  'headers' => [
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp Domain creation with automatic provider detection
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/senders/domains");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
IRestResponse response = client.Execute(request);
```

```swift Domain creation with automatic provider detection
import Foundation

let headers = ["api-key": "<api-key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/senders/domains")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create a basic domain

**Request**

```json
{
  "name": "mycompany.com"
}
```

**Response**

```json
{
  "id": 5,
  "domain_name": "mycompany.com",
  "message": "Domain added successfully. To authenticate it, add following DNS records",
  "domain_provider": "Cloudflare",
  "dns_records": {
    "brevo_code": {
      "host_name": "@",
      "type": "TXT",
      "value": "brevo-code=abc123def456",
      "status": false
    },
    "dkim_record": {
      "host_name": "mail._domainkey",
      "type": "TXT",
      "value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...",
      "status": false
    },
    "dmarc_record": {
      "host_name": "_dmarc",
      "type": "TXT",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com",
      "status": false
    }
  }
}
```

**SDK Code**

```python Create a basic domain
import requests

url = "https://api.brevo.com/v3/senders/domains"

payload = { "name": "mycompany.com" }
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a basic domain
const url = 'https://api.brevo.com/v3/senders/domains';
const options = {
  method: 'POST',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"name":"mycompany.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a basic domain
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/senders/domains"

	payload := strings.NewReader("{\n  \"name\": \"mycompany.com\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a basic domain
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/senders/domains")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"mycompany.com\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create a basic domain
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/senders/domains")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"mycompany.com\"\n}")
  .asString();
```

```php Create a basic domain
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/senders/domains', [
  'body' => '{
  "name": "mycompany.com"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp Create a basic domain
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/senders/domains");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"mycompany.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a basic domain
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = ["name": "mycompany.com"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/senders/domains")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create a subdomain

**Request**

```json
{
  "name": "newsletter.mycompany.com"
}
```

**Response**

```json
{
  "id": 5,
  "domain_name": "mycompany.com",
  "message": "Domain added successfully. To authenticate it, add following DNS records",
  "domain_provider": "Cloudflare",
  "dns_records": {
    "brevo_code": {
      "host_name": "@",
      "type": "TXT",
      "value": "brevo-code=abc123def456",
      "status": false
    },
    "dkim_record": {
      "host_name": "mail._domainkey",
      "type": "TXT",
      "value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...",
      "status": false
    },
    "dmarc_record": {
      "host_name": "_dmarc",
      "type": "TXT",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com",
      "status": false
    }
  }
}
```

**SDK Code**

```python Create a subdomain
import requests

url = "https://api.brevo.com/v3/senders/domains"

payload = { "name": "newsletter.mycompany.com" }
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a subdomain
const url = 'https://api.brevo.com/v3/senders/domains';
const options = {
  method: 'POST',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"name":"newsletter.mycompany.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a subdomain
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/senders/domains"

	payload := strings.NewReader("{\n  \"name\": \"newsletter.mycompany.com\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a subdomain
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/senders/domains")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"newsletter.mycompany.com\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create a subdomain
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/senders/domains")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"newsletter.mycompany.com\"\n}")
  .asString();
```

```php Create a subdomain
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/senders/domains', [
  'body' => '{
  "name": "newsletter.mycompany.com"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp Create a subdomain
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/senders/domains");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"newsletter.mycompany.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a subdomain
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = ["name": "newsletter.mycompany.com"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/senders/domains")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create a test domain

**Request**

```json
{
  "name": "test.example.com"
}
```

**Response**

```json
{
  "id": 5,
  "domain_name": "mycompany.com",
  "message": "Domain added successfully. To authenticate it, add following DNS records",
  "domain_provider": "Cloudflare",
  "dns_records": {
    "brevo_code": {
      "host_name": "@",
      "type": "TXT",
      "value": "brevo-code=abc123def456",
      "status": false
    },
    "dkim_record": {
      "host_name": "mail._domainkey",
      "type": "TXT",
      "value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...",
      "status": false
    },
    "dmarc_record": {
      "host_name": "_dmarc",
      "type": "TXT",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com",
      "status": false
    }
  }
}
```

**SDK Code**

```python Create a test domain
import requests

url = "https://api.brevo.com/v3/senders/domains"

payload = { "name": "test.example.com" }
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a test domain
const url = 'https://api.brevo.com/v3/senders/domains';
const options = {
  method: 'POST',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"name":"test.example.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a test domain
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/senders/domains"

	payload := strings.NewReader("{\n  \"name\": \"test.example.com\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a test domain
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/senders/domains")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"test.example.com\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create a test domain
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/senders/domains")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"test.example.com\"\n}")
  .asString();
```

```php Create a test domain
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/senders/domains', [
  'body' => '{
  "name": "test.example.com"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp Create a test domain
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/senders/domains");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"test.example.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a test domain
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = ["name": "test.example.com"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/senders/domains")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```