GET /api/v1/template-gallery
Models come in gallery order — position, then name.
json
{
"success": true,
"data": [
{
"id": "…",
"name": "Plain letter",
"description": "A one-column letter",
"defaultSubject": "News of the month",
"content": "<html>…</html>",
"previewImageUrl": "https://…/plain-letter.png",
"colorScheme": "fixed",
"position": 3,
"createdAt": "…",
"updatedAt": "…"
}
],
"pagination": {"total": 1, "page": 1, "limit": 20, "totalPages": 1}
}colorScheme is read from the HTML on every request, never stored: adaptive means the model
carries its own dark mode rules, fixed means it looks the same everywhere. If you edit your copy
later, that answer is about the model you started from — not about what you made of it.
Authorization
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Allowed |
Query parameters
| Parameter | Type | Description |
|---|---|---|
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/template-gallery"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 design |
data[].name | string | Its name |
data[].defaultSubject | string | Subject it ships with |
data[].thumbnailUrl | string | null |
pagination | object | {total, page, limit, totalPages} |
Example response
json
{
"success": true,
"data": [
{
"id": "4d19c0a2",
"name": "Newsletter",
"defaultSubject": "August news",
"thumbnailUrl": "value"
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 20,
"totalPages": 1
}
}