List templates

GET /api/v1/templates Each template carries id, name, defaultSubject, content and its createdAt / updatedAt dates. Nothing else.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERAllowed
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Query parameters

ParameterTypeDescription
searchstringMatches the template name, case-insensitive
pagenumberDefaults to 1
limitnumberDefaults to 20, capped at 100

Example

bash
curl -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/templates?search=newsletter"

Response

  • 200 OK — the call succeeded.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data[].idstringUnique identifier for the template
data[].namestringName of the template
data[].defaultSubjectstringSubject a campaign inherits, and may override
data[].contentstringThe complete HTML document
data[].createdAtstringISO creation date
data[].updatedAtstringISO date of the last change
paginationobject{total, page, limit, totalPages}

Example response

json
{
  "success": true,
  "data": [
    {
      "id": "4d19c0a2",
      "name": "Newsletter",
      "defaultSubject": "August news",
      "content": "<html>…</html>",
      "createdAt": "2026-08-23T10:22:05.000Z",
      "updatedAt": "2026-08-23T10:22:05.000Z"
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 20,
    "totalPages": 1
  }
}