Creating message types
How to create message types in the Knock dashboard.
A message type is created in the Knock dashboard under the "Message types" page. Message types have:
- Key. A unique key for the message type.
- Name. A name for the message type.
- Description. A description for the message type.
- Icon. An icon for the message type that will be displayed in the editor.
- Schema. A schema defines the fields a message type will have in the template editor and forms the structure of the message contents generated when a message is produced from an in-app step.
- Template preview. A template preview is a visual representation of what the message type will look like in the template editor. If not provided, the template editor will show a JSON preview of the message type rendered.
Building a message type schema#
A message type schema is a JSON object that defines the fields a message type will have in the template editor and forms the structure of the message contents generated when a message is produced for a guide.
Using our "Generate schema" tool#
The "Generate schema" tool allows you to use AI to describe the fields you want to include in your message type. You can also make edits to existing schemas to modify the fields available using this tool.
Manually building a schema#
You can hand write a schema manually, or use the "Insert field" button within the schema editor to add fields one at a time.
See the Schema reference doc for more information.
Versioning message types#
Message types are versioned at the environment level as a versionable resource, but are not promotable like other resources in Knock.
Your message type changes must be committed to the current environment before they are available to be used in guides. When you commit a message type, it will automatically bump the semantic version of the message type.
Working with message types programmatically#
You can also create and update message types programmatically using the Management API or the Knock CLI.
See the Management API reference for more information.