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 parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
domain_id | string | no | ||
page | int | no | ||
limit | int | no | Min: 10 , Max: 100 | Default: 25 |
Responses
Valid
Response Code: 200 OK
Response Headers:
Content-Type: application/json
1
2
3
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
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 parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
inbound_id | string | yes |
Responses
Valid
Response Code: 200 OK
Response Headers:
Content-Type: application/json
1
2
3
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
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
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 Parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
domain_id | string | yes | ||
name | string | yes | Max 191 characters. | |
domain_enabled | boolean | yes | ||
inbound_domain | string | yes** | Max 191 characters, unique, and must end with the current domain name. | |
catch_filter | object[] | yes** | ||
catch_filter.type | string | yes | Must be one of the inbound's types: catch_all , catch_recipient , match_all , match_sender , match_domain , match_header . | |
catch_filter.filters | object[] | yes*** | Max 5. | |
catch_filter.filters.*.comparer | string | yes | Must be one of the comparers: equal , not-equal , contains , not-contains , starts-with , ends-with , not-starts-with , not-ends-with . | |
catch_filter.filters.*.value | string | yes | Max 191 characters. | |
match_filter | object[] | yes | ||
match_filter.type | string | yes | Must be one of the inbound's types: catch_all , catch_recipient , match_all , match_sender , match_domain , match_header . | |
match_filter.filters | object[] | yes*** | Max 5. | |
match_filter.filters.*.comparer | string | yes | Must be one of the comparers: equal , not-equal , contains , not-contains , starts-with , ends-with , not-starts-with , not-ends-with . | |
match_filter.filters.*.value | string | yes | Max 191 characters. | |
match_filter.filters.*.key | string | yes**** | Max 191 characters. | |
forwards | object[] | yes | Min 1 and max 5. | |
forwards.*.type | string | yes | Must be either email or webhook . | |
forwards.*.value | string | yes | Must 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.
match_all
.
*** Required if inbound is enabled and filter type is not match_header
.
**** Required if match type is Responses
Response Key | Type | Details |
---|---|---|
data | object | Inbound object created. |
Valid
Response Code: 201 CREATED
Response Headers:
Content-Type: application/json
1
2
3
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
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
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 parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
inbound_id | string | yes |
JSON parameters are provided in dot notation
JSON Parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
name | string | yes | Max 191 characters. | |
domain_enabled | boolean | yes | ||
inbound_domain | string | yes** | Max 191 characters, unique, and must end with the current domain name. | |
catch_filter | object[] | yes** | ||
catch_filter.type | string | yes | Must be one of the inbound's types: catch_all , catch_recipient , match_all , match_sender , match_domain , match_header . | |
catch_filter.filters | object[] | yes*** | Max 5. | |
catch_filter.filters.*.comparer | string | yes | Must be one of the comparers: equal , not-equal , contains , not-contains , starts-with , ends-with , not-starts-with , not-ends-with . | |
catch_filter.filters.*.value | string | yes | Max 191 characters. | |
match_filter | object[] | yes | ||
match_filter.type | string | yes | Must be one of the inbound's types: catch_all , catch_recipient , match_all , match_sender , match_domain , match_header . | |
match_filter.filters | object[] | yes*** | Max 5. | |
match_filter.filters.*.comparer | string | yes | Must be one of the comparers: equal , not-equal , contains , not-contains , starts-with , ends-with , not-starts-with , not-ends-with . | |
match_filter.filters.*.value | string | yes | Max 191 characters. | |
match_filter.filters.*.key | string | yes**** | Max 191 characters. | |
forwards | object[] | yes | Min 1 and max 5. | |
forwards.*.type | string | yes | Must be either email or webhook . | |
forwards.*.value | string | yes | Must 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.
match_all
.
*** Required if inbound is enabled and filter type is not match_header
.
**** Required if match type is Responses
Response Key | Type | Details |
---|---|---|
data | object | Inbound object created. |
Valid
Response Code: 200 OK
Response Headers:
Content-Type: application/json
1
2
3
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
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 parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
inbound_id | string | yes |
Responses
Valid
Response Code: 200 OK
1
Error
Response Code: 404 Not Found
1