GET /api/v1/templates
Each template carries id, name, defaultSubject, content and its createdAt / updatedAt
dates. Nothing else.
Authorization
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Allowed |
Query parameters
| Parameter | Type | Description |
|---|---|---|
search | string | Matches the template name, case-insensitive |
page | number | Defaults to 1 |
limit | number | Defaults 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
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data[].id | string | Unique identifier for the template |
data[].name | string | Name of the template |
data[].defaultSubject | string | Subject a campaign inherits, and may override |
data[].content | string | The complete HTML document |
data[].createdAt | string | ISO creation date |
data[].updatedAt | string | ISO date of the last change |
pagination | object | {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
}
}