Skip to main content

Templates

Manage templates, their versions and release channels (templates as code), and check data against them.

📄️Publish a version

Makes this version the one served by the API; the same as moving the `published` channel. The previously published version is archived and becomes the channel's `previous_version`. When both versions store a data schema and the new one breaks callers of the old one (a new required field, a narrower type, a removed enum value), the request answers 409 `schema_breaking_change` unless it sends `allow_breaking: true`. Renders pick the version up within a minute. Needs `template:write`.

📄️Create or move a channel

Points the channel at `version`, optionally with a `canary` that receives `percent` of its renders (Pro and above). On `published` this publishes. The schema check of publishing applies to the main and the canary version. Starter allows 2 channels per template besides published, Pro and Business 10; the Free plan renders the published version only. A plan without channels or canaries, or one more channel than the plan holds, answers 403 `forbidden` with the `feature`. Renders pick up the move within a minute. Needs `template:write`.

📄️Get the data schema

JSON Schema (draft 2020-12) describing the `data` object the template expects: the one stored with the published (or latest) version, or with the version `version` names, else one inferred from its sample data the way the editor does; 404 when the version has neither. With `format=make` the schema comes back as Make parameter definitions (one `data` collection, plus a `version` select listing the release channels when the template has any besides `published`), which the Make app loads as dynamic fields; a template with neither schema nor sample data then gets a single JSON field instead of a 404. With `format=swagger` it comes back as `{ 'schema': … }` in the OpenAPI 2.0 dialect (one type per property, no `nullable` or `oneOf`, a label in `x-ms-summary`), which the Power Platform connector loads as dynamic fields; without schema or sample data that is an object without properties. Needs `template:read`.

📄️Validate a template with data

Checks a template version and data without rendering: syntax and analysis of the body, header and footer, includes without a stored partial, errors that only happen when the template runs with the data, and the data against the stored data schema (when the version stores one). For Word and PowerPoint templates the tags of the stored file are checked instead of HTML, and their diagnostics name the part and paragraph. Free; not metered and not rate limited. Problems with the template are diagnostics in a 200 response, not errors. Needs `template:read`.