Inbound routing

Get a list of inbound routes

If you want to retrieve information about multiple inbound routes, use this GET request:

GET https://api.mailersend.com/v1/inbound
1

Request parameters

URL parameterTypeRequiredLimitationsDetails
domain_idstringno
pageintno
limitintnoMin: 10, Max: 100Default: 25

Responses

Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": [
    {
      "id": "v57gn2j67qlr6z4d",
      "name": "Test name",
      "address": "imxbfppzn7cbhak9lef5@inbound.mailersend.net",
      "domain": "test.remotecompany.com",
      "dns_checked_at": null,
      "enabled": true,
      "filters": [
        {
          "type": "catch_recipient",
          "key": null,
          "comparer": "equal",
          "value": "test"
        },
        {
          "type": "match_all",
          "key": null,
          "comparer": null,
          "value": null
        }
      ],
      "forwards": [
        {
          "type": "webhook",
          "value": "https:\/\/yourapp.com\/hook",
          "secret": "jYhafQeTihgw0qWclkUA7cbqTG3Zfh2j"
        }
      ],
      "mxValues": {
        "priority": 10,
        "target": "inbound.mailersend.net"
      }
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

Error

Response Code: 404 Not Found
1

Get a single inbound route

If you want to retrieve a single inbound route, use this GET request:

GET https://api.mailersend.com/v1/inbound/{inbound_id}
1

Request parameters

URL parameterTypeRequiredLimitationsDetails
inbound_idstringyes

Responses

Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": {
    "id": "v57gn2j67qlr6z4d",
    "name": "Test name",
    "address": "imxbbppzn7cbhak9lef5@inbound.mailersend.net",
    "domain": "test.remotecompany.com",
    "dns_checked_at": null,
    "enabled": true,
    "filters": [
      {
        "type": "catch_recipient",
        "key": null,
        "comparer": "equal",
        "value": "test"
      },
      {
        "type": "match_all",
        "key": null,
        "comparer": null,
        "value": null
      }
    ],
    "forwards": [
      {
        "id": "v57gn2j67qlr6z4d",
        "type": "webhook",
        "value": "https:\/\/yourapp.com\/hook",
        "secret": "jYhafQeTiZgw0qWxlkUA7cbqTG3Zfh2j"
      }
    ],
    "mxValues": {
      "priority": 10,
      "target": "inbound.mailersend.net"
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Error

Response Code: 404 Not Found
1

Add an inbound route

If you want to add a new inbound route to a domain, use this POST request:

POST https://api.mailersend.com/v1/inbound
1

Request body

{
  "domain_id": "7nxe3yjmeq28vp0k",
  "name": "Test name",
  "domain_enabled": true,
  "inbound_domain": "test.remotecompany.com",
  "inbound_address": "test@inbound.mailersend.net",
  "inbound_subdomain": "inbound",
  "match_filter": {
    "type": "match_all"
  },
  "catch_filter": {
    "type": "catch_recipient",
    "filters": [
      {
        "comparer": "equal",
        "value": "test"
        }
    ]
  },
  "forwards": [
    {
      "type": "webhook",
      "value": "https://www.mailersend.com/hook"
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

Request Parameters

JSON parameters are provided in dot notation

JSON ParameterTypeRequiredLimitationsDetails
domain_idstringyes
namestringyesMax 191 characters.
domain_enabledbooleanyes
inbound_domainstringyes**Max 191 characters, unique, and must end with the current domain name.
catch_filterobject[]yes**
catch_filter.typestringyesMust be one of the inbound's types: catch_all, catch_recipient, match_all, match_sender, match_domain, match_header.
catch_filter.filtersobject[]yes***Max 5.
catch_filter.filters.*.comparerstringyesMust be one of the comparers: equal, not-equal, contains, not-contains, starts-with, ends-with, not-starts-with, not-ends-with.
catch_filter.filters.*.valuestringyesMax 191 characters.
match_filterobject[]yes
match_filter.typestringyesMust be one of the inbound's types: catch_all, catch_recipient, match_all, match_sender, match_domain, match_header.
match_filter.filtersobject[]yes***Max 5.
match_filter.filters.*.comparerstringyesMust be one of the comparers: equal, not-equal, contains, not-contains, starts-with, ends-with, not-starts-with, not-ends-with.
match_filter.filters.*.valuestringyesMax 191 characters.
match_filter.filters.*.keystringyes****Max 191 characters.
forwardsobject[]yesMin 1 and max 5.
forwards.*.typestringyesMust be either email or webhook.
forwards.*.valuestringyesMust be distinct, max 191 characters. If its type is webhook, it must be a valid URL. If its type is email, it must be a valid email address.
* Required if inbound is not enabled.
** Required if inbound is enabled.
*** Required if inbound is enabled and filter type is not match_all.
**** Required if match type is match_header.

Responses

Response KeyTypeDetails
dataobjectInbound object created.

Valid

Response Code: 201 CREATED
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": {
    "id": "v57gn2j67qlr6z4d",
    "name": "Test name",
    "address": "imxbfnpzn7cbhak9lef5@inbound.mailersend.net",
    "domain": "test.remotecompany.com",
    "dns_checked_at": null,
    "enabled": true,
    "filters": [
      {
        "type": "catch_recipient",
        "key": null,
        "comparer": "equal",
        "value": "test"
      },
      {
        "type": "match_all",
        "key": null,
        "comparer": null,
        "value": null
      }
    ],
    "forwards": [
      {
        "type": "webhook",
        "value": "https:\/\/yourapp.com\/hook",
        "secret": "jYhafQeTiZgw0qWclkUA7cbqTG3Zfh2j"
      }
    ],
    "mxValues": {
      "priority": 10,
      "target": "inbound.mailersend.net"
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Invalid

Response Code: 422 Unprocessable Entity
1

See - Validation errors

Update an inbound route

If you want to update the information of an existing inbound route, use this PUT request:

PUT https://api.mailersend.com/v1/inbound/{inbound_id}
1

Request body

{
	"domain_id": "7nxe3yjmeq28vp0k",
	"name": "Test update",
	"domain_enabled": true,
	"inbound_domain": "test.remotecompany.com",
	"inbound_address": "test@inbound.mailersend.net",
	"inbound_subdomain": "inbound",
	"match_filter": {
		"type": "match_all"
	},
	"catch_filter": {
		"type": "catch_recipient",
		"filters": [
			{
				"comparer": "equal",
				"value": "test"
			}
		]
	},
	"forwards": [
		{
			"type": "webhook",
			"value": "https://yourapp.com/hook"
		}
	]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

Request Parameters

URL parameterTypeRequiredLimitationsDetails
inbound_idstringyes

JSON parameters are provided in dot notation

JSON ParameterTypeRequiredLimitationsDetails
namestringyesMax 191 characters.
domain_enabledbooleanyes
inbound_domainstringyes**Max 191 characters, unique, and must end with the current domain name.
catch_filterobject[]yes**
catch_filter.typestringyesMust be one of the inbound's types: catch_all, catch_recipient, match_all, match_sender, match_domain, match_header.
catch_filter.filtersobject[]yes***Max 5.
catch_filter.filters.*.comparerstringyesMust be one of the comparers: equal, not-equal, contains, not-contains, starts-with, ends-with, not-starts-with, not-ends-with.
catch_filter.filters.*.valuestringyesMax 191 characters.
match_filterobject[]yes
match_filter.typestringyesMust be one of the inbound's types: catch_all, catch_recipient, match_all, match_sender, match_domain, match_header.
match_filter.filtersobject[]yes***Max 5.
match_filter.filters.*.comparerstringyesMust be one of the comparers: equal, not-equal, contains, not-contains, starts-with, ends-with, not-starts-with, not-ends-with.
match_filter.filters.*.valuestringyesMax 191 characters.
match_filter.filters.*.keystringyes****Max 191 characters.
forwardsobject[]yesMin 1 and max 5.
forwards.*.typestringyesMust be either email or webhook.
forwards.*.valuestringyesMust be distinct, max 191 characters. If its type is webhook, it must be a valid URL. If its type is email, it must be a valid email address.
* Required if inbound is not enabled.
** Required if inbound is enabled.
*** Required if inbound is enabled and filter type is not match_all.
**** Required if match type is match_header.

Responses

Response KeyTypeDetails
dataobjectInbound object created.

Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": {
    "id": "v57gn2j67qlr6z4d",
    "name": "Test update",
    "address": "qi5onrgpw4ujkiqg0p9b@inbound.mailersend.net",
    "domain": "test.remotecompany.com",
    "dns_checked_at": null,
    "enabled": true,
    "filters": [
      {
        "type": "catch_recipient",
        "key": null,
        "comparer": "equal",
        "value": "test"
      },
      {
        "type": "match_all",
        "key": null,
        "comparer": null,
        "value": null
      }
    ],
    "forwards": [
      {
        "type": "webhook",
        "value": "https:\/\/yourapp.com\/hook",
        "secret": "jYhafQeTiZgw0qWclkUA7cnqTG3Zfh2j"
      }
    ],
    "mxValues": {
      "priority": 10,
      "target": "inbound.mailersend.net"
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Invalid

Response Code: 422 Unprocessable Entity
1

See - Validation errors

Delete an inbound route

If you want to delete an inbound route, use this DELETE request:

DELETE https://api.mailersend.com/v1/inbound/{inbound_id}
1

Request parameters

URL parameterTypeRequiredLimitationsDetails
inbound_idstringyes

Responses

Valid

Response Code: 200 OK
1

Error

Response Code: 404 Not Found
1
Last Updated: