Skip to main content
POST

Authorizations

Authorization
string
header
required

Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.

Headers

Content-Type
string
default:application/json
required

Request body type

Body

application/json
page
integer
default:1

Page number (1-indexed). Defaults to 1 when omitted. page=0 is silently treated as page=1. page * limit > 100000 returns 400.

Required range: x >= 1
limit
integer
default:10

Maximum rows per page.

Minimum: 10 Maximum: 100

When include_content=true, server silently clamps to 20 regardless of the requested value.

Required range: 10 <= x <= 100
template_type
string

Comma-separated filter. Allowed tokens: html, amp.

  • Omitted or empty: no filter (all types).
  • "html": HTML templates only (matches every non-AMP row, including legacy Stripo/DnD/plugin types).
  • "amp": AMP templates only.
  • "html,amp": both (equivalent to no filter).

Whitespace around commas is trimmed. Unknown tokens (e.g. "plaintext") return 400. Trailing comma returns 400.

status
string
default:saved

Comma-separated filter. Allowed tokens: saved, draft.

  • Omitted or empty: defaults to "saved" only.
  • "saved": published templates.
  • "draft": in-progress templates.
  • "saved,draft": both.

Unknown tokens return 400.

category_id
integer

Optional. Filter to a single template category. Omitted = no filter (all categories). 0 filters to uncategorized templates only. Negative values return 400. Not echoed back in response rows.

Use GET /v1/templates/categories/list to enumerate available categories.

search_name
string

Case-insensitive substring match on template name. Maximum 100 characters. Whitespace-only input is treated as no filter. % and _ are escaped before matching (no SQL LIKE wildcard injection).

Maximum string length: 100
sort_field
enum<string>
default:modified_date

Field to sort by.

Supported values: name, created_date, modified_date.

An implicit id DESC secondary sort is always applied for stable pagination across rows with tied timestamps.

Available options:
name,
created_date,
modified_date
sort_order
enum<string>
default:desc

Sort direction.

Supported values: asc, ASC, desc, DESC.

Available options:
asc,
ASC,
desc,
DESC
include_content
boolean
default:false

When true, response rows include html, amp_content, and plain_text fields populated with the full template content. Server-side: limit is silently clamped to 20, and the total response is bounded by a 10 MB soft budget. When the budget is exceeded after the first row, remaining rows are skipped and truncated: true is set.

Response

OK

data
object[]
template_count
integer

Total matching rows across the entire result set, ignoring pagination AND truncation.

truncated
boolean

true when the response budget engaged and some rows that would otherwise have fit were skipped. Always present in 200 responses, even in metadata mode (where it is always false).