Create an email template
Create an email template. With a prompt, AI generation starts asynchronously (202 — poll the returned generation). Without one the template is created synchronously (201) — seeded from your code when provided, otherwise a blank scaffold branded from your workspace. Approve a template to let POST /v1/emails seed new emails from its HTML and default sender headers.
Authorizations
Workspace API key, e.g. Authorization: Bearer tented_.... Create keys in Workspace Settings → API Keys.
Headers
Optional idempotency key. Replaying a request with the same key returns the stored result of the first attempt. If the first attempt is still in flight, the replay fails with 409 idempotency_in_progress.
Body
Internal name (never shown to recipients).
1 - 200Template HTML (up to 2 MB) for a hand-authored template. Mutually complementary with prompt: provide code to upload HTML, prompt to generate it.
1AI brief describing the template to generate.
1 - 10000Default subject line copied onto emails seeded from this template.
998Default preheader text for seeded emails.
200Default sender display name for seeded emails.
120Default sender address for seeded emails. Sending still requires a verified domain.
Default reply-to address for seeded emails.
Response
Template created (no prompt supplied).
Full email template object.
Email template ID.
Internal name (never shown to recipients).
Lifecycle state.
draft, approved Latest content version number.
How the template was created: upload for API- or hand-created templates, email for templates saved from an existing email.
upload, email Email the template was saved from, when source_type is email.
Default subject line copied onto emails seeded from this template.
Default preheader text for seeded emails.
Default sender display name for seeded emails.
Default sender address for seeded emails. Sending requires a verified domain.
Default reply-to address for seeded emails.
Version that is approved, or null.
Number of content versions (equals current_version).
Whether plain text has been manually overridden.
When the plain-text override was set.
True when HTML changed after a plain-text override, so the override may be stale.
Creation time.
Last update.
Who created the template (API key name or user).
Status of the most recent AI generation, when one exists.
generating, completed, failed API path to fetch the latest HTML, e.g. /v1/email-templates/{templateId}/content.
API path to fetch the plain-text rendition.