Skip to content

Generate Sequence Spintax

POST
/sequences/generate-spintax

One-time AI generation: rewrite a manual email into spintax.

Returns the subject + body rewritten with (possibly nested) {{option a|option b}} blocks; the sequencer’s per-contact resolver then sends a different-looking variant to each lead. Content-level and sequence-agnostic: paste the result into any sequence or campaign email step as a MANUAL_TEMPLATE.

Requires an active subscription and consumes credits (token-metered; 402 on either failure). Synchronous, up to ~2 minutes; per-worker concurrency is capped (429 + Retry-After when saturated). Output is validated server-side (balanced braces, {{variables}} and links preserved) - invalid model output surfaces as 422, never as silently broken content.

Authorizations

Parameters

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

One-time AI generation: rewrite a manual email into spintax.

Field types intentionally mirror the internal sequencer.interfaces.voice.email_generation.GenerateSpintaxPayload (same Literals) so outer/inner validation cannot drift. The legacy target_combinations knob is deliberately NOT exposed on the public surface; strength supersedes it.

object
body
required

Email body to rewrite into spintax

string
>= 1 characters <= 50000 characters
email_type

Body format. ‘html’ preserves every link and all {{variables}} in the rewrite.

string
default: plain
Allowed values: plain html
strength

Variation intensity: how heavily to vary the copy and how deeply to nest spintax blocks. Each level carries an ENFORCED ceiling on total distinct renderings (subject x body), applied after generation: ‘light’ up to 200 (flat blocks only), ‘balanced’ up to 5,000, ‘maximum’ up to 100,000. Output over the ceiling is trimmed down, never rejected.

string
default: balanced
Allowed values: light balanced maximum
subject
required

Email subject to rewrite into spintax

string
>= 1 characters <= 2000 characters
tone_instructions
Any of:
string
<= 2000 characters

Responses

200

Successful Response

object
data
required

Spintax-encoded email plus its distinct-rendering counts.

object
body
required

Body rewritten with (possibly nested) spintax blocks

string
body_combinations
required

Distinct renderings the body can produce

integer
subject
required

Subject rewritten with {{option a|option b}} spintax blocks

string
subject_combinations
required

Distinct renderings the subject can produce

integer
total_combinations
required

Distinct full-email renderings (subject x body)

integer
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string