Update template
updateTemplateEdit a template that already exists. Two kinds of field, and they behave differently. name, slug, description and status are metadata: they change in place and create no version. subject, html, blocks, props and slots are the BODY: the edit lands in the draft, and when the template has nothing left to edit (its head is published) a new draft numbered one higher is minted. Either way nothing a live send resolves moves until publishTemplate is called, which is what makes it safe to edit a template that is sending right now. Give one of html, document (the whole block design, every block kind and style, as getTemplateVersion returns it) or blocks (a flat list with no styling), never several. A field you leave out keeps what the head already had, so an edit to the subject alone keeps the body; props and slots, when sent, replace the whole list. Sending blocks replaces the block list and nothing else: the page settings the editor holds alongside it (preview text, web fonts, the Tailwind switch and the page style) are carried over from the version you are editing, so a template designed in the app does not lose its look to an edit made here. Read getTemplate first: the props it lists are what sends already pass, and dropping one makes those sends fail. Pass the head version and its Saved time from getTemplate as expectedVersion and expectedUpdatedAt, so an edit somebody saved since is refused rather than overwritten.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "updateTemplate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| html | No | ||
| name | No | ||
| slug | No | ||
| props | No | ||
| slots | No | ||
| blocks | No | ||
| status | No | ||
| subject | No | ||
| document | No | The whole block design the editor uses: {"preview": "...", "style": {...}, "fonts": [...], "body": [blocks], "props": [...], "slots": [...]}. A block is {"kind", "id", "style", "align", ...}: Section, Container, Row and Column hold children (a Row holds only Columns); Heading, Text, Markdown, Button, Link, CodeBlock and CodeInline hold text; Button and Link take href; Img takes src, alt, width and height; Hr is a divider. style is camelCase CSS. getTemplateVersion and getTemplateStarter return complete documents to copy the shape from. | |
| description | No | ||
| expectedVersion | No | ||
| expectedUpdatedAt | No | The Saved time getTemplate gave for the head version, as an ISO 8601 instant. When the head was saved again after it, the call is refused with version_conflict. |