Skip to Content
MailerSend
Email API

Recipients

Manage your email recipients with ease using MailerSend's Recipients API. Get, create, update recipients and more with a simple API call. Learn more.

Fetch the email addresses of recipients and other relevant information.

Get recipients

Retrieve the email addresses of recipients using this GET request:

GET https://api.mailersend.com/v1/recipients

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
pageintnoMin: 1, Max: 1000
limitintnoMin: 10, Max: 100Default: 25
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->recipients->get(null, $limit = 100, $page = 3);
// Or for a specific domain
$mailersend->recipients->get('domain_id', $limit = 100, $page = 3);

More examples

Responses

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "5ee0b174b251345e407c92dc",
      "email": "dsanford@example.net",
      "created_at": "2020-06-10T10:09:56.000000Z",
      "updated_at": "2020-06-10T10:09:56.000000Z",
      "deleted_at": ""
    },
    {
      "id": "5ee0b174b251345e407c92dd",
      "email": "konopelski.nina@example.com",
      "created_at": "2020-06-10T10:09:56.000000Z",
      "updated_at": "2020-06-10T10:09:56.000000Z",
      "deleted_at": ""
    },
    {
      "id": "5ee0b174b251345e407c92de",
      "email": "hester.howe@example.net",
      "created_at": "2020-06-10T10:09:56.000000Z",
      "updated_at": "2020-06-10T10:09:56.000000Z",
      "deleted_at": ""
    }
  ],
  "links": {
    "first": "https:\/\/api.mailersend.com\/v1\/recipients?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "current_page_url": "https:\/\/api.mailersend.com\/v1\/recipients?page=1",
    "from": 1,
    "path": "https:\/\/api.mailersend.com\/v1\/recipients",
    "per_page": 25,
    "to": 3
  }
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Get a single recipient

Retrieve the information of a single recipient and its domain using this GET request:

GET https://api.mailersend.com/v1/recipients/{recipient_id}

Request parameters

URL parameterTypeRequiredLimitationsDetails
recipient_idstringyes
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->recipients->find('recipient_id');

More examples

Responses

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
{
  "data": {
    "id": "5ee0b185b251345e407c938e",
    "email": "hauck.sincere@example.net",
    "created_at": "2020-06-10T10:10:13.000000Z",
    "updated_at": "2020-06-10T10:10:13.000000Z",
    "deleted_at": "",
    "emails": [
      {
        "id": "5ee0b166b251345e407c9201",
        "from": "colleen.wiza@example.net",
        "to": "tyra.cummerata@example.org",
        "subject": "Magni aperiam sunt nam omnis.",
        "text": "Lorem ipsum dolor sit amet, consectetuer adipiscin",
        "html": "<html><body><a href='https:\/\/www.mailersend.com' t",
        "template_id": "3z0vklorxjy7qrne",
        "domain_id": "7nxe3yGpqQmv",
        "message_id": "5ee0b182b251345e407c935a",
        "status": "delivered",
        "tags": [
          "receipt",
          "order"
        ],
        "interaction": [
          "opened",
          "clicked"
        ],
        "suppression_reason": null,
        "created_at": "2020-06-04T12:00:00.000000Z",
        "updated_at": "2020-06-04T12:01:13.000000Z",
        "headers": []
      }
    ],
    "domain": {
      "id": "2j6xej",
      "name": "example.org",
      "created_at": "2020-06-10T10:10:13.000000Z",
      "updated_at": "2020-06-10T10:10:13.000000Z"
    }
  }
}

Error

Response Code: 404 Not Found

Delete a recipient

Delete a single recipient and add its email address to the domain's blocklist using this DELETE request:

DELETE https://api.mailersend.com/v1/recipients/{recipient_id}

The recipient is soft-deleted: it no longer appears in Get recipients, but Get a single recipient still returns it with deleted_at set.

Request parameters

URL parameterTypeRequiredLimitationsDetails
recipient_idstringyes
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->recipients->delete('recipient_id');

More examples

Responses

Valid

Response Code: 204 No Content
Response Body: [EMPTY]

Error

Response Code: 404 Not Found

Get recipients from a suppression list

Blocklist

Retrieve the recipients in a blocklist of an account or domain by passing the blocklist ID with this GET request:

GET https://api.mailersend.com/v1/suppressions/blocklist

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
limitintnoMin: 10, Max: 100Default: 10
pageintnoMin: 1
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->blocklist->getAll('domain_id', 1, 15);

More examples

Responses

