Developers
Get access

stensul-update-email-content

Edits content inside an existing draft: copy, buttons, images, alt text, visibility, custom-element variables and URL tracking. Anything you leave out stays as it is.

write: changes contentScope emails:write

Address elements by module id plus element id from the read. Pass save_version from your last read so a stale edit fails with a conflict. Custom elements are written by variable value only; markup is never writable. Sent emails cannot be edited: copy them and edit the copy.

Inputs

  • emailIdstring (24-char hex id)required

    Email ID.

  • modulesarrayoptional

    [{ id, style?, elements: [{ id, type, text?, content?, imageContent?, link?, style?, visibility?, variables?, url_tracking_parameters?, url_tracking_disabled? }] }]. type is required on every element.

  • save_versionintegeroptional

    The save_version from your last read. Always pass it when the read included one.

  • url_trackingobjectoptional

    Campaign-level tracking values. A tracking-only fix can carry this with no modules.

  • moduleobjectoptional

    Present in the manifest; use modules.

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.
declined Content declined by a guardrail
A value is outside what the template allows: an off-palette color, a size out of range, locked text.
Keep the value within the guardrail or make no change. Guardrails are enforced by Stensul and cannot be overridden from a chat.
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.
403 API error (403): Sent emails cannot be edited.
The email has already been sent.
Nothing to fix. Copy it and edit the copy.

All errors: Errors and troubleshooting.

{
  "emailId": "64f0c0ffee0000000000abcd",
  "save_version": 7,
  "modules": [
    {
      "id": 2817001,
      "elements": [
        {
          "id": 3,
          "type": "text",
          "text": "Roasted this week. On your doorstep by Friday."
        },
        {
          "id": 5,
          "type": "button",
          "text": "Order now",
          "link": {
            "url": "https://northwind.example/order"
          }
        }
      ]
    }
  ]
}
Response

What was applied, tenant warnings, declined changes with reasons, the new save_version and a preview.

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