Skip to main content

Start Email Template AI Batch

POST 

/api/store-email-templates/ai-batches

Applies one AI change to several email templates ("Apply to other templates"). Starts a background job that runs the instruction against each template's current saved subject, preheader and body, one AI call per template in turn, and stores a proposal per template. Nothing is saved until a proposal is accepted.

Required scope: settings:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token and the email_templates.update permission.

Body fields:

  • instruction (string, required, max 5000) — the change to apply
  • history (array|null, max 10) — earlier turns of the editor conversation, each {instruction (required, max 5000), summary (max 5000)}
  • source_template_id (int|null) — the template the change was first made in (must exist)
  • template_ids (int[], required, 1–100, distinct, each must exist) — the templates to change

Each call counts against the user's hourly AI limit; when the limit runs out mid-batch, the remaining templates fail with the limit message. When the AI editor is turned off or has no API key, the batch fails with that message. Poll Get Email Template AI Batch for progress and proposals.

Request​

Responses​

Created

Response Headers
    Content-Type