Response keyTypeDetails
data.*object[]Array of recipients in the blocklist.
data.*.domainobjectIncludes data of the domain related to the blocklist. When this property is null, the blocklist is attached to an account instead of a domain.

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f0176881bf3d1fe618daae",
      "type": "pattern",
      "pattern": ".*@example.net",
      "domain": {
        "id": "7nxe3yjmeq28vp0k",
        "name": "mailersend.com",
        "created_at": "2021-07-15T11:04:44.000000Z",
        "updated_at": "2021-07-15T11:04:45.000000Z"
      },
      "created_at": "2021-07-14T07:04:01.298000Z",
      "updated_at": "2021-07-14T07:04:01.298000Z"
    }
  ],
  "links": {
    "first": "https://api.mailersend.com/v1/suppressions/blocklist?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "current_page_url": "https://api.mailersend.com/v1/suppressions/blocklist?page=1",
    "from": 1,
    "path": "https://api.mailersend.com/v1/suppressions/blocklist",
    "per_page": 10,
    "to": 1
  }
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Hard Bounces

Retrieve the hard bounced recipients of an account or domain by passing its ID with this GET request:

GET https://api.mailersend.com/v1/suppressions/hard-bounces

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
limitintnoMin: 10, Max: 100Default: 10
pageintnoMin: 1
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->hardBounce->getAll('domain_id', 1, 15);

More examples

Responses

Response keyTypeDetails
data.*object[]Array of hard bounces.
data.*.recipientobjectRecipient related to the hard bounce.
data.*.recipient.domainobjectDomain related to the hard bounce.

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f0176881bf3d1fe618dab0",
      "reason": "Unknown reason",
      "created_at": "2021-06-29T07:04:01.298000Z",
      "recipient": {
        "id": "60f0176881bf3d1fe618daaf",
        "email": "test@example.com",
        "created_at": "2021-06-29T07:04:01.298000Z",
        "updated_at": "2021-06-29T07:04:01.298000Z",
        "deleted_at": "",
        "domain": {
          "id": "7nxe3yjmeq28vp0k",
          "name": "mailersend.com",
          "created_at": "2021-07-15T11:04:44.000000Z",
          "updated_at": "2021-07-15T11:04:45.000000Z"
        }
      }
    }
  ],
  "links": {
    "first": "https://api.mailersend.com/v1/suppressions/hard-bounces?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "current_page_url": "https://api.mailersend.com/v1/suppressions/hard-bounces?page=1",
    "from": 1,
    "path": "https://api.mailersend.com/v1/suppressions/hard-bounces",
    "per_page": 10,
    "to": 1
  }
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Spam Complaints

Retrieve the recipients who have made a spam complaint for an account or domain by passing its ID with this GET request:

GET https://api.mailersend.com/v1/suppressions/spam-complaints

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
limitintnoMin: 10, Max: 100Default: 10
pageintnoMin: 1
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->spamComplaint->getAll('domain_id', 1, 15);

More examples

Responses

Response keyTypeDetails
data.*object[]Array of spam complaints.
data.*.recipientobjectRecipient related to the spam complaint.
data.*.recipient.domainobjectDomain related to the spam complaint.

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f0176981bf3d1fe618dab4",
      "created_at": "2021-06-29T07:04:01.298000Z",
      "recipient": {
        "id": "60f0176881bf3d1fe618dab3",
        "email": "pmcdermott@example.net",
        "created_at": "2021-06-29T07:04:01.298000Z",
        "updated_at": "2021-06-29T07:04:01.298000Z",
        "deleted_at": "",
        "domain": {
          "id": "7nxe3yjmeq28vp0k",
          "name": "mailersend.com",
          "created_at": "2021-07-15T11:04:44.000000Z",
          "updated_at": "2021-07-15T11:04:45.000000Z"
        }
      }
    }
  ],
  "links": {
    "first": "https://api.mailersend.com/v1/suppressions/spam-complaints?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "current_page_url": "https://api.mailersend.com/v1/suppressions/spam-complaints?page=1",
    "from": 1,
    "path": "https://api.mailersend.com/v1/suppressions/spam-complaints",
    "per_page": 10,
    "to": 1
  }
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Unsubscribes

Retrieve the unsubscribed recipients for an account or domain by passing its ID with this GET request:

GET https://api.mailersend.com/v1/suppressions/unsubscribes

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
limitintnoMin: 10, Max: 100Default: 10
pageintnoMin: 1
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->unsubscribe->getAll('domain_id', 1, 15);

More examples

Responses

