stensul-update-segment-content
Writes the content of one segment created by stensul-apply-segment-set. All of that segment's elements go in one call.
Same content shapes as stensul-update-email-content. Only styling the template allows is applied; the rest is dropped and reported under warnings.
Inputs
- dynamicElementIdstringrequired
Dynamic element ID returned by
stensul-apply-segment-set. - segmentIdstringrequired
Segment to write.
- elementsarray (≥1)required
[{ elementInstanceId, elementType, content?, imageContent?, link?, style?, visibility? }]. - isHiddenSegmentbooleanoptional
Hide this whole segment. Omit to keep its current visibility.
Errors people hit
| What you see | Fix |
|---|---|
| 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. |
All errors: Errors and troubleshooting.
{
"dynamicElementId": "dyn_01",
"segmentId": "seg_gold",
"elements": [
{
"elementInstanceId": 5,
"elementType": "button",
"content": [
{
"content": [
{
"text": {
"content": "Claim free shipping"
}
}
]
}
],
"link": {
"url": "https://northwind.example/gold"
}
}
]
}{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "stensul-update-segment-content",
"arguments": {
"dynamicElementId": "dyn_01",
"segmentId": "seg_gold",
"elements": [
{
"elementInstanceId": 5,
"elementType": "button",
"content": [
{
"content": [
{
"text": {
"content": "Claim free shipping"
}
}
]
}
],
"link": {
"url": "https://northwind.example/gold"
}
}
]
}
}
}The updated segment, with warnings for anything the template didn't allow.
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.