Developers
Get access

stensul-delete-email-module

Removes one module (a whole section) from a draft, or checks what else would go when the user asked to remove a single element.

write: changes contentScope emails:write

Set removing to what the user pointed at. module deletes that section in one call. element makes the tool check first: if the element can be hidden, hide it with stensul-update-email-content instead; if its section holds other content, the tool lists it and waits for the user's yes (confirmedWithUser: true).

Inputs

  • emailIdstring (24-char hex id)required

    Email ID.

  • moduleIdstring | numberrequired

    Module instance id from the read (not the module key).

  • removing"module" | "element"required

    What the user asked to remove.

  • elementIdstring | numberoptional

    Required when removing is element.

  • confirmedWithUserbooleanoptional

    Only after the tool listed what would be lost and the user agreed. Never on a first call.

  • save_versionintegeroptional

    The email's version as you last read or wrote it.

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.
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",
  "moduleId": 2817004,
  "removing": "module",
  "save_version": 8
}
Response

Confirmation of the deletion, or a refusal that explains why (for example a locked module) or lists what else the user must agree to lose.

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