Response keyTypeDetails
data.*object[]Array of unsubscribes.
data.*.recipientobjectRecipient related to the unsubscribe.
data.*.recipient.domainobjectDomain related to the unsubscribe.

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f0176881bf3d1fe618dab2",
      "reason": "NEVER_SIGNED",
      "readable_reason": "I never signed up for this mailing list",
      "recipient": {
        "id": "60f0176881bf3d1fe618dab1",
        "email": "taya86@example.com",
        "created_at": "2021-06-29T07:04:01.298000Z",
        "updated_at": "2021-06-29T07:04:01.298000Z",
        "deleted_at": "",
        "domain": {
          "id": "7nxe3yjmeq28vp0k",
          "name": "mailersend.com",
          "created_at": "2021-07-15T11:04:44.000000Z",
          "updated_at": "2021-07-15T11:04:45.000000Z"
        }
      },
      "created_at": "2021-06-29T07:04:01.298000Z"
    }
  ],
  "links": {
    "first": "https://api.mailersend.com/v1/suppressions/unsubscribes?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "current_page_url": "https://api.mailersend.com/v1/suppressions/unsubscribes?page=1",
    "from": 1,
    "path": "https://api.mailersend.com/v1/suppressions/unsubscribes",
    "per_page": 10,
    "to": 1
  }
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

On Hold List

Retrieve on hold recipients for an account or domain by passing its ID with this GET request:

GET https://api.mailersend.com/v1/suppressions/on-hold-list

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
limitintnoMin: 10, Max: 100Default: 10
pageintnoMin: 1
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

$mailersend->onHoldList->getAll('domain_id', 1, 15);

More examples

Responses

Response keyTypeDetails
data.*object[]Array of on hold list.
data.*.recipientobjectRecipient on hold.
data.*.recipient.domainobjectDomain related to the on hold recipient.

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "64c760a33e2db0f6340f4710",
      "created_at": "2023-07-15T19:22:37.579000Z",
      "on_hold_until": "2023-07-18T19:22:37.579000Z",
      "email": "shanna.fadel@example.net",
      "recipient": {
        "id": "64c760a33e2db0f6340f470f",
        "email": "shanna.fadel@example.net",
        "created_at": "2023-07-15T19:22:37.579000Z",
        "updated_at": "2023-07-15T19:22:37.579000Z",
        "deleted_at": "",
        "domain": {
          "id": "7nxe3yjmeq28vp0k",
          "name": "mailerlite.com",
          "created_at": "2023-07-31T07:18:59.000000Z",
          "updated_at": "2023-07-31T07:19:23.000000Z"
        }
      }
    }
  ],
  "links": {
    "first": "https://api.mailersend.com/v1/suppressions/on-hold-list?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "current_page_url": "https://api.mailersend.com/v1/suppressions/on-hold-list?page=1",
    "from": 1,
    "path": "https://api.mailersend.com/v1/suppressions/on-hold-list",
    "per_page": 10,
    "to": 1
  }
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Add recipients to a suppression list

Blocklist

Add a recipient to a blocklist with this POST request:

POST https://api.mailersend.com/v1/suppressions/blocklist

Request Body

{
    "domain_id": "83gwk2j7zqz1nxyd",
    "recipients": [
      "test@example.com"
    ],
    "patterns": [
      ".*@example.com"
    ]
}

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringno
recipients[]string[]noIf patterns is not defined, this property is required.
recipients.*stringyesMust be an email.
patterns[]string[]noIf recipients is not defined, this property is required.
patterns.*stringyes

Responses

Response keyTypeDetails
data.*object[]Array of blocklist entries created.

Valid

Response Code: 201 Created
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f198790542d97fb66dfe52",
      "type": "exact",
      "pattern": "test@example.com",
      "created_at": "2021-07-16T14:32:25.457000Z",
      "updated_at": "2021-07-16T14:32:25.457000Z"
    },
    {
      "id": "60f198790542d97fb66dfe53",
      "type": "pattern",
      "pattern": ".*@example.com",
      "created_at": "2021-07-16T14:32:25.476000Z",
      "updated_at": "2021-07-16T14:32:25.476000Z"
    }
  ]
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Hard Bounces

Add a hard bounce for one or more recipients with this POST request:

POST https://api.mailersend.com/v1/suppressions/hard-bounces

Request Body

{
  "domain_id": "83gwk2j7zqz1nxyd",
  "recipients": [
    "test@example.com"
  ]
}

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringyes
recipients[]string[]yes
recipients.*stringyesMust be an email.

Responses

Response keyTypeDetails
data.*object[]Array of hard bounces created.
data.*.recipientobjectRecipient related to the hard bounce.
data.*.recipient.domainobjectDomain related to the hard bounce.

