Which campaign text tokens can I use to improve an email's spam-check score?
AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.
Using Campaign Text Tokens to Improve a Spam-Check Score with the Clay CLI
Learn the campaign text token syntax, {{lead:...}}, {{spintax:...}}, {{sender:...}}, {{ai:...}}, and use it to move a real sequence step from a "fair" spam-check score to "good."
What you will build
An iterative edit-and-recheck loop: write plain copy, spam-check it, add spintax, recheck, and confirm the score improves for a real, verifiable reason.
clay campaigns sequence edit <campaign-id> --input '{"ops":[...]}'
↓
clay campaigns sequence spam-check <campaign-id> --variant-id <id>
↓
score: fair (no variance) → good (spintax added)
AI Prompt
Using the Clay CLI, use campaign text tokens to raise a sequence step's
spam-check score.
Requirements:
- Sequence step "subject"/"body" content uses Clay's lossless campaign text
grammar, which accepts exactly four double-brace token types:
{{lead:<fieldId>|<fallback>}}, {{sender:<field>|<fallback>}},
{{spintax:option1|option2|option3}}, and {{ai:...}}. A double-brace token
with an unrecognized name (e.g. {{spin:...}} instead of {{spintax:...}})
is rejected with a validation_error naming the exact 0-indexed character
position, and the whole edit is rejected, not just the malformed token.
A single-brace token (e.g. {spin:a|b}) is a different case: it is
accepted rather than rejected, and persists as literal escaped text
(backslash-escaped braces) rather than resolving to anything.
- {{spintax:a|b|c}} rotates between the listed options at send time so the
literal wording varies between recipients. This is what the spam
checker's "no-spintax" issue checks for.
- Clean, non-spammy copy with zero trigger words does not score "good" by
default. Plain copy with no spam trigger words scored 75/100 ("fair"),
flagged only for "no-spintax" and "no-sender-variables". Adding one
{{spintax:...}} block raised the same copy to 90/100 ("good").
- Run the verification step below before finishing.
Prerequisites
- The
clayCLI on PATH, authenticated viaclay login(an OAuth session, not a Public API key) - A draft campaign with at least one variant and sequence step
Note: JSON samples below are trimmed to the fields relevant to each step. Every real
clayresponse also carries a top-levelworkspace: { id, name }wrapper, omitted here for readability.
1. Write clean copy with no trigger words, and check its score
clay campaigns sequence edit cam_0tl84os74M6XWkVnp2s --input '{"ops":[{
"op":"updateStep","variantId":"cvar_0tl8a9arYYPDwRFxfpp","stepId":"1d3b8783-c46a-4bee-abeb-53b216cc7b07",
"subject":"Question about {{lead:company|your team}}",
"body":"Hi {{lead:first_name|there}}, noticed your team is scaling {{lead:title|the department}}. Worth a short call this week?"
}]}'
clay campaigns sequence spam-check cam_0tl84os74M6XWkVnp2s --variant-id cvar_0tl8a9arYYPDwRFxfpp
Real output, no trigger words, but still only "fair":
{
"score": 75,
"grade": "fair",
"issues": [
{"id": "no-spintax", "severity": "medium"},
{"id": "no-sender-variables", "severity": "low"}
]
}
2. Try an invalid token name
clay campaigns sequence edit cam_0tl84os74M6XWkVnp2s --input '{"ops":[{
"op":"updateStep","variantId":"cvar_0tl8a9arYYPDwRFxfpp","stepId":"1d3b8783-c46a-4bee-abeb-53b216cc7b07",
"subject":"Question about {{lead:company|your team}}",
"body":"Hi {{lead:first_name|there}}, {{spin:noticed|saw|came across}} your team..."
}]}'
Real output, the invalid double-brace token name (spin instead of spintax) rejects the entire edit, at the exact (0-indexed) character offset:
{"error": {"code": "validation_error", "message": "body: Unknown token: expected {{lead:...}}, {{sender....}}, {{spintax:...}}, or {{ai:...}} (at character 30)"}}
2b. Try a single-brace token instead
clay campaigns sequence edit cam_0tl84os74M6XWkVnp2s --input '{"ops":[{
"op":"updateStep","variantId":"cvar_0tl8a9arYYPDwRFxfpp","stepId":"1d3b8783-c46a-4bee-abeb-53b216cc7b07",
"body":"Test {totallyfake:a|b} here."
}]}'
A single-brace token is a different case from a malformed double-brace one: it is accepted (exit 0), not rejected, and persists as literal backslash-escaped text rather than resolving to anything:
{"body": "Test \\{totallyfake:a|b\\} here."}
3. Add real spintax and recheck
clay campaigns sequence edit cam_0tl84os74M6XWkVnp2s --input '{"ops":[{
"op":"updateStep","variantId":"cvar_0tl8a9arYYPDwRFxfpp","stepId":"1d3b8783-c46a-4bee-abeb-53b216cc7b07",
"subject":"Question about {{lead:company|your team}}",
"body":"Hi {{lead:first_name|there}}, {{spintax:noticed|saw|came across}} your team is scaling {{lead:title|the department}}. Worth a short call this week?"
}]}'
clay campaigns sequence spam-check cam_0tl84os74M6XWkVnp2s --variant-id cvar_0tl8a9arYYPDwRFxfpp
Real output, score rose from 75 to 90, grade from "fair" to "good":
{
"score": 90,
"grade": "good",
"issues": [
{"id": "no-sender-variables", "severity": "low"}
]
}
How it works
The four-token grammar recognizes double-brace syntax specifically: a double-brace token with an unrecognized name is rejected wholesale rather than silently passed through or partially applied. A single-brace sequence is not parsed as a token attempt at all, so it is accepted and stored as literal text (with the braces escaped) rather than triggering the same validation. The spam checker's "no-spintax" issue reflects that identical wording sent to hundreds of recipients from several sending mailboxes becomes a literal fingerprint providers can flag. {{spintax:...}} is the one token type that directly addresses that by rotating the literal text itself, which is why adding just one spintax block moved the grade a full tier.
Common issues
A single invalid double-brace token silently failing instead of erroring
Expecting per-token validation, where only the bad token would be dropped, does not match observed behavior: one unrecognized double-brace token name rejects the whole edit with a validation_error naming the character position. Nothing partially applies.
Assuming a single-brace token behaves the same way as a malformed double-brace one
A single-brace sequence like {spin:a|b} reads as an obvious typo of the double-brace grammar, so it is easy to expect the same validation_error. It is accepted instead, and persists as literal escaped text rather than resolving to anything or raising an error.
Assuming trigger-word-free copy scores "good" by default
Since the "poor" grade in other examples is driven by trigger words, removing them can seem sufficient. In practice, clean copy with zero trigger words still scored only "fair" (75) until spintax was added. Trigger words, punctuation, spintax, and sender variables are graded independently.
Next steps
- Track down a valid
{{sender:...}}field name for your workspace (this session's testing rejected{{sender:first_name|...}}; the exact accepted field set wasn't confirmed) to close the remaining "no-sender-variables" issue. - Re-run
clay campaigns variants start-testonce a variant scores "good" to begin a real A/B test.
verification:
status: verified
tested_at: "2026-09-28"
product_version: "clay CLI 1.4.0"
command: "clay campaigns sequence spam-check cam_0tl84os74M6XWkVnp2s --variant-id cvar_0tl8a9arYYPDwRFxfpp"
expected_result: "Clean copy with no trigger words scores 75/fair; adding one real {{spintax:a|b|c}} block raises the same copy to 90/good. An invalid double-brace token name (e.g. {{spin:...}}) rejects the whole edit with a validation_error naming the character position, while a single-brace token (e.g. {spin:...}) is accepted and persists as literal escaped text."
