Message types Management API reference
Complete reference documentation for the Message types resource.
Message types
#A message type is a schema for a message that maps to a UI component or element within your application.
List message types
#Returns a paginated list of message types 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 MessageType. Contains a list of entries and page information.
A list of entries.
The timestamp of when the message type was deleted.
The timestamp of when the message type was created.
The timestamp of when the message type was deleted.
An arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
The environment of the message type.
The icon name of the message type.
The unique key string for the message type 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 message type. Must be at maximum 255 characters in length.
The owner of the message type.
An HTML/liquid template for the message type preview.
The semantic version of the message type.
The SHA hash of the message type.
The timestamp of when the message type was last updated.
Whether the message type is valid.
The variants of the message type.
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
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 message type
#Retrieve a message type by its key, in a given environment.
Endpoint
Path parameters
The key of the message type 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 message type is a schema for a message that maps to a UI component or element within your application.
The timestamp of when the message type was deleted.
The timestamp of when the message type was created.
The timestamp of when the message type was deleted.
An arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
The environment of the message type.
The icon name of the message type.
The unique key string for the message type 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 message type. Must be at maximum 255 characters in length.
The owner of the message type.
An HTML/liquid template for the message type preview.
The semantic version of the message type.
The SHA hash of the message type.
The timestamp of when the message type was last updated.
Whether the message type is valid.
The variants of the message type.
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
Upsert message type
#Updates a message type, 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 message type 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 create a message type.
An arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
The icon name of the message type.
A name for the message type. Must be at maximum 255 characters in length.
An HTML/liquid template for the message type preview.
The semantic version of the message type.
The variants of the message type.
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
Returns
Wraps the MessageType response under the message_type key.
A message type is a schema for a message that maps to a UI component or element within your application.
The timestamp of when the message type was deleted.
The timestamp of when the message type was created.
The timestamp of when the message type was deleted.
An arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
The environment of the message type.
The icon name of the message type.
The unique key string for the message type 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 message type. Must be at maximum 255 characters in length.
The owner of the message type.
An HTML/liquid template for the message type preview.
The semantic version of the message type.
The SHA hash of the message type.
The timestamp of when the message type was last updated.
Whether the message type is valid.
The variants of the message type.
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
Validate message type
#Validates a message type payload without persisting it.
Note: this endpoint only operates on message types in the development environment.
Endpoint
Path parameters
The key of the message type 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 create a message type.
An arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
The icon name of the message type.
A name for the message type. Must be at maximum 255 characters in length.
An HTML/liquid template for the message type preview.
The semantic version of the message type.
The variants of the message type.
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
Returns
Wraps the MessageType response under the message_type key.
A message type is a schema for a message that maps to a UI component or element within your application.
The timestamp of when the message type was deleted.
The timestamp of when the message type was created.
The timestamp of when the message type was deleted.
An arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
The environment of the message type.
The icon name of the message type.
The unique key string for the message type 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 message type. Must be at maximum 255 characters in length.
The owner of the message type.
An HTML/liquid template for the message type preview.
The semantic version of the message type.
The SHA hash of the message type.
The timestamp of when the message type was last updated.
Whether the message type is valid.
The variants of the message type.
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
MessageType
#A message type is a schema for a message that maps to a UI component or element within your application.
Attributes
The timestamp of when the message type was deleted.
The timestamp of when the message type was created.
The timestamp of when the message type was deleted.
An arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
The environment of the message type.
The icon name of the message type.
The unique key string for the message type 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 message type. Must be at maximum 255 characters in length.
The owner of the message type.
An HTML/liquid template for the message type preview.
The semantic version of the message type.
The SHA hash of the message type.
The timestamp of when the message type was last updated.
Whether the message type is valid.
The variants of the message type.
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
MessageTypeVariant
#A variant of a message type.
Attributes
The field types available for the variant.
The unique key string for the variant. 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 variant. Must be at maximum 255 characters in length.
MessageTypeTextField
#A text field used in a message type.
Attributes
The unique key of the field.
The label of the field.
Settings for the text field.
The default value of the text field.
Whether the field is required.
The type of the field.