Valid

Response Code: 201 Created
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f1a0195c14080bbc606293",
      "reason": null,
      "created_at": "2021-07-16T15:04:57.939000Z",
      "recipient": {
        "id": "60f1a0195c14080bbc606292",
        "email": "test@example.com",
        "created_at": "2021-07-16T15:04:57.888000Z",
        "updated_at": "2021-07-16T15:04:57.907000Z",
        "deleted_at": "",
        "domain": {
          "id": "7nxe3yjmeq28vp0k",
          "name": "mailersend.com",
          "created_at": "2021-07-15T11:04:44.000000Z",
          "updated_at": "2021-07-15T11:04:45.000000Z"
        }
      }
    }
  ]
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Spam Complaints

Add a spam complaint for one or more recipients with this POST request:

POST https://api.mailersend.com/v1/suppressions/spam-complaints

Request Body

{
  "domain_id": "83gwk2j7zqz1nxyd",
  "recipients": [
    "test@example.com"
  ]
}

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringyes
recipients[]string[]yes
recipients.*stringyesMust be an email.

Responses

Response keyTypeDetails
data.*object[]Array of spam complaints created.
data.*.recipientobjectRecipient related to the spam complaint.
data.*.recipient.domainobjectDomain related to the spam complaint.

Valid

Response Code: 201 Created
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f1a9fa33d68f023f2d3972",
      "created_at": "2021-07-16T15:47:06.280000Z",
      "recipient": {
        "id": "60f1a0195c14080bbc606292",
        "email": "test@example.com",
        "created_at": "2021-07-16T15:04:57.888000Z",
        "updated_at": "2021-07-16T15:47:06.244000Z",
        "deleted_at": "",
        "domain": {
          "id": "7nxe3yjmeq28vp0k",
          "name": "mailersend.com",
          "created_at": "2021-07-15T11:04:44.000000Z",
          "updated_at": "2021-07-15T11:04:45.000000Z"
        }
      }
    }
  ]
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Unsubscribes

Set one or more recipients as unsubscribed with this POST request:

POST https://api.mailersend.com/v1/suppressions/unsubscribes

Request Body

{
  "domain_id": "83gwk2j7zqz1nxyd",
  "recipients": [
    "test@example.com"
  ]
}

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringyes
recipients[]string[]yes
recipients.*stringyesMust be an email.

Responses

Response keyTypeDetails
data.*object[]Array of unsubscribe entries created.
data.*.recipientobjectRecipient related to the unsubscribe.
data.*.recipient.domainobjectDomain related to the unsubscribe.

Valid

Response Code: 201 Created
Response Headers:
	content-type: application/json
{
  "data": [
    {
      "id": "60f53a20506faf239d471ff2",
      "reason": null,
      "readable_reason": null,
      "recipient": {
        "id": "60f1a0195c14080bbc606292",
        "email": "test@example.com",
        "created_at": "2021-07-16T15:04:57.888000Z",
        "updated_at": "2021-07-19T08:38:56.243000Z",
        "deleted_at": "",
        "domain": {
          "id": "7nxe3yjmeq28vp0k",
          "name": "mailersend.com",
          "created_at": "2021-07-15T11:04:44.000000Z",
          "updated_at": "2021-07-15T11:04:45.000000Z"
        }
      },
      "created_at": "2021-07-19T08:38:56.283000Z"
    }
  ]
}

Error

Response Code: 422 Unprocessable Entity

See - Validation errors

Delete recipients from a suppression list

Blocklist

Delete one or more blocklist entries with this DELETE request:

DELETE https://api.mailersend.com/v1/suppressions/blocklist

Request Body

To delete specific entries:

{
  "ids": [
    "60f198790542d97fb66dfe52",
    "60f198790542d97fb66dfe53"
  ]
}

To delete all entries:

{
  "all": true
}
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

// Delete specific instances
$mailersend->blocklist->delete(['id_one', 'id_two']);

// or delete all
$mailersend->blocklist->delete(null, true);

// You can also specify the domain
$mailersend->blocklist->delete(['id'], false, 'domain_id');

More examples

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringno
idsstring[]noRequired if all is not defined.
allbooleannoRequired if ids is not defined.

Responses

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
[]

Error

Response Code: 422 Unprocessable Entity
{
  "message": "The given data was invalid.",
  "errors": {
    "ids.0": [
      "The selected ids.0 is invalid."
    ],
    "ids.1": [
      "The selected ids.1 is invalid."
    ]
  }
}

See - Validation errors

Hard Bounces

