Email layouts Management API reference
Complete reference documentation for the Email layouts resource.
Email layouts
#Email layouts wrap email message templates to share consistent design components between the email notifications that your recipients receive.
You can create and update email layouts in your development environment, as well as retrieve or list all layouts in a given environment.
List email layouts
#Returns a paginated list of email layouts available in 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 EmailLayout. Contains a list of entries and page information.
A list of entries.
The timestamp of when the email layout was created.
The environment of the email layout.
A list of one or more items to show in the footer of the email layout.
The text to display as the link.
The URL to link to.
The complete HTML content of the email layout.
The unique key for this email layout.
The human-readable name of this email layout.
The SHA of the email layout.
The complete plaintext content of the email layout.
The timestamp of when the email layout was last updated.
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 email layout
#Retrieve an email layout by its key, in a given environment.
Endpoint
Path parameters
The key of the email layout to show.
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 versioned email layout used within an environment.
The timestamp of when the email layout was created.
The environment of the email layout.
A list of one or more items to show in the footer of the email layout.
The text to display as the link.
The URL to link to.
The complete HTML content of the email layout.
The unique key for this email layout.
The human-readable name of this email layout.
The SHA of the email layout.
The complete plaintext content of the email layout.
The timestamp of when the email layout was last updated.
Upsert email layout
#Updates an email layout, or creates a new one if it does not yet exist.
Note: this endpoint only operates in the "development" environment.
Endpoint
Path parameters
The key of the email layout 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 request to update or create an email layout.
A list of one or more items to show in the footer of the email layout.
The text to display as the link.
The URL to link to.
The complete HTML content of the email layout.
The friendly name of this email layout.
The complete plain text content of the email layout.
Returns
Wraps the EmailLayout response under the email_layout key.
A versioned email layout used within an environment.
The timestamp of when the email layout was created.
The environment of the email layout.
A list of one or more items to show in the footer of the email layout.
The text to display as the link.
The URL to link to.
The complete HTML content of the email layout.
The unique key for this email layout.
The human-readable name of this email layout.
The SHA of the email layout.
The complete plaintext content of the email layout.
The timestamp of when the email layout was last updated.
Validate email layout
#Validates an email layout payload without persisting it.
Note: this endpoint only operates in the "development" environment.
Endpoint
Path parameters
The key of the email layout 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 request to update or create an email layout.
A list of one or more items to show in the footer of the email layout.
The text to display as the link.
The URL to link to.
The complete HTML content of the email layout.
The friendly name of this email layout.
The complete plain text content of the email layout.
Returns
Wraps the EmailLayout response under the email_layout key.
A versioned email layout used within an environment.
The timestamp of when the email layout was created.
The environment of the email layout.
A list of one or more items to show in the footer of the email layout.
The text to display as the link.
The URL to link to.
The complete HTML content of the email layout.
The unique key for this email layout.
The human-readable name of this email layout.
The SHA of the email layout.
The complete plaintext content of the email layout.
The timestamp of when the email layout was last updated.
EmailLayout
#A versioned email layout used within an environment.
Attributes
The timestamp of when the email layout was created.
The environment of the email layout.
A list of one or more items to show in the footer of the email layout.
The text to display as the link.
The URL to link to.
The complete HTML content of the email layout.
The unique key for this email layout.
The human-readable name of this email layout.
The SHA of the email layout.
The complete plaintext content of the email layout.
The timestamp of when the email layout was last updated.