AppAutoGtm

Preview Emails Draft

Render a preview against UNSAVED template instructions.

Companion to GET /preview-emails. The GET reads from segment.email_templates (saved state). This POST takes the instructions inline so the editor can validate (preview + moderate) BEFORE persisting — template only lands in the DB after the user confirms a clean preview, then PATCH /segments fires Save.

No cache writes. Each call regenerates against the supplied instructions; the saved-state cache (generated_email) is keyed by email_templates_version and updates only via the GET path after Save commits the new version.

Touches generate sequentially so each follow-up receives the prior touch's body as prev_email (mirrors the production sender exactly). touches scopes the render to one editor's touches; a follow-up-only request anchors on the cached saved-state touch 1.

post/api/app-auto-gtm/segments/{segment_id}/preview-emails/draft

Path parameters

segment_idinteger required

Cookies

ex_accessstring nullable
ex_orgstring nullable

Request body

lead_idstring required
instructionsstring
followup_instructionsstring
languagestring
touchesinteger[] nullable

Response

Successful Response

idstring required
segment_idinteger required
lead_idstring required
touch_numberinteger required
email_templates_versioninteger required
subjectstring required
bodystring required
lead_first_namestring
lead_last_namestring
lead_company_namestring
language_usedstring
language_reasonstring
cache_hitboolean

Changes

No recorded changes to this endpoint across all 1 revision of this API.