Skip to navigation

Update post template OAuth Scope: posts:write

Available on the Pro and Enterprise plans

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

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

publicationIdstringRequiredformat: "^(pub_[0-9a-fA-F\-]+)$"
The prefixed ID of the publication object
postTemplateIdstringRequiredformat: "^(post_template_[0-9a-fA-F\-]+)$"
The prefixed ID of the post template object

Request

This endpoint expects an object.
namestringOptional
The name of the post template. An empty string is rejected.
descriptionstringOptional
The description of the post template. Send an empty string to clear it.
blockslist of objectsOptional

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.

body_contentstringOptional

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.

thumbnail_image_urlstringOptional
The URL of the thumbnail image to download for the template. Send an empty string to clear the thumbnail, which also drops a thumbnail bound to a publication field.
social_shareenumOptional
The social share style posts built from this template start with.
Allowed values:
email_capture_type_overrideenumOptional
The email capture type posts built from this template start with.
Allowed values:
content_tagslist of stringsOptional
The content tags posts built from this template start with. When provided, this replaces the template's tags. Tags that do not exist on the publication are created. Send an empty array to clear them.
guest_author_idslist of stringsOptional
The prefixed IDs of the guest authors posts built from this template start with. When provided, this replaces the template's guest authors. Send an empty array to clear them.
team_author_idslist of stringsOptional
The prefixed IDs of the team members posts built from this template start with as authors. When provided, this replaces the template's team authors. Send an empty array to clear them.
headersmap from strings to optional stringsOptional

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.

header_custom_cssstringOptional

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.

reusable_header_block_idstringOptional

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.

utm_sourcestringOptional

The utm_source appended to links in posts built from this template.

utm_mediumstringOptional

The utm_medium appended to links in posts built from this template.

utm_campaignstringOptional

The utm_campaign appended to links in posts built from this template.

utm_params_enabledbooleanOptional
Whether UTM parameters are appended to links in posts built from this template. Omit to leave the current value.
newsletter_list_idstringOptional
The prefixed ID of the newsletter list posts built from this template are associated with. Send an empty string to clear it.
email_settingsobjectOptional
The email settings posts built from this template start with. Only the provided fields within this object are updated.
web_settingsobjectOptional
The web settings posts built from this template start with. Only the provided fields within this object are updated.

Response

OK
dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error