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.
settings:writeGrant 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 applyhistory(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
- 201
- 401
- 403
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Content
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.