Delete one or more hard bounces from recipients by passing the hard bounces IDs with this DELETE request:

DELETE https://api.mailersend.com/v1/suppressions/hard-bounces

Request Body

To delete specific entries:

{
  "ids": [
    "60d0563fd4fb3212e2065522",
    "60ae0999c3da7c275f3b5589"
  ]
}

To delete all entries:

{
  "all": true
}
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

// Delete specific instances
$mailersend->hardBounce->delete(['id_one', 'id_two']);

// or delete all
$mailersend->hardBounce->delete(null, true);

// You can also specify the domain
$mailersend->hardBounce->delete(['id'], false, 'domain_id');

More examples

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringno
idsstring[]noRequired if all is not defined.
allbooleannoRequired if ids is not defined.

Responses

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
[]

Error

Response Code: 422 Unprocessable Entity
{
  "message": "The given data was invalid.",
  "errors": {
    "ids.0": [
      "The selected ids.0 is invalid."
    ],
    "ids.1": [
      "The selected ids.1 is invalid."
    ]
  }
}

See - Validation errors

Spam Complaints

Delete one or more spam complaints from recipients by providing the spam complaint IDs with this DELETE request:

DELETE https://api.mailersend.com/v1/suppressions/spam-complaints

Request Body

To delete specific entries:

{
  "ids": [
    "60d32115d14907786d7fdd42",
    "60ae0999c3da7c275f3b558e"
  ]
}

To delete all entries:

{
  "all": true
}
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

// Delete specific instances
$mailersend->spamComplaint->delete(['id_one', 'id_two']);

// or delete all
$mailersend->spamComplaint->delete(null, true);

// You can also specify the domain
$mailersend->spamComplaint->delete(['id'], false, 'domain_id');

More examples

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringno
idsstring[]noRequired if all is not defined.
allbooleannoRequired if ids is not defined.

Responses

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
[]

Error

Response Code: 422 Unprocessable Entity
{
  "message": "The given data was invalid.",
  "errors": {
    "ids.0": [
      "The selected ids.0 is invalid."
    ],
    "ids.1": [
      "The selected ids.1 is invalid."
    ]
  }
}

See - Validation errors

Unsubscribes

Delete one or more unsubscribe entries from recipients by passing the unsubscribe IDs with this DELETE request:

DELETE https://api.mailersend.com/v1/suppressions/unsubscribes

Request Body

To delete specific entries:

{
  "ids": [
    "60d3169d8dc7b007f356d142",
    "60ae0999c3da7c275f3b558b"
  ]
}

To delete all entries:

{
  "all": true
}
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

// Delete specific instances
$mailersend->unsubscribe->delete(['id_one', 'id_two']);

// or delete all
$mailersend->unsubscribe->delete(null, true);

// You can also specify the domain
$mailersend->unsubscribe->delete(['id'], false, 'domain_id');

More examples

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringno
idsstring[]noRequired if all is not defined.
allbooleannoRequired if ids is not defined.

Responses

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
[]

Error

Response Code: 422 Unprocessable Entity
{
  "message": "The given data was invalid.",
  "errors": {
    "ids.0": [
      "The selected ids.0 is invalid."
    ],
    "ids.1": [
      "The selected ids.1 is invalid."
    ]
  }
}

See - Validation errors

On Hold List

Delete one or more recipient entries from on hold list by passing the on hold list IDs with this DELETE request:

DELETE https://api.mailersend.com/v1/suppressions/on-hold-list

Request Body

To delete specific entries:

{
  "ids": [
    "64c760a33e2db0f6340f4710",
    "64c760a33e2db0f6340f470e"
  ]
}

To delete all entries:

{
  "all": true
}
use MailerSend\MailerSend;

$mailersend = new MailerSend(['api_key' => 'key']);

// Delete specific instances
$mailersend->onHoldList->delete(['id_one', 'id_two']);

// or delete all
$mailersend->onHoldList->delete(null, true);

More examples

Request parameters

JSON parameters are provided in dot notation.

JSON parameterTypeRequiredLimitationsDetails
domain_idstringno
idsstring[]noRequired if all is not defined.
allbooleannoRequired if ids is not defined.

Responses

Valid

Response Code: 200 OK
Response Headers:
	content-type: application/json
[]

Error

Response Code: 422 Unprocessable Entity
{
  "message": "The given data was invalid.",
  "errors": {
    "ids.0": [
      "The selected ids.0 is invalid."
    ],
    "ids.1": [
      "The selected ids.1 is invalid."
    ]
  }
}

See - Validation errors

On this page