Management API

Learn more about the Knock management API for programmatically interacting with your Knock dashboard resources.

The Knock management API provides you with a programmatic way to interact with the resources you create and manage in your Knock dashboard, including workflows, templates, and translations. It's separate from the Knock API and only provides access to a limited subset of resources.

You can use the Knock management API to:

  • Create, update, and manage your Knock workflows and the notification templates within those workflows.
  • Create, update and manage your email layouts.
  • Create and manage the translations used by your notification templates.
  • Create, update, and manage your partials.
  • Commit and promote changes between your Knock environments.

View management API reference

Interacting with the management API

Currently, we do not ship SDKs that wrap the management API but we do ship a CLI for easily interacting with the resources in your Knock account.

Use cases

Previewing templates

Using the management API, you can generate previews of the templates within your workflows. One example use case is providing a way for your users to customize the content of notifications sent through Knock.

To preview a template, you use the preview template endpoint exposed by the management API. This API endpoint accepts a workflow key, and a step reference (ref) for the step that contains the template you want to preview.

Using the endpoint, you pass through details about the recipient, actor, tenant, and any other data variables that are used within the template. The endpoint will return a JSON object with fully rendered template generated using the data you provided. It will be the same as previewing the template in the Knock dashboard.