A 'Switch template…' Select in the editor header lists the org's saved templates, marking the default. Choosing one POSTs to /api/contracts/[id]/apply-template, which rebuilds the body through the shared generator from the contract's estimate link and frozen form_data, persists rendered_body + required_sections + template_id/version, and returns the new body into the editor.
Also called: wrong contract template · change template on a contract · re-render contract
- 1Role gate: admin, sales or project_manager, scoped to the caller's org.
- 2Refuses unless the contract is 'pending' or 'sent' ('This contract is already signed or closed.').
- 3Loads the estimate link — including job_id, because 'the builder's real payment schedule hangs off it in job_meta. Without it the contract falls back to invented 50/50 terms.'
- 4Re-renders via buildContractArtifacts and re-derives the initials manifest.
- 5The modal loads the new body and switches to Preview.
From the route header: re-rendering through the shared generator means 'the new body has the same estimate table / payment schedule / initials manifest the original generation would.' Before this, correcting a template choice meant regenerating the whole customer flow or hand-editing a body.
- A mis-picked template forcing a restart of the customer's flow
- Manual re-typing to convert one contract body into another
See it on your own jobs
Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.
or keep browsing features →