Get a template

GET /api/v1/templates/{templateId} One template, with its full HTML in content.
bash
curl -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/templates/$TEMPLATE_ID"
A template of another organization answers 404, like an id that does not exist.

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.

Path parameters

ParameterTypeDescription
templateIdstringRequired. The template to read

Example

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

Response

  • 200 OK — the call succeeded.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 404 Not Found — no such resource, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringIdentifier of the template
data.namestringIts name
data.defaultSubjectstringSubject a campaign inherits — and may override
data.contentstringThe complete HTML document
data.createdAt / updatedAtstringISO dates

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "name": "Newsletter",
    "defaultSubject": "August news",
    "content": "<html>…</html>",
    "createdAt` / `updatedAt": "value"
  }
}