Partials Management API reference
Complete reference documentation for the Partials resource.
Partials
#Partials are reusable pieces of content you can use across your channel templates.
You can retrieve, update, and create partials as well as list all partials in a given environment. Partials are identified by their unique partial key.
List partials
#List all partials for a given environment.
Endpoint
Query parameters
The environment slug.
The slug of a branch to use. This option can only be used when environment is "development".
Whether to annotate the resource. Only used in the Knock CLI.
Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
The cursor to fetch entries after.
The cursor to fetch entries before.
The number of entries to fetch per-page.
Returns
A paginated list of Partial. Contains a list of entries and page information.
A list of entries.
The partial content.
An arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed.
The slug of the environment in which the partial exists.
The name of the icon to be used in the visual editor.
The field types available for the partial.
The timestamp of when the partial was created.
The unique key string for the partial object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
A name for the partial. Must be at maximum 255 characters in length.
The partial type. One of 'html', 'json', 'markdown', 'text'.
The timestamp of when the partial was last updated.
Whether the partial and its content are in a valid state.
Indicates whether the partial can be used in the visual editor. Only applies to HTML partials.
The information about a paginated result.
The cursor to fetch entries after. Will only be present if there are more entries to fetch.
The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.
The number of entries to fetch per-page.
Get a partial
#Get a partial by its key.
Endpoint
Path parameters
The key of the partial to retrieve.
Query parameters
The environment slug.
The slug of a branch to use. This option can only be used when environment is "development".
Whether to annotate the resource. Only used in the Knock CLI.
Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
Returns
A partial is a reusable piece of content that can be used in a template.
The partial content.
An arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed.
The slug of the environment in which the partial exists.
The name of the icon to be used in the visual editor.
The field types available for the partial.
The timestamp of when the partial was created.
The unique key string for the partial object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
A name for the partial. Must be at maximum 255 characters in length.
The partial type. One of 'html', 'json', 'markdown', 'text'.
The timestamp of when the partial was last updated.
Whether the partial and its content are in a valid state.
Indicates whether the partial can be used in the visual editor. Only applies to HTML partials.
Upsert a partial
#Updates a partial of a given key, or creates a new one if it does not yet exist.
Note: this endpoint only operates on partials in the “development” environment.
Endpoint
Path parameters
The key of the partial to upsert.
Query parameters
The environment slug.
The slug of a branch to use. This option can only be used when environment is "development".
Whether to annotate the resource. Only used in the Knock CLI.
Whether to commit the resource at the same time as modifying it.
The message to commit the resource with, only used if commit is true.
Request body
A partial object with attributes to update or create a partial.
The content of the partial.
The description of the partial.
The name of the icon to be used in the visual editor. Only relevant when visual_block_enabled is true.
The name of the partial.
The type of the partial.
Indicates whether the partial can be used in the visual editor. Only applies to HTML partials.
Returns
Wraps the Partial response under the partial key.
A partial is a reusable piece of content that can be used in a template.
The partial content.
An arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed.
The slug of the environment in which the partial exists.
The name of the icon to be used in the visual editor.
The field types available for the partial.
The timestamp of when the partial was created.
The unique key string for the partial object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
A name for the partial. Must be at maximum 255 characters in length.
The partial type. One of 'html', 'json', 'markdown', 'text'.
The timestamp of when the partial was last updated.
Whether the partial and its content are in a valid state.
Indicates whether the partial can be used in the visual editor. Only applies to HTML partials.
Validate a partial
#Validates a partial payload without persisting it.
Note: this endpoint only operates on partials in the “development” environment.
Endpoint
Path parameters
The key of the partial to validate.
Query parameters
The environment slug.
The slug of a branch to use. This option can only be used when environment is "development".
Request body
A partial object with attributes to update or create a partial.
The content of the partial.
The description of the partial.
The name of the icon to be used in the visual editor. Only relevant when visual_block_enabled is true.
The name of the partial.
The type of the partial.
Indicates whether the partial can be used in the visual editor. Only applies to HTML partials.
Returns
Wraps the Partial response under the partial key.
A partial is a reusable piece of content that can be used in a template.
The partial content.
An arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed.
The slug of the environment in which the partial exists.
The name of the icon to be used in the visual editor.
The field types available for the partial.
The timestamp of when the partial was created.
The unique key string for the partial object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
A name for the partial. Must be at maximum 255 characters in length.
The partial type. One of 'html', 'json', 'markdown', 'text'.
The timestamp of when the partial was last updated.
Whether the partial and its content are in a valid state.
Indicates whether the partial can be used in the visual editor. Only applies to HTML partials.
Partial
#A partial is a reusable piece of content that can be used in a template.
Attributes
The partial content.
An arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed.
The slug of the environment in which the partial exists.
The name of the icon to be used in the visual editor.
The field types available for the partial.
The timestamp of when the partial was created.
The unique key string for the partial object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
A name for the partial. Must be at maximum 255 characters in length.
The partial type. One of 'html', 'json', 'markdown', 'text'.
The timestamp of when the partial was last updated.
Whether the partial and its content are in a valid state.
Indicates whether the partial can be used in the visual editor. Only applies to HTML partials.