Update post template OAuth Scope: posts:write
Update post template OAuth Scope: posts:write
This endpoint is available to publications on the Pro and Enterprise plans.
Update a post template for a specific publication. Only the fields in the request body change. Every other field stays as it is.
To replace the template content, provide either blocks or body_content, never both. If neither is provided, or the one provided is empty, the existing content is preserved. Content is replaced in full.
To clear description, newsletter_list_id, thumbnail_image_url, reusable_header_block_id, or reusable_footer_block_id, send an empty string. social_share and email_capture_type_override are enums and cannot be cleared. To clear content_tags, guest_author_ids, or team_author_ids, send an empty array. To clear headers, send an empty object: a top-level null is ignored, and a null inside the object suppresses one inherited header instead. Inside email_settings and web_settings, send a key as null or "" to clear it. That covers the subject line, preview text, from address, reply-to address, sender name, title, subtitle, paywall, and paywall break price. Boolean display flags ignore null.
A template migrated from publication settings, and a template created during onboarding, are read-only. Updating one returns 422.
When the template is open in the editor and the request changes its content, header_custom_css, reusable_header_block_id, or reusable_footer_block_id, the change is written to that editing session before the template is saved. If that write fails, the update is rejected and nothing is saved. If the write succeeds and the save is then rejected, the open editing session already holds the change while the stored template does not.
Setting header_custom_css moves the template’s theme to the version 2 renderer, which changes how line heights are resolved for posts built from it.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Path parameters
Request
The structured content blocks that replace the template’s current content. Supports the same block types as Create Post, with the exception of advertisement and advertisement_logo: an advertisement opportunity is booked for a single send and cannot be stored on a template. Cannot be provided together with body_content.
Raw HTML that replaces the template’s current content. The HTML is wrapped in an htmlSnippet block internally. Note that <style> and <link> tags are removed during sanitization. Use inline styles for all visual styling. Cannot be provided together with blocks.
Custom email headers posts built from this template start with. Set a value to null to suppress a header inherited from the newsletter list or publication. System-managed headers (e.g. List-Unsubscribe, X-SMTPAPI) cannot be overridden.
Custom CSS added to the email <head> of posts built from this template, replacing any CSS the template already has. Send an empty string to remove it. Use this for styles, since <style> tags in body_content are removed. Applies to email only, not the web version.
The prefixed ID (reusable_block_<uuid>) of a published header block from the workspace’s reusable blocks, shown in place of the email header of posts built from this template. Needs the updated email layout. Send an empty string to remove it.
The utm_source appended to links in posts built from this template.
The utm_medium appended to links in posts built from this template.
The utm_campaign appended to links in posts built from this template.