# Templates

# Get templates

Get the account templates using this GET request:

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

# 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
{
  "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
  }
}

# Get a single template

Get the information of a template, its category, domain, and stats using this GET request:

GET https://api.mailersend.com/v1/templates/{template_id}

# 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
    }
  }
}

# Error

Response Code: 404 Not Found

# Delete a template

Delete a template this DELETE request:

DELETE  https://api.mailersend.com/v1/templates/{template_id}

# Request parameters

URL parameter Type Required Limitations Details
template_id string yes

# Responses

# Valid

Response Code: 200 OK
Response Body: [EMPTY]

# Error

Response Code: 404 Not Found
Last updated: 11/29/2021, 1:49:54 PM