Skip to content
Developers

Email Marketing

Templates

Create designs with the API, then reference templateId or templateVersionId in campaigns or transactional sends.

HTML authoring (agents and API)

Use inline style attributes, tables for layout, and {{merge_tags}} for personalization (for example {{first_name}}). We store and send your HTML as provided — there is no Tailwind build step.

Utility classes such as class="flex gap-4 text-primary" will not apply in Gmail, Outlook, and most other inboxes. The in-app visual editor also does not interpret Tailwind when importing HTML; it loads markup into a drag-and-drop email canvas. If you need a polished layout from code, inline the CSS yourself or author in MJML and send mjmlSource instead.

Create a template

POST/api/v1/email/templatestemplates:write
nameRequired. Unique per organization.
htmlPreferred. Full email HTML (inline CSS, tables for layout). Merge tags like {{first_name}}. Mutually exclusive with mjmlSource and blocks.
mjmlSourceOptional. MJML compiled to HTML on save — use only if you already write MJML.
blocksOptional. Legacy block JSON schema — not the dashboard GrapesJS project. Prefer html for agents.
descriptionOptional.
previewTextOptional inbox preview line when compiling from MJML/blocks.
curl
curl -sS https://api.thealtermeai.com/api/v1/email/templates \
  -H "Authorization: Bearer emk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Password reset",
    "html": "<html><body><p>Hi {{first_name}}, reset here.</p></body></html>"
  }'

Returns 201 with template.latestVersionId. Pass that id as templateVersionId when creating a campaign, or templateId to pin the latest version automatically. For transactional mail, use templateId or the template name on POST /api/v1/email/messages.

List and fetch

GET/api/v1/email/templatestemplates:read

Metadata only (id, name, latest version ids). includeArchived=true includes archived templates.

GET/api/v1/email/templates/{templateId}templates:read

Add includeHtml=true to include compiledHtml on the template and each version.

PATCH/api/v1/email/templates/{templateId}templates:write

Send html, mjmlSource, or blocks to mint a new version. Set isArchived: true to archive; use force: true if campaigns already used the template.

Sender identities

GET/api/v1/email/sender-identitiescampaigns:read
POST/api/v1/email/sender-identitiescampaigns:write

Lists or creates From addresses on verified domains. Campaign fromEmail must match a sendable row. DNS verification is still done in the app under Email → Domains. API keys need templates:write for templates and campaigns:write for sender identities — use the Agents & API preset when creating a key, or Edit an existing key.

curl (list)
curl -sS https://api.thealtermeai.com/api/v1/email/sender-identities?sendableOnly=true \
  -H "Authorization: Bearer emk_YOUR_KEY"

Full guide: Sender identities (includes POST to create).