> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amplemarket.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exclusion Lists

> Learn how to manage domain and email exclusions.

Exclusion lists are used to manage domains and emails that should not be sequenced.

## Exclusion Lists Overview

The exclusion list API endpoints allow you to:

1. **List excluded domains and emails**
2. **Create new exclusions**
3. **Delete existing exclusions**

## Exclusion Domain Object

| Field             | Type   | Description                                                             |
| ----------------- | ------ | ----------------------------------------------------------------------- |
| `domain`          | string | The domain name that is excluded (e.g., `domain.com`).                  |
| `source`          | string | The source or reason for exclusion (e.g., `amplemarket`, `salesforce`). |
| `date_added`      | string | The date the domain was added to the exclusion list (ISO 8601).         |
| `excluded_reason` | string | The reason for the exclusion (e.g., `api`, \`manual).                   |
| `_links`          | object | Links to related resources.                                             |

## Exclusion Email Object

| Field             | Type   | Description                                                             |
| ----------------- | ------ | ----------------------------------------------------------------------- |
| `email`           | string | The email address that is excluded (e.g., `someone@domain.com`).        |
| `source`          | string | The source or reason for exclusion (e.g., `amplemarket`, `salesforce`). |
| `date_added`      | string | The date the email was added to the exclusion list (ISO 8601).          |
| `excluded_reason` | string | The reason for the exclusion (e.g., `api`, `manual`).                   |
| `_links`          | object | Links to related resources.                                             |

## Exclusion Domains Endpoints

### List Excluded Domains

**Request**

Retrieve a list of excluded domains:

```js theme={null}
GET /excluded-domains HTTP/1.1
Authorization: Bearer {{API Key}}
```

```bash theme={null}
curl -X GET https://api.amplemarket.com/excluded-domains \
	-H "Authorization: Bearer {{API Key}}"
```

**Response**

This will return a `200 OK` with a list of excluded domains:

```js theme={null}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "excluded_domains": [
    {
      "domain": "domain.com",
      "source": "amplemarket",
      "date_added": "2024-08-28T22:33:16.145Z",
      "excluded_reason": "api"
    }
  ],
  "_links": {
    "self": { "href": "/excluded-domains?size=2000" }
  }
}
```

### Create Domain Exclusions

**Request**

Add new domains to the exclusion list.

```js theme={null}
POST /excluded-domains HTTP/1.1
Authorization: Bearer API_KEY
Content-Type: application/json

{
  "excluded_domains": [
    {"domain": "new_domain.com"}
  ]
}
```

```bash theme={null}
curl -X POST https://api.amplemarket.com/excluded-domains \
	-H "Authorization: Bearer {{API Key}}" \
	-H "Content-Type: application/json" \
	-d '{"excluded_domains": [{"domain":"new_domain.com"}]}'
```

**Response**

This will return a `200 OK` with the status of each domain:

```js theme={null}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "existing_domain.com": "duplicated",
  "new_domain.com": "success"
}
```

### Delete Domain Exclusions

**Request**

Remove domains from the exclusion list.

```js theme={null}
DELETE /excluded-domains HTTP/1.1
Authorization: Bearer API_KEY
Content-Type: application/json

{
  "excluded_domains": [
    {"domain": "existing_domain.com"}
  ]
}
```

```bash theme={null}
curl -X DELETE https://api.amplemarket.com/excluded-domains \
	-H "Authorization: Bearer {{API Key}}" \
	-H "Content-Type: application/json" \
	-d '{"excluded_domains": [{"domain":"existing_domain.com"}]}'
```

**Response**

This will return a `200 OK` with the status of each domain:

```js theme={null}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "existing_domain.com": "success",
  "existing_domain_from_crm.com": "unsupported",
  "unexistent_domain.com": "not_found"
}
```

## Exclusion Emails Endpoints

### List Excluded Emails

**Request**

Retrieve a list of excluded emails:

```js theme={null}
GET /excluded-emails HTTP/1.1
Authorization: Bearer {{API Key}}
```

```bash theme={null}
curl -X GET https://api.amplemarket.com/excluded-emails \
	-H "Authorization: Bearer {{API Key}}"
```

**Response**

This will return a `200 OK` with a list of excluded emails:

```js theme={null}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "excluded_emails": [
    {
      "email": "someone@domain.com",
      "source": "amplemarket",
      "date_added": "2024-08-28T22:33:16.145Z",
      "excluded_reason": "api"
    }
  ],
  "_links": {
    "self": { "href": "/excluded-emails?size=2000" }
  }
}
```

### Create Email Exclusions

**Request**

Add new emails to the exclusion list.

```js theme={null}
POST /excluded-emails HTTP/1.1
Authorization: Bearer API_KEY
Content-Type: application/json

{
  "excluded_emails": [
    {"email": "someone@domain.com"}
  ]
}
```

```bash theme={null}
curl -X POST https://api.amplemarket.com/excluded-emails \
	-H "Authorization: Bearer {{API Key}}" \
	-H "Content-Type: application/json" \
	-d '{"excluded_emails": [{"email":"someone@domain.com"}]}'
```

**Response**

This will return a `200 OK` with the status of each email:

```js theme={null}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "existing@domain.com": "duplicated",
  "new@domain.com": "success"
}
```

### Delete Email Exclusions

**Request**

Remove emails from the exclusion list.

```js theme={null}
DELETE /excluded-emails HTTP/1.1
Authorization: Bearer API_KEY
Content-Type: application/json

{
  "excluded_emails": [
    {"email": "someone@domain.com"}
  ]
}
```

```bash theme={null}
curl -X DELETE https://api.amplemarket.com/excluded-emails \
	-H "Authorization: Bearer {{API Key}}" \
	-H "Content-Type: application/json" \
	-d '{"excluded_emails": [{"email":"someone@domain.com"}]}'
```

**Response**

This will return a `200 OK` with the status of each email:

```js theme={null}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "existing@domain.com": "success",
  "existing_from_crm@domain.com": "unsupported",
  "unexistent@domain.com": "not_found"
}
```
