Templates
Fetch templates created on MailerSend and other relevant information.
Get templates
Retrieve the account templates using this GET
request:
GET https://api.mailersend.com/v1/templates
1
Request parameters
JSON parameters are provided in dot notation.
JSON 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": "x8emy5o5world01w",
"name": "Signup email",
"type": "template type",
"image_path": "https://link.com/images/image.jpg",
"created_at": "2020-06-10 10:09:56",
},
{
"id": "x8emy5o5world01x",
"name": "Premium subscription",
"type": "template type",
"image_path": "https://link.com/images/image.jpg",
"created_at": "2020-06-10 10:09:56",
},
{
"id": "x8emy5o5world01y",
"name": "Newsletter",
"type": "template type",
"image_path": "https://link.com/images/image.jpg",
"created_at": "2020-06-10 10:09:56",
},
],
"links": {
"first": "https:\/\/www.mailersend.io\/api\/v1\/templates?page=1",
"last": "https:\/\/www.mailersend.io\/api\/v1\/templates?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https:\/\/www.mailersend.io\/api\/v1\/templates",
"per_page": 25,
"to": 3,
"total": 3
}
}
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
38
39
40
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
38
39
40
Get a single template
Retrieve the information of a single template, its category, domain, and stats using this GET
request:
GET https://api.mailersend.com/v1/templates/{template_id}
1
Request parameters
URL parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
template_id | string | yes |
Responses
Valid
{
"data": {
"id": "x8emy5o5world01w",
"name": "libero",
"type": "html",
"image_path": "http://mailersend.com/images/templates/placeholder.png",
"created_at": "2021-06-22T15:38:51.000000Z",
"category": {
"id": "5genxmqlgozlyvk7",
"name": "aut"
},
"domain": {
"id": "1jreeo",
"name": "domain.com",
...,
"domain_settings": {
...
},
"totals": {
"hard_bounced": 25,
"soft_bounced": 40,
"sent": 231,
"delivered": 109
}
},
"template_stats": {
"total": 0,
"processed": 0,
"queued": 0,
"sent": 0,
"rejected": 0,
"delivered": 0,
"last_email_sent_at": null
}
}
}
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
38
39
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
38
39
Error
Response Code: 404 Not Found
1
Delete a template
Delete a template with this DELETE
request:
DELETE https://api.mailersend.com/v1/templates/{template_id}
1
Request parameters
URL parameter | Type | Required | Limitations | Details |
---|---|---|---|---|
template_id | string | yes |
Responses
Valid
Response Code: 200 OK
Response Body: [EMPTY]
1
2
2
Error
Response Code: 404 Not Found
1