Roll a template back to an earlier version
rollback_templateRevert a template after a bad release: repoints published_version at the version you name, so every subsequent render immediately serves that snapshot again. Prefer this over publish_template's version argument whenever you are reverting, because only this tool takes expectedPublishedVersion — an optimistic fence that rejects with 409 VERSION_CONFLICT if someone moved the pointer since you read it — and only this tool can restore the working draft too. restoreDraft: true overwrites the draft html/css/schema with that version's content, auto-snapshotting the existing draft into a fresh version first so unsaved work is recoverable; it defaults to false. Destructive: it changes what production renders, and there is no undo beyond rolling forward again. Takes a template UUID or slug. Requires a Kamy API key with the templates:write scope; without a key, returns dashboard setup instructions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | Yes | The known-good version to make live again. Get it from list_template_versions. | |
| templateId | Yes | Template UUID or slug — every /v1/templates route resolves either. | |
| restoreDraft | No | When true, also overwrite the working draft (html/css/schema) with that version's content. The current draft is auto-snapshotted into a new version first, unless it is already byte-identical. Defaults to false, which leaves in-flight edits alone. | |
| expectedPublishedVersion | No | Optimistic fence: the published_version you believe is live (0 if never published). The call is rejected with 409 VERSION_CONFLICT if someone moved the pointer in the meantime. Pass it whenever you read the state in an earlier step. |