Developers
Get access

stensul-apply-email-variation

Applies a styling variation to the whole email, one module, or several modules in one call. Content is untouched and the change is reversible.

write: changes contentScope emails:write

The library's variations mode decides the shape. Mode all: one variation for the whole email, no module_id. Mode individual: per module, or assignments for several at once. The tool refuses what the mode can't express.

Inputs

  • emailIdstring (24-char hex id)required

    Email ID.

  • variationstringoptional

    Variation id, key or name. Required unless assignments is used.

  • module_idintegeroptional

    Module instance id. Required in mode individual; forbidden in mode all.

  • assignmentsarrayoptional

    [{ module_id, variation }] for several modules in one write (mode individual only).

  • save_versionintegeroptional

    Version the change is based on.

Errors people hit

What you seeFix
401 Authentication expired or missing
The session's authorization expired.
Sign in again when the host prompts. On a 401 or 403, the server's instructions tell the model to re-check sign-in first.
403 Insufficient OAuth scope (403): The token lacks the required scope
The API connection doesn't have the scope this tool needs.
An admin adds the scope to the API connection. Then sign in again: adding a scope revokes existing tokens.
403 API error (403): Action is unauthorized.
The signed-in user's role lacks the permission, for example edit_campaign.
Grant the permission to the user's role in Admin > Users & Roles. It works for other users on the same connection.
409 Version conflict
The email changed since your last read, and you passed its old save_version.
Read the email again and re-apply your change on the current version. Never retry by dropping save_version.

All errors: Errors and troubleshooting.

{
  "emailId": "64f0c0ffee0000000000abcd",
  "variation": "Dark"
}
Response

The restyled email with an embedded preview, or a refusal with the options the mode allows.

Described from the tool's definition. Captured responses from a Stensul-internal tenant will replace this.

Example values use invented brands and ids. Tool list captured 2026-09-28.

Esc