For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get all Email Templates

Get all email templates existing in your account, as a single unpaginated array.

If your account holds enough templates for the response size to matter, see the experimental GET /api/templates, which returns the same templates one page at a time.

get
Authorizations
Api-TokenstringRequired

API token in Api-Token header

Responses
200

OK.

application/json
idintegerOptional
uuidstring · uuidOptional
namestring · max: 255Optional
categorystring · max: 255Optional
subjectstring · max: 255Optional
body_textstring · max: 10000000Optional
body_htmlstring · max: 10000000Optional
created_atstring · date-timeOptional
updated_atstring · date-timeOptional
get/api/email_templates
curl -X GET "https://mailtrap.io/api/email_templates" \
  -H "Api-Token: YOUR_API_KEY"
[
  {
    "id": 26730,
    "uuid": "018dd5e3-f6d2-7c00-8f9b-e5c3f2d8a132",
    "name": "My Email Template",
    "subject": "Promotional Email",
    "category": "Promotional",
    "body_html": "<div>Template Body</div>",
    "body_text": "Template Body",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z"
  }
]

Last updated

Was this helpful?