Complete reference documentation for the Knock Management API.
The Knock Management API enables you to manage your Knock resources programmatically. Use this API to automate configuration changes and integrate with your CI/CD pipelines.
Base URL
https://control.knock.app/v1Knock uses the concept of environments to ensure logical separation of your data. Dashboard resources are created in your development environment and promoted to higher environments.
/v1/environments/v1/environments/{environment_slug}Returns a paginated list of environments. The environments will be returned in order of their index, with the development environment first.
/v1/environmentsafterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedEnvironmentResponseA paginated list of Environment. Contains a list of entries and page information.
Returns a single environment by the environment_slug.
/v1/environments/{environment_slug}environment_slugstringrequiredThe slug of the environment to retrieve.
An environment object.
An environment object.
created_atstringrequiredThe timestamp of when the environment was created.
deleted_atstringnullableThe timestamp of when the environment was deleted.
hide_pii_databooleanWhether PII data is hidden from the environment. Read more in the [data obfuscation docs](https://docs.knock.app/manage-your-account/data-obfuscation).
Default: false
label_colorstringnullableThe color of the environment label to display in the dashboard.
last_commit_atstringnullableThe timestamp of the most-recent commit in the environment.
namestringrequiredA human-readable name for the environment. Cannot exceed 255 characters.
orderintegerrequiredThe order of the environment. The lowest number is the first environment, the highest number is the last environment. The order will not always be sequential.
ownerstringrequiredThe owner of the environment.
One of: "system", "user"
slugstringrequiredA unique slug for the environment. Cannot exceed 255 characters.
updated_atstringrequiredThe timestamp of when the environment was last updated.
Channels are the delivery mechanisms for your notifications.
/v1/channelsReturns a paginated list of channels. Note: the list of channels is across the entire account, not scoped to an environment.
/v1/channelsidstringA channel id to filter the results by.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedChannelResponseA paginated list of Channel. Contains a list of entries and page information.
A configured channel, which is a way to route messages to a provider.
archived_atstringnullableThe timestamp of when the channel was deleted.
created_atstringrequiredThe timestamp of when the channel was created.
custom_icon_urlstringnullableOptional URL to a custom icon for the channel. Only used for display purposes in the dashboard.
descriptionstringnullableOptional description of the channel's purpose or usage.
idstringrequiredThe unique identifier for the channel.
keystringrequiredUnique identifier for the channel within a project (immutable once created).
namestringrequiredThe human-readable name of the channel.
providerstringrequiredThe ID of the provider that this channel uses to deliver messages. Learn more about the providers available [in our documentation](https://docs.knock.app/integrations/overview).
typestringrequiredThe type of channel, determining what kind of messages it can send.
One of: "email", "in_app", "in_app_feed", "in_app_guide", "sms", "push", "chat", "http"
updated_atstringrequiredThe timestamp of when the channel was last updated.
Chat channel settings. Only used as configuration as part of a workflow channel step.
email_based_user_id_resolutionbooleanWhether to resolve chat provider user IDs using a Knock user's email address. Only relevant for Slack channels for the time being.
link_trackingbooleanWhether to track link clicks on chat notifications.
Email channel settings. Only used as configuration as part of a workflow channel step.
bcc_addressstringnullableThe BCC address on email notifications. Supports liquid.
cc_addressstringnullableThe CC address on email notifications. Supports liquid.
from_addressstringnullableThe email address from which this channel will send. Supports liquid.
from_namestringnullableThe name from which this channel will send. Supports liquid.
json_overridesstringnullableA JSON template for any custom overrides to merge into the API payload that is sent to the email provider. Supports liquid.
link_trackingbooleanWhether to track link clicks on email notifications.
open_trackingbooleanWhether to track opens on email notifications.
reply_to_addressstringnullableThe Reply-to address on email notifications. Supports liquid.
to_addressstringThe email address to which this channel will send. Defaults to `recipient.email`. Supports liquid.
Push channel settings. Only used as configuration as part of a workflow channel step.
token_deregistrationbooleanWhether to deregister a push-token when a push send hard bounces. This is to prevent the same token from being used for future pushes.
SMS channel settings. Only used as configuration as part of a workflow channel step.
link_trackingbooleanWhether to track link clicks on SMS notifications.
In-app feed channel settings. Only used as configuration as part of a workflow channel step.
link_trackingbooleanWhether to track link clicks on in-app feed notifications.
To define a logical flow for your notifications, you create a workflow consisting of steps. Workflow steps can be functions or channels, and can have conditional logic that determines whether to execute that step when the workflow is triggered.
You can retrieve, update, or create a workflow as well as list all workflows in a given environment. Workflows are identified by their unique workflow key.
/v1/workflows/v1/workflows/{workflow_key}/v1/workflows/{workflow_key}/v1/workflows/{workflow_key}/activate/v1/workflows/{workflow_key}/run/v1/workflows/{workflow_key}/validateReturns a paginated list of workflows available in a given environment. The workflows are returned alphabetically by key.
/v1/workflowsenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
PaginatedWorkflowResponseA paginated list of Workflow. Contains a list of entries and page information.
Retrieve a workflow by its key in a given environment.
/v1/workflows/{workflow_key}workflow_keystringrequiredThe key of the workflow to retrieve.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
ShowWorkflowResponseA workflow object.
Updates a workflow of a given key, or creates a new one if it does not yet exist.
Note: this endpoint only operates on workflows in the development environment.
/v1/workflows/{workflow_key}workflow_keystringrequiredThe key of the workflow.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
commitbooleanWhether to commit the resource at the same time as modifying it.
commit_messagestringThe message to commit the resource with, only used if `commit` is `true`.
workflowWorkflowRequestrequiredA workflow request for upserting a workflow.
WrappedWorkflowResponseWraps the Workflow response under the `workflow` key.
Activates (or deactivates) a workflow in a given environment. Read more in the docs.
Note: This immediately enables or disables a workflow in a given environment without needing to go through environment promotion.
/v1/workflows/{workflow_key}/activateworkflow_keystringrequiredThe key of the workflow.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
statusbooleanrequiredWhether to activate or deactivate the workflow. Set to `true` by default, which will activate the workflow.
WrappedWorkflowResponseWraps the Workflow response under the `workflow` key.
Runs the latest version of a committed workflow in a given environment using the params provided.
/v1/workflows/{workflow_key}/runworkflow_keystringrequiredThe key of the workflow.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
actorobjectThe actor to reference in the the workflow run.
cancellation_keystringnullableA key to cancel the workflow run.
dataobjectA map of data to be used in the workflow run. The structure should conform to the workflow's `trigger_data_json_schema` if one is defined. Available in templates as `{{ data.field_name }}`. See [trigger data validation docs](https://docs.knock.app/developer-tools/validating-trigger-data).
recipientsRecipientReference[]requiredA list of recipients to run the workflow for.
tenantstringThe tenant to associate the workflow run with. Must not contain whitespace.
RunWorkflowResponseA response to a run workflow request.
Validates a workflow payload without persisting it. Some read-only fields will be empty as they are generated by the system when persisted.
Note: Validating a workflow is only done in the development environment context.
/v1/workflows/{workflow_key}/validateworkflow_keystringrequiredThe key of the workflow.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
workflowWorkflowRequestrequiredA workflow request for upserting a workflow.
WrappedWorkflowResponseWraps the Workflow response under the `workflow` key.
Methods that operate on the individual steps within a workflow. Steps are referenced by their ref, which is unique within a workflow.
/v1/workflows/{workflow_key}/steps/{step_ref}/preview_templateGenerates a rendered template for a given channel step in a workflow.
/v1/workflows/{workflow_key}/steps/{step_ref}/preview_templateworkflow_keystringrequiredThe key of the workflow.
step_refstringrequiredThe reference key of the channel step in the workflow to preview.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
actorobjectThe actor to reference in the the workflow run.
dataobjectThe data to pass to the workflow template for rendering.
recipientRecipientReferencerequiredA recipient reference, used when referencing a recipient by either their ID (for a user), or by a reference for an object.
tenantstringnullableThe tenant to associate the workflow with. Must not contain whitespace.
PreviewWorkflowTemplateResponseA response to a preview workflow template request.
A condition to be evaluated.
argumentstringnullableThe argument to be evaluated. Arguments can be either static values or dynamic properties. Static values will always be JSON decoded so will support strings, lists, objects, numbers, and booleans. Dynamic values should be path expressions.
operatorstringrequiredThe operator to use in the evaluation of the condition.
One of: "equal_to", "not_equal_to", "greater_than", "less_than", "greater_than_or_equal_to", "less_than_or_equal_to", "contains", "not_contains", "contains_all", "not_contains_all", "is_timestamp_before", "is_timestamp_after", "is_timestamp_before_date", "is_timestamp_after_date", "is_timestamp_between", "empty", "not_empty", "is_timestamp", "is_audience_member", "is_not_audience_member"
variablestringrequiredThe variable to be evaluated. Variables can be either static values or dynamic properties. Static values will always be JSON decoded so will support strings, lists, objects, numbers, and booleans. Dynamic values should be path expressions.
A group of conditions to be evaluated.
A duration of time, represented as a unit and a value.
unitstringrequiredThe unit of time.
One of: "minutes", "hours", "days", "weeks", "months"
valueintegerrequiredThe value of the duration.
A send window time for a notification. Describes a single day.
daystringrequiredThe day of the week.
One of: "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"
fromstringnullableThe start time of the send window.
typestringrequiredThe type of send window.
One of: "send", "do_not_send"
untilstringnullableThe end time of the send window.
A workflow object. Read more in the docs.
activebooleanrequiredWhether the workflow is [active](https://docs.knock.app/concepts/workflows#workflow-status) in the current environment. (read-only).
categoriesstring[]A list of [categories](https://docs.knock.app/concepts/workflows#workflow-categories) that the workflow belongs to.
conditionsobjectA conditions object that describes one or more conditions to be met for the workflow to be executed. (optional).
created_atstringrequiredThe timestamp of when the workflow was created. (read-only).
deleted_atstringThe timestamp of when the workflow was deleted. (read-only).
descriptionstringAn arbitrary string attached to a workflow object. Useful for adding notes about the workflow for internal purposes. Maximum of 280 characters allowed.
environmentstringrequiredThe slug of the environment in which the workflow exists. (read-only).
keystringrequiredThe unique key string for the workflow object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
namestringrequiredA name for the workflow. Must be at maximum 255 characters in length.
settingsobjectA map of workflow settings.
shastringrequiredThe SHA hash of the workflow data. (read-only).
A list of workflow step objects in the workflow.
trigger_data_json_schemaobjectA JSON schema for the expected structure of the workflow trigger's `data` payload (available in templates as `{{ data.field_name }}`). Used to validate trigger requests. Read more in the [docs](https://docs.knock.app/developer-tools/validating-trigger-data).
trigger_frequencystringThe frequency at which the workflow should be triggered. One of: `once_per_recipient`, `once_per_recipient_per_tenant`, `every_trigger`. Defaults to `every_trigger`. Read more in [docs](https://docs.knock.app/send-notifications/triggering-workflows/overview#controlling-workflow-trigger-frequency).
One of: "every_trigger", "once_per_recipient", "once_per_recipient_per_tenant"
updated_atstringrequiredThe timestamp of when the workflow was last updated. (read-only).
validbooleanrequiredWhether the workflow and its steps are in a valid state. (read-only).
A step within a workflow. Each workflow step, regardless of its type, share a common set of core attributes (type, ref, name, description, conditions).
A batch function step. Read more in the docs.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
settingsobjectrequiredThe settings for the batch step.
typestringrequiredThe type of the workflow step.
One of: "batch"
A branch function step. Read more in the docs.
branchesWorkflowBranchStepBranch[]requiredA list of workflow branches to be evaluated.
descriptionstringAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
typestringrequiredThe type of step.
One of: "branch"
A chat step within a workflow. Read more in the docs.
channel_group_keystringnullableThe key of the channel group to which the channel step will be sending a notification. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_keystringnullableThe key of a specific configured channel instance (e.g., 'knock-email', 'postmark', 'sendgrid-marketing') to send the notification through. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_overridesobjectA map of channel overrides for the channel step.
channel_typestringThe type of the channel step. Always `chat` for chat steps.
One of: "chat"
conditionsobjectA set of conditions to be evaluated for this channel step.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
A list of send window objects. Must include one send window object per day of the week.
A chat template.
typestringrequiredThe type of the workflow step.
One of: "channel"
An in-app feed step within a workflow. Read more in the docs.
channel_group_keystringnullableThe key of the channel group to which the channel step will be sending a notification. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_keystringnullableThe key of a specific configured channel instance (e.g., 'knock-email', 'postmark', 'sendgrid-marketing') to send the notification through. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_overridesobjectA map of channel overrides for the channel step.
channel_typestringThe type of the channel step. Always `in_app_feed` for in-app feed steps.
One of: "in_app_feed"
conditionsobjectA set of conditions to be evaluated for this channel step.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
A list of send window objects. Must include one send window object per day of the week.
An in-app feed template.
typestringrequiredThe type of the workflow step.
One of: "channel"
An email step within a workflow. Read more in the docs.
channel_group_keystringnullableThe key of the channel group to which the channel step will be sending a notification. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_keystringnullableThe key of a specific configured channel instance (e.g., 'knock-email', 'postmark', 'sendgrid-marketing') to send the notification through. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_overridesobjectA map of channel overrides for the channel step.
channel_typestringThe category of channel for this step. Always `email` for email steps. This identifies the type of notification (email, sms, push, etc.) while `channel_key` specifies which configured provider instance to use.
One of: "email"
conditionsobjectA set of conditions to be evaluated for this channel step.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
A list of send window objects. Must include one send window object per day of the week.
An email message template.
typestringrequiredThe type of the workflow step.
One of: "channel"
A push step within a workflow. Read more in the docs.
channel_group_keystringnullableThe key of the channel group to which the channel step will be sending a notification. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_keystringnullableThe key of a specific configured channel instance (e.g., 'knock-email', 'postmark', 'sendgrid-marketing') to send the notification through. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_overridesobjectA map of channel overrides for the channel step.
channel_typestringThe type of the channel step. Always `push` for push steps.
One of: "push"
conditionsobjectA set of conditions to be evaluated for this channel step.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
A list of send window objects. Must include one send window object per day of the week.
A push notification template.
typestringrequiredThe type of the workflow step.
One of: "channel"
A SMS step within a workflow. Read more in the docs.
channel_group_keystringnullableThe key of the channel group to which the channel step will be sending a notification. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_keystringnullableThe key of a specific configured channel instance (e.g., 'knock-email', 'postmark', 'sendgrid-marketing') to send the notification through. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_overridesobjectA map of channel overrides for the channel step.
channel_typestringThe type of the channel step. Always `sms` for SMS steps.
One of: "sms"
conditionsobjectA set of conditions to be evaluated for this channel step.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
A list of send window objects. Must include one send window object per day of the week.
An SMS template.
typestringrequiredThe type of the workflow step.
One of: "channel"
A webhook step within a workflow to send an HTTP request to a generic channel. Read more in the docs.
channel_group_keystringnullableThe key of the channel group to which the channel step will be sending a notification. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_keystringnullableThe key of a specific configured channel instance (e.g., 'knock-email', 'postmark', 'sendgrid-marketing') to send the notification through. Either `channel_key` or `channel_group_key` must be provided, but not both.
channel_typestringThe type of the channel step. Always `http` for webhook steps.
One of: "http"
conditionsobjectA set of conditions to be evaluated for this channel step.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
A list of send window objects. Must include one send window object per day of the week.
A webhook template. By default, a webhook step will use the request settings you configured in your webhook channel. You can override this as you see fit on a per-step basis.
typestringrequiredThe type of the workflow step.
One of: "channel"
A delay function step. Read more in the docs.
conditionsobjectA set of conditions to be evaluated for this delay step.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
settingsobjectrequiredThe settings for the delay step. Both fields can be set to compute a delay where `delay_for` is an offset from the `delay_until_field_path`.
typestringrequiredThe type of the workflow step.
One of: "delay"
A fetch function step. Retrieves data from an external source and merges it into the workflow's data scope for use in later steps. Read more in the docs.
conditionsobjectA conditions object that describes one or more conditions to be met in order for the step to be executed.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
A request template for a fetch function step.
typestringrequiredThe type of the workflow step.
One of: "http_fetch"
A throttle function step. Read more in the docs.
conditionsobjectA conditions object that describes one or more conditions to be met in order for the step to be executed.
descriptionstringnullableAn arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
settingsobjectrequiredThe settings for the throttle step.
typestringrequiredThe type of the workflow step.
One of: "throttle"
A workflow trigger function step. Read more in the docs.
conditionsobjectA set of conditions to be evaluated for this trigger workflow step.
descriptionstringnullableA description for the workflow step.
namestringnullableA name for the workflow step.
refstringrequiredThe reference key of the workflow step. Must be unique per workflow.
settingsobjectrequiredThe settings for the workflow trigger workflow step.
typestringrequiredThe type of the workflow step.
One of: "trigger_workflow"
Broadcasts are a way to send one-time, cross-channel notifications to your users through Knock. They use the Knock workflow engine, but are configured in the Knock dashboard to run once.
/v1/broadcasts/{broadcast_key}/send/v1/broadcasts/{broadcast_key}/validate/v1/broadcasts/v1/broadcasts/{broadcast_key}/v1/broadcasts/{broadcast_key}/v1/broadcasts/{broadcast_key}/cancelSends a broadcast immediately or schedules it to send at a future time.
/v1/broadcasts/{broadcast_key}/sendbroadcast_keystringrequiredThe key of the broadcast.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
send_atstringWhen to send the broadcast. If provided, the broadcast will be scheduled to send at this time. Must be in ISO 8601 UTC format. If not provided, the broadcast will be sent immediately.
WrappedBroadcastResponseWraps the Broadcast response under the `broadcast` key.
Validates a broadcast payload without persisting it.
/v1/broadcasts/{broadcast_key}/validatebroadcast_keystringrequiredThe key of the broadcast.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
A broadcast request for upserting a broadcast.
WrappedBroadcastResponseWraps the Broadcast response under the `broadcast` key.
Returns a paginated list of broadcasts available in a given environment. The broadcasts are returned ordered by creation time (newest first).
/v1/broadcastsenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
PaginatedBroadcastResponseA paginated list of Broadcast. Contains a list of entries and page information.
Get a broadcast by its key in a given environment.
/v1/broadcasts/{broadcast_key}broadcast_keystringrequiredThe key of the broadcast to retrieve.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
A broadcast object.
Updates a broadcast of a given key, or creates a new one if it does not yet exist.
/v1/broadcasts/{broadcast_key}broadcast_keystringrequiredThe key of the broadcast.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
A broadcast request for upserting a broadcast.
WrappedBroadcastResponseWraps the Broadcast response under the `broadcast` key.
Cancels sending a scheduled broadcast. The broadcast will return to draft status.
/v1/broadcasts/{broadcast_key}/cancelbroadcast_keystringrequiredThe key of the broadcast.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
WrappedBroadcastResponseWraps the Broadcast response under the `broadcast` key.
A broadcast request for upserting a broadcast.
categoriesstring[]A list of categories that the broadcast belongs to.
descriptionstringAn arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.
namestringrequiredA name for the broadcast. Must be at maximum 255 characters in length.
scheduled_atstringnullableThe timestamp of when the broadcast is scheduled to be sent.
settingsobjectA map of broadcast settings.
stepsobject[]requiredA list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.
target_audience_keystringThe key of the audience to target for this broadcast.
A broadcast object.
archived_atstringnullableThe timestamp of when the broadcast was archived.
categoriesstring[]A list of categories that the broadcast belongs to.
created_atstringrequiredThe timestamp of when the broadcast was created. (read-only).
descriptionstringAn arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.
environmentstringrequiredThe slug of the environment in which the broadcast exists. (read-only).
keystringrequiredThe unique key string for the broadcast object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
namestringrequiredA name for the broadcast. Must be at maximum 255 characters in length.
scheduled_atstringnullableThe timestamp of when the broadcast is scheduled to be sent.
sent_atstringnullableThe timestamp of when the broadcast was sent. (read-only).
settingsobjectA map of broadcast settings.
shastringrequiredThe SHA hash of the workflow data. (read-only).
statusstringrequiredThe current status of the broadcast. One of: `draft`, `scheduled`, `sent`.
One of: "draft", "scheduled", "sent"
stepsobject[]requiredA list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.
target_audience_keystringThe key of the audience to target for this broadcast.
updated_atstringrequiredThe timestamp of when the broadcast was last updated. (read-only).
validbooleanrequiredWhether the broadcast and its steps are in a valid state. (read-only).
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.
/v1/email_layouts/v1/email_layouts/{email_layout_key}/v1/email_layouts/{email_layout_key}/v1/email_layouts/{email_layout_key}/validateReturns a paginated list of email layouts available in a given environment.
/v1/email_layoutsenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedEmailLayoutResponseA paginated list of EmailLayout. Contains a list of entries and page information.
Retrieve an email layout by its key, in a given environment.
/v1/email_layouts/{email_layout_key}email_layout_keystringrequiredThe key of the email layout to show.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
A versioned email layout used within an environment.
Updates an email layout, or creates a new one if it does not yet exist.
Note: this endpoint only operates in the "development" environment.
/v1/email_layouts/{email_layout_key}email_layout_keystringrequiredThe key of the email layout to upsert.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
commitbooleanWhether to commit the resource at the same time as modifying it.
commit_messagestringThe message to commit the resource with, only used if `commit` is `true`.
email_layoutEmailLayoutRequestrequiredA request to update or create an email layout.
WrappedEmailLayoutResponseWraps the EmailLayout response under the `email_layout` key.
Validates an email layout payload without persisting it.
Note: this endpoint only operates in the "development" environment.
/v1/email_layouts/{email_layout_key}/validateemail_layout_keystringrequiredThe key of the email layout to validate.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
email_layoutEmailLayoutRequestrequiredA request to update or create an email layout.
WrappedEmailLayoutResponseWraps the EmailLayout response under the `email_layout` key.
A versioned email layout used within an environment.
created_atstringrequiredThe timestamp of when the email layout was created.
environmentstringThe environment of the email layout.
footer_linksobject[]A list of one or more items to show in the footer of the email layout.
html_layoutstringrequiredThe complete HTML content of the email layout.
keystringrequiredThe unique key for this email layout.
namestringrequiredThe human-readable name of this email layout.
shastringrequiredThe SHA of the email layout.
text_layoutstringrequiredThe complete plaintext content of the email layout.
updated_atstringThe timestamp of when the email layout was last updated.
Translations support localization in Knock. They hold the translated content for a given locale, which you can reference in your message templates with the t Liquid function filter.
You can retrieve, update, and create translations as well as list all translations in a given environment. Translations are identified by their locale code + an optional namespace.
/v1/translations/v1/translations/{locale_code}/v1/translations/{locale_code}/v1/translations/{locale_code}/validateReturns a paginated list of translations available in a given environment. The translations are returned in alphabetical order by locale code.
/v1/translationslocale_codestringA specific locale code to filter translations for.
namespacestringA specific namespace to filter translations for.
formatstringOptionally specify the returned content format. Supports 'json' and 'po'. Defaults to 'json'.
One of: "json", "po"
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedTranslationResponseA paginated list of Translation. Contains a list of entries and page information.
Retrieve a translation by its locale and namespace, in a given environment.
/v1/translations/{locale_code}locale_codestringrequiredA specific locale code to filter translations for.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
formatstringOptionally specify the returned content format. Supports 'json' and 'po'. Defaults to 'json'.
One of: "json", "po"
namespacestringA specific namespace to filter translations for.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
WrappedTranslationResponseWraps the Translation response under the `translation` key.
Updates a translation of a given locale code + namespace, or creates a new one if it does not yet exist.
Note: this endpoint only operates on translations in the "development" environment.
/v1/translations/{locale_code}locale_codestringrequiredA locale code of the translation.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
namespacestringrequiredAn optional namespace that identifies the translation.
formatstringOptionally specify the returned content format. Supports 'json' and 'po'. Defaults to 'json'.
One of: "json", "po"
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
commitbooleanWhether to commit the resource at the same time as modifying it.
commit_messagestringThe message to commit the resource with, only used if `commit` is `true`.
translationTranslationRequestrequiredA translation object with a content attribute used to update or create a translation.
WrappedTranslationResponseWraps the Translation response under the `translation` key.
Validates a translation payload without persisting it.
Note: this endpoint only operates on translations in the "development" environment.
/v1/translations/{locale_code}/validatelocale_codestringrequiredThe translation's locale code.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
translationTranslationRequestrequiredA translation object with a content attribute used to update or create a translation.
WrappedTranslationResponseWraps the Translation response under the `translation` key.
A translation object.
contentstringrequiredA JSON encoded string containing the key-value pairs of translation references and translation strings.
formatstringrequiredIndicates whether content is a JSON encoded object string or a string in the PO format.
One of: "json", "po"
inserted_atstringrequiredThe timestamp of when the translation was created.
locale_codestringrequiredThe locale code for the translation object.
namespacestringrequiredAn optional namespace for the translation to help categorize your translations.
updated_atstringrequiredThe timestamp of when the translation was last updated.
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.
/v1/partials/v1/partials/{partial_key}/v1/partials/{partial_key}/v1/partials/{partial_key}/validateList all partials for a given environment.
/v1/partialsenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedPartialResponseA paginated list of Partial. Contains a list of entries and page information.
Get a partial by its key.
/v1/partials/{partial_key}partial_keystringrequiredThe key of the partial to retrieve.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
A partial is a reusable piece of content that can be used in a template.
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.
/v1/partials/{partial_key}partial_keystringrequiredThe key of the partial to upsert.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
commitbooleanWhether to commit the resource at the same time as modifying it.
commit_messagestringThe message to commit the resource with, only used if `commit` is `true`.
partialPartialRequestrequiredA partial object with attributes to update or create a partial.
WrappedPartialResponseWraps the Partial response under the `partial` key.
Validates a partial payload without persisting it.
Note: this endpoint only operates on partials in the “development” environment.
/v1/partials/{partial_key}/validatepartial_keystringrequiredThe key of the partial to validate.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
partialPartialRequestrequiredA partial object with attributes to update or create a partial.
WrappedPartialResponseWraps the Partial response under the `partial` key.
A partial is a reusable piece of content that can be used in a template.
contentstringrequiredThe partial content.
descriptionstringAn arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed.
environmentstringThe slug of the environment in which the partial exists.
icon_namestringThe name of the icon to be used in the visual editor.
input_schemaobject[]The field types available for the partial.
inserted_atstringrequiredThe timestamp of when the partial was created.
keystringrequiredThe 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_-]+$.
namestringrequiredA name for the partial. Must be at maximum 255 characters in length.
typestringrequiredThe partial type. One of 'html', 'json', 'markdown', 'text'.
One of: "html", "text", "json", "markdown"
updated_atstringrequiredThe timestamp of when the partial was last updated.
validbooleanrequiredWhether the partial and its content are in a valid state.
visual_block_enabledbooleanIndicates whether the partial can be used in the visual editor. Only applies to HTML partials.
To version the changes you make in your environments, Knock uses a commit model. When you make changes to a workflow, a layout, or a translation, you will need to commit them in your development environment, then promote to subsequent environments before those changes will appear in the respective environments.
You can retrieve all commits in a given environment, or show the details of one single commit based on the target commit id.
/v1/commits/v1/commits/v1/commits/{id}/v1/commits/promote/v1/commits/{id}/promoteReturns a paginated list of commits in a given environment. The commits are ordered from most recent first.
/v1/commitsenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
promotedbooleanWhether to show commits in the given environment that have not been promoted to the subsequent environment (false) or commits which have been promoted (true).
resource_typeunknownFilter commits by resource type(s). Accepts a single type or array of types. Can be combined with resource_id to filter for specific resources.
resource_idstringFilter commits by resource identifier. Must be used together with resource_type. For most resources, this will be the resource key. In the case of translations, this will be the locale code and namespace, separated by a `/`. For example, `en/courses` or `en`.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedCommitResponseA paginated list of Commit. Contains a list of entries and page information.
Commit all changes across all resources in the development environment.
/v1/commitsenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
commit_messagestringAn optional message to include in a commit.
resource_typeunknownFilter changes to commit by resource type(s). Accepts a single type or array of types. Can be combined with resource_id to filter for specific resources.
resource_idstringFilter changes to commit by resource identifier. Must be used together with resource_type.
CommitAllResponseThe response from committing all changes.
Retrieve a single commit by its ID.
/v1/commits/{id}idstringrequiredThe id of the commit to retrieve.
A commit is a change to a resource within an environment, made by an author.
Promote all changes across all resources to the target environment from its preceding environment.
/v1/commits/promoteto_environmentstringrequiredA slug of the target environment to which you want to promote all changes from its directly preceding environment. For example, if you have three environments “development”, “staging”, and “production” (in that order), setting this param to “production” will promote all commits not currently in production from staging. When this param is set to `"development"`, the `"branch"` param must be provided.
branchstringThe slug of the branch to promote all changes from.
resource_typeunknownFilter commits to promote by resource type(s). Accepts a single type or array of types. Can be combined with resource_id to filter for specific resources.
resource_idstringFilter commits to promote by resource identifier. Must be used together with resource_type.
PromoteAllResponseThe response from promoting all changes.
Promotes one change to the subsequent environment.
/v1/commits/{id}/promoteidstringrequiredThe target commit ID to promote to the subsequent environment.
WrappedCommitResponseWraps the Commit response under the `commit` key.
A commit is a change to a resource within an environment, made by an author.
authorCommitAuthorrequiredThe author of the commit.
commit_messagestringThe optional message about the commit.
created_atstringrequiredThe timestamp of when the commit was created.
environmentstringrequiredThe environment of the commit.
idstringrequiredThe unique identifier for the commit.
resourceCommitResourcerequiredThe resource object associated with the commit.
Variables are used to store shared attributes for your workflows and templates at the environment level.
/v1/variablesReturns a paginated list of variables for a given environment.
/v1/variablesenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedVariableResponseA paginated list of Variable. Contains a list of entries and page information.
An environment variable object.
descriptionstringnullableThe description of the variable.
inserted_atstringrequiredThe timestamp of when the variable was created.
keystringrequiredThe key of the variable.
typestringrequiredThe type of the variable.
One of: "public", "secret"
Default: "public"
updated_atstringrequiredThe timestamp of when the variable was last updated.
valuestringrequiredThe value of the variable.
Templates represent the templated contents of a message sent to an individual recipient on a specific channel.
There are no endpoints for working directly with templates, instead you must do so through modifying a workflow.
A chat template.
json_bodystringnullableA JSON template for the chat notification message payload. Only present if not using the markdown body.
markdown_bodystringrequiredThe markdown body of the chat template.
summarystringThe summary of the chat template. Used by some chat apps in their push notifications.
An email message template.
html_bodystringnullableAn HTML template for the email body. **Required** if `visual_blocks` is not provided. Only one of `html_body` or `visual_blocks` should be set. Supports Liquid templating with variables like `{{ recipient.name }}`, `{{ actor.name }}`, `{{ vars.app_name }}`, `{{ data.custom_field }}`, and `{{ tenant.name }}`. See the [template variables reference](https://docs.knock.app/designing-workflows/template-editor/variables) for available variables.
settingsEmailTemplateSettingsrequiredThe [settings](https://docs.knock.app/integrations/email/settings) for the email template. Must be supplied with at least `layout_key`.
subjectstringrequiredThe subject of the email. Supports Liquid templating with variables like `{{ recipient.name }}`, `{{ actor.name }}`, `{{ vars.app_name }}`, `{{ data.custom_field }}`, and `{{ tenant.name }}`. See the [template variables reference](https://docs.knock.app/designing-workflows/template-editor/variables) for available variables.
text_bodystringnullableA text template for the email body. When omitted, the email template will be autogenerated from the `html_body` or `visual_blocks`.
visual_blocksobjectThe visual blocks that make up the email template. **Required** if `html_body` is not provided. Only one of `html_body` or `visual_blocks` should be set.
A push notification template.
settingsobjectrequiredThe [settings](https://docs.knock.app/integrations/sms/settings-and-overrides) for the push template.
text_bodystringrequiredThe body of the push notification.
titlestringrequiredThe title of the push notification.
An SMS template.
settingsobjectThe settings for the SMS template. Can be omitted.
text_bodystringrequiredThe message of the SMS.
An in-app feed template.
action_buttonsobject[]The action buttons of the in-app feed message.
action_urlstringnullableThe URL to navigate to when the in-app feed is tapped. Can be omitted for multi-action templates, where the action buttons will be used instead.
markdown_bodystringrequiredThe markdown body of the in-app feed.
A request template for a fetch function step.
bodystringnullableThe body of the request. Only used for POST or PUT requests.
headersobjectThe headers of the request. Can be a template string or a list of key-value pairs.
methodstringrequiredThe HTTP method of the request.
One of: "get", "post", "put", "delete", "patch"
query_paramsobjectThe query params of the request. Can be a template string or a list of key-value pairs.
urlstringrequiredThe URL of the request.
A webhook template. By default, a webhook step will use the request settings you configured in your webhook channel. You can override this as you see fit on a per-step basis.
bodystringnullableThe body of the request. Only used for POST or PUT requests.
headersobject[]A list of key-value pairs for the request headers. Each object should contain key and value fields with string values.
methodstringrequiredThe HTTP method of the webhook.
One of: "get", "post", "put", "delete", "patch"
query_paramsobject[]A list of key-value pairs for the request query params. Each object should contain key and value fields with string values.
urlstringrequiredThe URL of the webhook.
A message type is a schema for a message that maps to a UI component or element within your application.
/v1/message_types/v1/message_types/{message_type_key}/v1/message_types/{message_type_key}/v1/message_types/{message_type_key}/validateReturns a paginated list of message types available in a given environment.
/v1/message_typesenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedMessageTypeResponseA paginated list of MessageType. Contains a list of entries and page information.
Retrieve a message type by its key, in a given environment.
/v1/message_types/{message_type_key}message_type_keystringrequiredThe key of the message type to retrieve.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
A message type is a schema for a message that maps to a UI component or element within your application.
Updates a message type, or creates a new one if it does not yet exist.
Note: this endpoint only operates in the development environment.
/v1/message_types/{message_type_key}message_type_keystringrequiredThe key of the message type to upsert.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
commitbooleanWhether to commit the resource at the same time as modifying it.
commit_messagestringThe message to commit the resource with, only used if `commit` is `true`.
message_typeMessageTypeRequestrequiredA request to create a message type.
WrappedMessageTypeResponseWraps the MessageType response under the `message_type` key.
Validates a message type payload without persisting it.
Note: this endpoint only operates on message types in the development environment.
/v1/message_types/{message_type_key}/validatemessage_type_keystringrequiredThe key of the message type to validate.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
message_typeMessageTypeRequestrequiredA request to create a message type.
WrappedMessageTypeResponseWraps 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.
archived_atstringnullableThe timestamp of when the message type was deleted.
created_atstringrequiredThe timestamp of when the message type was created.
deleted_atstringnullableThe timestamp of when the message type was deleted.
descriptionstringnullableAn arbitrary string attached to a message type object. Useful for adding notes about the message type for internal purposes. Maximum of 280 characters allowed.
environmentstringrequiredThe environment of the message type.
icon_namestringThe icon name of the message type.
keystringrequiredThe 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_-]+$.
namestringrequiredA name for the message type. Must be at maximum 255 characters in length.
ownerstringrequiredThe owner of the message type.
One of: "system", "user"
previewstringrequiredAn HTML/liquid template for the message type preview.
semverstringrequiredThe semantic version of the message type.
shastringrequiredThe SHA hash of the message type.
updated_atstringrequiredThe timestamp of when the message type was last updated.
validbooleanrequiredWhether the message type is valid.
The variants of the message type.
A variant of a message type.
fieldsobject[]requiredThe field types available for the variant.
keystringrequiredThe 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_-]+$.
namestringrequiredA name for the variant. Must be at maximum 255 characters in length.
A text field used in a message type.
keystringrequiredThe unique key of the field.
labelstringrequirednullableThe label of the field.
settingsobjectSettings for the text field.
typestringrequiredThe type of the field.
One of: "text"
Guides let you define in-app messaging for your users, powered by your own components.
/v1/guides/v1/guides/{guide_key}/v1/guides/{guide_key}/v1/guides/{guide_key}/v1/guides/{guide_key}/validate/v1/guides/{guide_key}/activateReturns a paginated list of guides available in a given environment.
/v1/guidesenvironmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedGuideResponseA paginated list of Guide. Contains a list of entries and page information.
Get a guide by its key.
/v1/guides/{guide_key}guide_keystringrequiredThe key of the guide to retrieve.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
hide_uncommitted_changesbooleanWhether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.
A guide defines an in-app guide that can be displayed to users based on priority and other conditions.
Archives a given guide across all environments.
/v1/guides/{guide_key}guide_keystringrequiredThe key of the guide to archive.
ArchiveGuideResponseThe response from archiving a guide.
Updates a guide of a given key, or creates a new one if it does not yet exist.
Note: this endpoint only operates on guides in the "development" environment.
/v1/guides/{guide_key}guide_keystringrequiredThe key of the guide to upsert.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
annotatebooleanWhether to annotate the resource. Only used in the Knock CLI.
commitbooleanWhether to commit the resource at the same time as modifying it.
commit_messagestringThe message to commit the resource with, only used if `commit` is `true`.
guideGuideRequestrequiredA request to create or update a guide.
WrappedGuideResponseWraps the Guide response under the `guide` key.
Validates a guide payload without persisting it.
Note: Validating a guide is only done in the development environment context.
/v1/guides/{guide_key}/validateguide_keystringrequiredThe key of the guide.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
guideGuideRequestrequiredA request to create or update a guide.
WrappedGuideResponseWraps the Guide response under the `guide` key.
Activates (or deactivates) a guide in a given environment. You can either set the active status immediately or schedule it.
Note: This immediately enables or disables a guide in a given environment without needing to go through environment promotion.
/v1/guides/{guide_key}/activateguide_keystringrequiredThe key of the guide.
environmentstringrequiredThe environment slug.
branchstringThe slug of a branch to use. This option can only be used when `environment` is `"development"`.
WrappedGuideResponseWraps the Guide response under the `guide` key.
A guide defines an in-app guide that can be displayed to users based on priority and other conditions.
activation_url_patternsGuideActivationUrlPattern[]A list of activation url patterns that describe when the guide should be shown.
activebooleanrequiredWhether the guide is active.
Default: false
archived_atstringnullableThe timestamp of when the guide was archived.
channel_keystringThe key of the channel in which the guide exists.
created_atstringrequiredThe timestamp of when the guide was created.
deleted_atstringnullableThe timestamp of when the guide was deleted.
descriptionstringnullableAn arbitrary string attached to a guide object. Useful for adding notes about the guide for internal purposes. Maximum of 280 characters allowed.
environmentstringrequiredThe slug of the environment in which the guide exists.
keystringrequiredThe unique key string for the guide object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
namestringrequiredA name for the guide. Must be at maximum 255 characters in length.
semverstringThe semver of the guide.
shastringrequiredThe SHA hash of the guide.
stepsGuideStep[]A list of guide step objects in the guide.
target_audience_idstringnullableThe ID of the target audience for the guide. When not set, will default to targeting all users.
target_property_conditionsobjectA conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.
typestringThe type of the guide. This is derived from the message type of the guide steps.
updated_atstringrequiredThe timestamp of when the guide was last updated.
validbooleanWhether the guide is valid.
A step in a guide that corresponds to a piece of UI and its content.
namestringA name for the step.
refstringrequiredThe unique reference string for the step. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.
schema_keystringrequiredThe key of the template schema to use for this step.
schema_semverstringrequiredThe semantic version of the template schema to use.
schema_variant_keystringrequiredThe key of the template schema variant to use.
valuesobjectA map of values that make up the step's content. Each value must conform to its respective template schema field settings.
A rule that controls when a guide should be shown based on the user's location in the application.
directivestringrequiredWhether to allow or block the guide at the specified pathname.
One of: "allow", "block"
Default: "allow"
pathnamestringrequiredThe URL pathname pattern to match against. Must be a valid URI path.
API keys are used to authenticate requests to the Knock API.
/v1/api_keys/exchangeGiven an authenticated service token and an environment, will exchange the service token for a secret API key that can be used to make requests to the public API.
/v1/api_keys/exchangeenvironmentstringrequiredThe environment slug.
ExchangeForApiKeyResponseReturns an API key that can be used to make requests to the public API.
Branches are a way to isolate changes to your Knock resources.
/v1/branches/v1/branches/{branch_slug}/v1/branches/{branch_slug}/v1/branches/{branch_slug}Returns a paginated list of branches. The branches will be returned in order of their last commit time (newest first).
/v1/branchesenvironmentstringrequiredThe environment slug.
afterstringThe cursor to fetch entries after.
beforestringThe cursor to fetch entries before.
limitintegerThe number of entries to fetch per-page.
PaginatedBranchResponseA paginated list of Branch. Contains a list of entries and page information.
Deletes a branch by the branch_slug.
/v1/branches/{branch_slug}branch_slugstringrequiredThe slug of the branch to delete.
environmentstringrequiredThe environment slug.
204 No ContentReturns a single branch by the branch_slug.
/v1/branches/{branch_slug}branch_slugstringrequiredThe slug of the branch to retrieve.
environmentstringrequiredThe environment slug.
A branch object.
Creates a new branch off of the development environment with the given slug.
/v1/branches/{branch_slug}branch_slugstringrequiredThe slug for the new branch to create.
environmentstringrequiredThe environment slug.
A branch object.
A branch object.
created_atstringrequiredThe timestamp of when the branch was created.
deleted_atstringnullableThe timestamp of when the branch was deleted.
last_commit_atstringnullableThe timestamp of the most-recent commit in the branch.
slugstringrequiredA unique slug for the branch. Cannot exceed 255 characters.
updated_atstringrequiredThe timestamp of when the branch was last updated.
Resources that are shared across the API.
The information about a paginated result.
afterstringnullableThe cursor to fetch entries after. Will only be present if there are more entries to fetch.
beforestringnullableThe cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.
page_sizeintegerrequiredThe number of entries to fetch per-page.