components: responses: {} schemas: PreviewTemplateResponse: description: A response to a template preview request. example: content_type: email result: success template: html_body:
Welcome to Acme!
subject: Hello John text_body: Welcome to Acme! properties: content_type: description: The content type of the preview. enum: - email - in_app_feed - push - chat - sms type: string x-struct: null x-validate: null errors: description: A list of errors encountered during rendering. Present when result is "error". items: description: A rendering error with optional location information. example: field: html_content line: 1 message: 'Reason: expected end of string, line: 1' properties: field: description: The template field that caused the error, if available. nullable: true type: string x-struct: null x-validate: null line: description: The line number where the error occurred, if available. nullable: true type: integer x-struct: null x-validate: null message: description: A human-readable description of the error. type: string x-struct: null x-validate: null required: - message type: object x-struct: null x-validate: null nullable: true type: array x-struct: null x-validate: null result: description: The result of the preview. enum: - success - error type: string x-struct: null x-validate: null template: anyOf: - $ref: '#/components/schemas/EmailTemplate' - $ref: '#/components/schemas/InAppFeedTemplate' - $ref: '#/components/schemas/PushTemplate' - $ref: '#/components/schemas/ChatTemplate' - $ref: '#/components/schemas/SmsTemplate' description: The rendered template, ready to be previewed. type: object x-struct: null x-validate: null required: - result - content_type title: PreviewTemplateResponse type: object x-struct: Elixir.ControlWeb.V1.Specs.PreviewTemplateResponse x-validate: null RequestTemplateQueryParamsArray: description: A list of key-value pairs for the request query params. Each object should contain key and value fields with string values. example: - key: key value: value items: properties: key: description: The key of the query param. example: key type: string x-struct: null x-validate: null value: description: The value of the query param. example: value type: string x-struct: null x-validate: null required: - key - value type: object x-struct: null x-validate: null title: RequestTemplateQueryParamsArray type: array x-struct: null x-validate: null SmsChannelSettings: description: SMS channel settings. Only used as configuration as part of a workflow channel step. example: link_tracking: true properties: link_tracking: description: Whether to track link clicks on SMS notifications. example: true type: boolean x-struct: null x-validate: null title: SmsChannelSettings type: object x-struct: Elixir.ControlWeb.V1.Specs.SmsChannelSettings x-validate: null WrappedEmailLayoutRequestRequest: description: Wraps the EmailLayoutRequest request under the email_layout key. example: email_layout: footer_links: - text: Example url: http://example.com html_layout: Hello, world! name: Transactional text_layout: Hello, world! properties: email_layout: $ref: '#/components/schemas/EmailLayoutRequest' required: - email_layout title: WrappedEmailLayoutRequestRequest type: object x-struct: null x-validate: null WorkflowStep: anyOf: - $ref: '#/components/schemas/WorkflowWebhookStep' - $ref: '#/components/schemas/WorkflowInAppFeedStep' - $ref: '#/components/schemas/WorkflowChatStep' - $ref: '#/components/schemas/WorkflowSmsStep' - $ref: '#/components/schemas/WorkflowPushStep' - $ref: '#/components/schemas/WorkflowEmailStep' - $ref: '#/components/schemas/WorkflowAIAgentStep' - $ref: '#/components/schemas/WorkflowDelayStep' - $ref: '#/components/schemas/WorkflowBatchStep' - $ref: '#/components/schemas/WorkflowFetchStep' - $ref: '#/components/schemas/WorkflowUpdateDataStep' - $ref: '#/components/schemas/WorkflowUpdateObjectStep' - $ref: '#/components/schemas/WorkflowUpdateTenantStep' - $ref: '#/components/schemas/WorkflowUpdateUserStep' - $ref: '#/components/schemas/WorkflowThrottleStep' - $ref: '#/components/schemas/WorkflowBranchStep' - $ref: '#/components/schemas/WorkflowRandomCohortStep' - $ref: '#/components/schemas/WorkflowTriggerWorkflowStep' description: A step within a workflow. Each workflow step, regardless of its type, share a common set of core attributes (`type`, `ref`, `name`, `description`, `conditions`). example: channel_group_key: null channel_key: postmark channel_overrides: null channel_type: email conditions: null description: This is a description of the channel step name: Email channel step ref: channel_step send_windows: null template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }} text_body: 'Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here: {{ data.sign_in_url }}.' type: channel title: WorkflowStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowStep x-validate: null RequestTemplateQueryParamsString: description: A template string that should resolve to a JSON object representing the query params. example: '{{ data.request_query_params }}' title: RequestTemplateQueryParamsString type: string x-struct: null x-validate: null EmailImageBlock: description: An image block in an email template. example: alt: Example image layout_attrs: horizontal_align: center padding_bottom: 4 padding_left: 0 padding_right: 0 padding_top: 4 style_attrs: width: 25% type: image url: https://example.com/image.jpg properties: action: description: Optional action URL for the image. nullable: true type: string x-struct: null x-validate: null alt: description: Alt text for the image. nullable: true type: string x-struct: null x-validate: null id: description: The ID of the block. example: 123e4567-e89b-12d3-a456-426614174000 format: uuid type: string x-struct: null x-validate: null layout_attrs: description: The layout attributes of the block. properties: horizontal_align: description: The horizontal alignment of the block. enum: - left - center - right type: string x-struct: null x-validate: null padding_bottom: description: The padding_bottom layout attribute of the block. type: integer x-struct: null x-validate: null padding_left: description: The padding_left layout attribute of the block. type: integer x-struct: null x-validate: null padding_right: description: The padding_right layout attribute of the block. type: integer x-struct: null x-validate: null padding_top: description: The padding_top layout attribute of the block. type: integer x-struct: null x-validate: null required: - padding_top - padding_right - padding_bottom - padding_left - horizontal_align type: object x-struct: null x-validate: null style_attrs: description: The style attributes of the image. properties: width: description: The width of the image. example: 100% type: string x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the block. enum: - image example: image type: string x-struct: null x-validate: null url: description: The URL of the image to display. format: uri type: string x-struct: null x-validate: null version: description: The version of the block schema. This is automatically managed by Knock and should not be set manually. Currently all blocks are at version 1. example: 1 type: integer x-struct: null x-validate: null required: - type - url title: EmailImageBlock type: object x-struct: Elixir.ControlWeb.V1.Specs.EmailBlocks.ImageBlock x-validate: null PaginatedVariableResponse: description: A paginated list of Variable. Contains a list of entries and page information. example: entries: - description: This is a description of my variable. environment_values: development: dev_value production: prod_value inserted_at: '2021-01-01T00:00:00Z' key: my_variable type: public updated_at: '2021-01-01T00:00:00Z' value: my_value page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Variable' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedVariableResponse type: object x-struct: null x-validate: null ChannelGroupRuleRequest: description: A rule that determines if a channel should be executed as part of a channel group. example: channel_key: email-channel index: 0 rule_type: always properties: argument: description: For conditional rules, the value to compare against. nullable: true type: string x-struct: null x-validate: null channel_key: description: The key of the channel this rule applies to. type: string x-struct: null x-validate: null index: description: The order index of this rule within the channel group. type: integer x-struct: null x-validate: null operator: description: For conditional rules, the operator to apply. enum: - 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_on_or_after - is_timestamp_between - is_between - empty - not_empty - exists - not_exists - is_timestamp - is_audience_member - is_not_audience_member example: equal_to nullable: true type: string x-struct: null x-validate: null rule_type: description: The type of rule (if = conditional, unless = negative conditional, always = always apply). enum: - if - unless - always type: string x-struct: null x-validate: null variable: description: For conditional rules, the variable to evaluate. nullable: true type: string x-struct: null x-validate: null required: - channel_key - rule_type title: ChannelGroupRuleRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.ChannelGroupRuleRequest x-validate: null PreviewWorkflowTemplateResponse: description: A response to a preview workflow template request. example: content_type: email result: success template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }} text_body: 'Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here: {{ data.sign_in_url }}.' properties: content_type: description: The content type of the preview. enum: - email - in_app_feed - push - chat - sms - http type: string x-struct: null x-validate: null result: description: The result of the preview. enum: - success - error type: string x-struct: null x-validate: null template: anyOf: - $ref: '#/components/schemas/EmailTemplate' - $ref: '#/components/schemas/InAppFeedTemplate' - $ref: '#/components/schemas/PushTemplate' - $ref: '#/components/schemas/ChatTemplate' - $ref: '#/components/schemas/SmsTemplate' - $ref: '#/components/schemas/RequestTemplate' description: The rendered template, ready to be previewed. type: object x-struct: null x-validate: null required: - result - content_type - template title: PreviewWorkflowTemplateResponse type: object x-struct: Elixir.ControlWeb.V1.Specs.PreviewWorkflowTemplateResponse x-validate: null RequestTemplateHeadersString: description: A template string that should resolve to a JSON object representing the headers. example: '{{ data.request_headers }}' title: RequestTemplateHeadersString type: string x-struct: null x-validate: null WorkflowUpdateTenantStep: description: An update tenant step. Updates properties of a specific tenant referenced in the workflow. example: description: Update tenant step description. name: Update tenant ref: update_tenant_1 settings: recipient_gid: gid://Object/$tenants/tenant-123 recipient_mode: reference update_properties: '{"name": "Updated Tenant"}' type: update_tenant properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A conditions object that describes one or more conditions to be met in order for the step to be executed. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Update tenant step description. nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Update tenant nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: update_tenant_1 type: string x-struct: null x-validate: null settings: description: The settings for the update tenant step. properties: recipient_gid: description: 'The global identifier (GID) of the tenant to update. Required when recipient_mode is ''reference''. Format: gid://Object/$tenants/{id}' example: gid://Object/$tenants/tenant-123 nullable: true type: string x-struct: null x-validate: null recipient_mode: description: The recipient mode determining how the tenant is selected. 'current' uses the workflow's current tenant. 'reference' uses a specific tenant ID. enum: - current - reference example: reference type: string x-struct: null x-validate: null update_properties: description: A JSON string or Liquid template that evaluates to the properties to update on the tenant. example: '{"name": "Updated Tenant", "status": "active"}' type: string x-struct: null x-validate: null required: - recipient_mode - update_properties type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - update_tenant example: update_tenant type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowUpdateTenantStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowUpdateTenantStep x-validate: null WorkflowDelayStep: description: A delay function step. Read more in the [docs](https://docs.knock.app/designing-workflows/delay-function). example: conditions: {} description: Delay for 10 seconds name: Delay ref: delay_step settings: delay_for: unit: seconds value: 10 type: delay properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A set of conditions to be evaluated for this delay step. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Delay for 10 seconds nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Delay nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: delay_step type: string x-struct: null x-validate: null settings: description: The 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`. properties: delay_for: anyOf: - $ref: '#/components/schemas/Duration' - nullable: true x-struct: null x-validate: null description: A duration object that describes how long to wait before proceeding to the next step. type: object x-struct: null x-validate: null delay_until_field_path: description: When set will use the path to resolve the delay into a timestamp from the property referenced example: recipient.delay_until type: string x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - delay example: delay type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowDelayStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowDelayStep x-validate: null RequestTemplate: description: A request template for a fetch function step. example: body: null headers: - key: X-API-Key value: '1234567890' method: get query_params: - key: key value: value url: https://example.com properties: body: description: The body of the request. Only used for POST or PUT requests. example: '{"key": "value"}' nullable: true type: string x-struct: null x-validate: null headers: description: The headers of the request. Can be a template string or a list of key-value pairs. example: - key: X-API-Key value: '1234567890' oneOf: - description: A template string that should resolve to a JSON object representing the headers. example: '{{ data.request_headers }}' title: RequestTemplateHeadersString type: string x-struct: null x-validate: null - description: A list of key-value pairs for the request headers. Each object should contain key and value fields with string values. example: - key: X-API-Key value: '1234567890' items: properties: key: description: The key of the header. example: X-API-Key type: string x-struct: null x-validate: null value: description: The value of the header. example: '1234567890' type: string x-struct: null x-validate: null required: - key - value type: object x-struct: null x-validate: null title: RequestTemplateHeadersArray type: array x-struct: null x-validate: null title: RequestTemplateHeaders type: object x-struct: null x-validate: null method: description: The HTTP method of the request. enum: - get - post - put - delete - patch example: post type: string x-struct: null x-validate: null query_params: description: The query params of the request. Can be a template string or a list of key-value pairs. example: - key: key value: value oneOf: - description: A template string that should resolve to a JSON object representing the query params. example: '{{ data.request_query_params }}' title: RequestTemplateQueryParamsString type: string x-struct: null x-validate: null - description: A list of key-value pairs for the request query params. Each object should contain key and value fields with string values. example: - key: key value: value items: properties: key: description: The key of the query param. example: key type: string x-struct: null x-validate: null value: description: The value of the query param. example: value type: string x-struct: null x-validate: null required: - key - value type: object x-struct: null x-validate: null title: RequestTemplateQueryParamsArray type: array x-struct: null x-validate: null title: RequestTemplateQueryParams type: object x-struct: null x-validate: null url: description: The URL of the request. example: https://example.com type: string x-struct: null x-validate: null required: - url - method title: RequestTemplate type: object x-struct: Elixir.ControlWeb.V1.Specs.RequestTemplate x-validate: null WorkflowBranchStepBranch: description: A branch in a branch step. example: conditions: all: - argument: pro operator: equal_to variable: recipient.plan_type name: Pro plan steps: [] terminates: false properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A set of conditions to be evaluated for this branch. type: object x-struct: null x-validate: null name: description: The name of the branch. example: The name of the branch. type: string x-struct: null x-validate: null steps: description: A list of steps that will be executed if the branch is chosen. items: $ref: '#/components/schemas/WorkflowStep' type: array x-struct: null x-validate: null terminates: description: If the workflow should halt at the end of the branch. Defaults to false if not provided. example: true type: boolean x-struct: null x-validate: null title: WorkflowBranchStepBranch type: object x-struct: null x-validate: null PaginatedBranchResponse: description: A paginated list of Branch. Contains a list of entries and page information. example: entries: - created_at: '2022-10-31T19:59:03Z' deleted_at: null last_commit_at: '2022-10-31T19:59:03Z' slug: feature-branch updated_at: '2022-10-31T19:59:03Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Branch' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedBranchResponse type: object x-struct: null x-validate: null GuideScheduledActivationParams: description: A request to schedule the activation of a guide. At least one of from or until must be provided. example: from: '2024-03-20T10:00:00Z' until: '2024-03-21T10:00:00Z' properties: from: description: When to activate the guide. If provided, the guide will be scheduled to activate at this time. Must be in ISO 8601 UTC format. example: '2024-03-20T10:00:00Z' format: date-time type: string x-struct: null x-validate: null until: description: When to deactivate the guide. If provided, the guide will be scheduled to deactivate at this time. Must be in ISO 8601 UTC format. example: '2024-03-21T10:00:00Z' format: date-time type: string x-struct: null x-validate: null title: GuideScheduledActivationParams type: object x-struct: null x-validate: null WrappedPartialResponse: description: Wraps the Partial response under the `partial` key. example: partial: content:Hello, world!
description: This is a test partial environment: development icon_name: icon-name input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text inserted_at: '2021-01-01T00:00:00Z' key: my-partial name: My Partial type: html updated_at: '2021-01-01T00:00:00Z' valid: true visual_block_enabled: true properties: partial: $ref: '#/components/schemas/Partial' required: - partial title: WrappedPartialResponse type: object x-struct: null x-validate: null WorkflowPushStep: description: A push step within a workflow. Read more in the [docs](https://docs.knock.app/designing-workflows/channel-step). example: channel_group_key: null channel_key: apns channel_overrides: null channel_type: push conditions: null description: This is a description of the channel step name: Push channel step ref: channel_step send_windows: null template: settings: delivery_type: content payload_overrides: '{"name": "John"}' text_body: Hello, world! title: Hello, world! type: channel properties: channel_group_key: description: The 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. example: email nullable: true type: string x-struct: null x-validate: null channel_key: description: The 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. example: postmark nullable: true type: string x-struct: null x-validate: null channel_overrides: anyOf: - $ref: '#/components/schemas/PushChannelSettings' - nullable: true x-struct: null x-validate: null description: A map of channel overrides for the channel step. type: object x-struct: null x-validate: null channel_type: description: The type of the channel step. Always `push` for push steps. enum: - push example: push type: string x-struct: null x-validate: null conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A set of conditions to be evaluated for this channel step. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Send a message to the channel nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Channel nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: channel_step type: string x-struct: null x-validate: null send_windows: description: A list of send window objects. Must include one send window object per day of the week. items: $ref: '#/components/schemas/SendWindow' nullable: true type: array x-struct: null x-validate: null template: $ref: '#/components/schemas/PushTemplate' type: description: The type of the workflow step. enum: - channel example: channel type: string x-struct: null x-validate: null required: - type - ref - template title: WorkflowPushStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowPushStep x-validate: null BroadcastSendRequest: description: A request to send or schedule a broadcast. example: send_at: '2024-03-20T10:00:00Z' properties: send_at: description: When 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. example: '2024-03-20T10:00:00Z' format: date-time type: string x-struct: null x-validate: null title: BroadcastSendRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.BroadcastSendRequest x-validate: null WrappedPartialRequestRequest: description: Wraps the PartialRequest request under the partial key. example: partial: content:Hello, world!
description: This is a test partial input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text name: My Partial type: html visual_block_enabled: true properties: partial: $ref: '#/components/schemas/PartialRequest' required: - partial title: WrappedPartialRequestRequest type: object x-struct: null x-validate: null PaginatedBroadcastResponse: description: A paginated list of Broadcast. Contains a list of entries and page information. example: entries: - categories: - marketing - promotions created_at: '2022-12-16T19:07:50.027113Z' description: Holiday promotion broadcast for December environment: development key: december-promotion name: December Promotion scheduled_at: null sent_at: null settings: is_commercial: true override_preferences: false sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y status: draft steps: - channel_key: in-app-feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: premium-users updated_at: '2023-02-08T22:15:19.846681Z' valid: true page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Broadcast' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedBroadcastResponse type: object x-struct: null x-validate: null MessageTypeMultiSelectField: description: A multi-select field used in a message type. example: key: multi_select_field label: Multi-Select Field settings: default: - option1 - option3 description: A description of the multi-select field options: - label: Option 1 value: option1 - label: Option 2 value: option2 - label: Option 3 value: option3 required: true type: multi_select properties: key: description: The unique key of the field. example: key type: string x-struct: null x-validate: null label: description: The label of the field. example: Label nullable: true type: string x-struct: null x-validate: null settings: description: Settings for the multi_select field. properties: default: description: The default values for the multi-select field. example: - option1 - option3 items: type: string x-struct: null x-validate: null nullable: true type: array x-struct: null x-validate: null description: example: A description of the field, used in the UI as a hint text. nullable: true type: string x-struct: null x-validate: null options: description: The available options for the multi-select field. items: properties: label: description: The display label for the option. example: Option 1 type: string x-struct: null x-validate: null value: description: The value for the option. example: option1 type: string x-struct: null x-validate: null required: - value type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null placeholder: example: A placeholder for the field. nullable: true type: string x-struct: null x-validate: null required: description: Whether the field is required. example: true type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the field. enum: - multi_select example: multi_select type: string x-struct: null x-validate: null required: - type - key - label - settings title: MessageTypeMultiSelectField type: object x-struct: Elixir.ControlWeb.V1.Specs.MessageTypes.MultiSelectField x-validate: null MessageTypeBooleanField: description: A boolean field used in a message type. example: key: boolean_field label: Boolean Field settings: default: false description: A description of the boolean field required: true type: boolean properties: key: description: The unique key of the field. example: key type: string x-struct: null x-validate: null label: description: The label of the field. example: Label nullable: true type: string x-struct: null x-validate: null settings: description: Settings for the boolean field. properties: default: description: The default value of the boolean field. example: true type: boolean x-struct: null x-validate: null description: example: A description of the field, used in the UI as a hint text. nullable: true type: string x-struct: null x-validate: null placeholder: example: A placeholder for the field. nullable: true type: string x-struct: null x-validate: null required: description: Whether the field is required. example: true type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the field. enum: - boolean example: boolean type: string x-struct: null x-validate: null required: - type - key - label title: MessageTypeBooleanField type: object x-struct: Elixir.ControlWeb.V1.Specs.MessageTypes.BooleanField x-validate: null Translation: description: A translation object. example: content: '{"hello":"Hello, world!"}' format: json inserted_at: '2021-01-01T00:00:00Z' locale_code: en namespace: my_app updated_at: '2021-01-01T00:00:00Z' properties: content: description: A JSON encoded string containing the key-value pairs of translation references and translation strings. type: string x-struct: null x-validate: null format: description: Indicates whether content is a JSON encoded object string or a string in the PO format. enum: - json - po type: string x-struct: null x-validate: null inserted_at: description: The timestamp of when the translation was created. format: date-time type: string x-struct: null x-validate: null locale_code: description: The locale code for the translation object. type: string x-struct: null x-validate: null namespace: description: An optional namespace for the translation to help categorize your translations. type: string x-struct: null x-validate: null tenant: description: An optional tenant identifier to scope the translation to a specific tenant. type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the translation was last updated. format: date-time type: string x-struct: null x-validate: null required: - locale_code - namespace - content - format - inserted_at - updated_at title: Translation type: object x-struct: Elixir.ControlWeb.V1.Specs.Translation x-validate: null Commit: description: A commit is a change to a resource within an environment, made by an author. example: author: email: john.doe@example.com name: John Doe commit_message: This is a commit message created_at: '2021-01-01T00:00:00Z' environment: development id: 123e4567-e89b-12d3-a456-426614174000 resource: identifier: my-email-layout type: email_layout properties: author: description: The author of the commit. example: email: john.doe@example.com name: John Doe properties: email: description: The email address of the commit author. type: string x-struct: null x-validate: null name: description: The name of the commit author. nullable: true type: string x-struct: null x-validate: null required: - email title: CommitAuthor type: object x-struct: null x-validate: null commit_message: description: The optional message about the commit. type: string x-struct: null x-validate: null created_at: description: The timestamp of when the commit was created. format: date-time type: string x-struct: null x-validate: null environment: description: The environment of the commit. example: development type: string x-struct: null x-validate: null id: description: The unique identifier for the commit. format: uuid type: string x-struct: null x-validate: null resource: description: The resource object associated with the commit. example: identifier: my-email-layout type: email_layout properties: identifier: description: The unique identifier for the resource. type: string x-struct: null x-validate: null type: description: The type of the resource object. enum: - audience - email_layout - guide - message_type - partial - translation - workflow example: workflow type: string x-struct: null x-validate: null required: - identifier - type title: CommitResource type: object x-struct: null x-validate: null required: - id - resource - author - environment - created_at title: Commit type: object x-struct: Elixir.ControlWeb.V1.Specs.Commit x-validate: null MessageTypeRequest: description: A request to create a message type. example: description: This is a message type name: My Message Type preview:Hello, world!
description: This is a test partial input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text name: My Partial type: html visual_block_enabled: true properties: content: description: The partial content. type: string x-struct: null x-validate: null description: description: An arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed. type: string x-struct: null x-validate: null icon_name: description: The name of the icon to be used in the visual editor. type: string x-struct: null x-validate: null input_schema: description: The field types available for the partial. items: anyOf: - $ref: '#/components/schemas/MessageTypeBooleanField' - $ref: '#/components/schemas/MessageTypeButtonField' - $ref: '#/components/schemas/MessageTypeImageField' - $ref: '#/components/schemas/MessageTypeJsonField' - $ref: '#/components/schemas/MessageTypeMarkdownField' - $ref: '#/components/schemas/MessageTypeMultiSelectField' - $ref: '#/components/schemas/MessageTypeSelectField' - $ref: '#/components/schemas/MessageTypeTextField' - $ref: '#/components/schemas/MessageTypeTextareaField' - $ref: '#/components/schemas/MessageTypeUrlField' type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null name: description: A name for the partial. Must be at maximum 255 characters in length. type: string x-struct: null x-validate: null type: description: The partial type. One of 'html', 'json', 'markdown', 'text'. enum: - html - text - json - markdown type: string x-struct: null x-validate: null visual_block_enabled: description: Indicates whether the partial can be used in the visual editor. Only applies to HTML partials. type: boolean x-struct: null x-validate: null required: - type - name - content title: PartialRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.PartialRequest x-validate: null ConditionGroup: anyOf: - $ref: '#/components/schemas/ConditionGroupAllMatch' - $ref: '#/components/schemas/ConditionGroupAnyMatch' description: A group of conditions to be evaluated. example: all: - argument: some_property operator: equal_to variable: recipient.property title: ConditionGroup type: object x-struct: Elixir.ControlWeb.V1.Specs.ConditionGroup x-validate: null MessageTypeJsonField: description: A JSON field used in a message type. example: key: json_field label: JSON Field settings: default: key: value description: A description of the JSON field placeholder: A placeholder for the JSON field required: true schema: properties: key: type: string required: - key type: json properties: key: description: The unique key of the field. example: key type: string x-struct: null x-validate: null label: description: The label of the field. example: Label nullable: true type: string x-struct: null x-validate: null settings: description: Settings for the json field. properties: default: description: The default value of the JSON field. example: key: value nullable: true type: object x-struct: null x-validate: null description: example: A description of the field, used in the UI as a hint text. nullable: true type: string x-struct: null x-validate: null placeholder: example: A placeholder for the field. nullable: true type: string x-struct: null x-validate: null required: description: Whether the field is required. example: true type: boolean x-struct: null x-validate: null schema: description: A JSON schema used to validate the structure of the JSON provided. Must be a valid JSON schema. example: properties: key: type: string nullable: true type: object x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the field. enum: - json example: json type: string x-struct: null x-validate: null required: - type - key - label title: MessageTypeJsonField type: object x-struct: Elixir.ControlWeb.V1.Specs.MessageTypes.JsonField x-validate: null BroadcastRequest: description: A broadcast request for upserting a broadcast. example: categories: - announcement description: A broadcast to all users name: My Broadcast settings: is_commercial: true override_preferences: false steps: - channel_key: in-app-feed name: Channel 1 ref: channel_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: all-users properties: categories: description: A list of categories that the broadcast belongs to. items: type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null description: description: An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed. type: string x-struct: null x-validate: null name: description: A name for the broadcast. Must be at maximum 255 characters in length. type: string x-struct: null x-validate: null scheduled_at: description: The timestamp of when the broadcast is scheduled to be sent. format: date-time nullable: true type: string x-struct: null x-validate: null settings: description: A map of broadcast settings. properties: is_commercial: description: Whether the broadcast is commercial. Defaults to true. example: true type: boolean x-struct: null x-validate: null override_preferences: description: Whether to ignore recipient preferences for a given type of notification. If true, will send for every channel in the workflow even if the recipient has opted out of a certain kind. Defaults to false. example: false type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null steps: description: A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps. items: anyOf: - $ref: '#/components/schemas/WorkflowWebhookStep' - $ref: '#/components/schemas/WorkflowInAppFeedStep' - $ref: '#/components/schemas/WorkflowChatStep' - $ref: '#/components/schemas/WorkflowSmsStep' - $ref: '#/components/schemas/WorkflowPushStep' - $ref: '#/components/schemas/WorkflowEmailStep' - $ref: '#/components/schemas/WorkflowBranchStep' - $ref: '#/components/schemas/WorkflowDelayStep' - $ref: '#/components/schemas/WorkflowRandomCohortStep' description: A step within a broadcast. Each step, regardless of its type, share a common set of core attributes (`type`, `ref`, `name`, `description`, `conditions`). type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null target_audience_key: description: The key of the audience to target for this broadcast. type: string x-struct: null x-validate: null required: - name - steps title: BroadcastRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.BroadcastRequest x-validate: null WrappedBroadcastResponse: description: Wraps the Broadcast response under the `broadcast` key. example: broadcast: categories: - marketing - promotions created_at: '2022-12-16T19:07:50.027113Z' description: Holiday promotion broadcast for December environment: development key: december-promotion name: December Promotion scheduled_at: null sent_at: null settings: is_commercial: true override_preferences: false sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y status: draft steps: - channel_key: in-app-feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: premium-users updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: broadcast: $ref: '#/components/schemas/Broadcast' required: - broadcast title: WrappedBroadcastResponse type: object x-struct: null x-validate: null StaticAudienceRequest: description: Request body for creating/updating a static audience. example: description: Manually managed list of beta testers name: Beta users type: static properties: description: description: A description of the audience. nullable: true type: string x-struct: null x-validate: null name: description: The name of the audience. type: string x-struct: null x-validate: null type: description: The type of audience. Set to `static` for static audiences. enum: - static type: string x-struct: null x-validate: null required: - type - name title: StaticAudienceRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.StaticAudienceRequest x-validate: null WrappedAudienceResponse: description: Wraps the Audience response under the `audience` key. example: audience: created_at: '2024-01-15T10:30:00Z' description: Customers who signed up in the last 30 days. environment: development key: new-customers name: New customers segments: - conditions: - argument: 30_days_ago operator: greater_than property: recipient.created_at sha: a1b2c3d4e5f6 type: dynamic updated_at: '2024-06-20T14:45:00Z' properties: audience: $ref: '#/components/schemas/Audience' required: - audience title: WrappedAudienceResponse type: object x-struct: null x-validate: null ArchiveGuideResponse: description: The response from archiving a guide. example: result: success properties: result: description: The result of the promote operation. example: success type: string x-struct: null x-validate: null required: - result title: ArchiveGuideResponse type: object x-struct: null x-validate: null WorkflowInAppFeedStep: description: An in-app feed step within a workflow. Read more in the [docs](https://docs.knock.app/designing-workflows/channel-step). example: channel_group_key: null channel_key: knock-in-app channel_overrides: null channel_type: in_app_feed conditions: null description: This is a description of the channel step name: In-app feed channel step ref: channel_step send_windows: null template: action_buttons: - action: https://example.com label: Button 1 action_url: https://example.com markdown_body: Hello, world! type: channel properties: channel_group_key: description: The 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. example: email nullable: true type: string x-struct: null x-validate: null channel_key: description: The 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. example: postmark nullable: true type: string x-struct: null x-validate: null channel_overrides: anyOf: - $ref: '#/components/schemas/InAppFeedChannelSettings' - nullable: true x-struct: null x-validate: null description: A map of channel overrides for the channel step. type: object x-struct: null x-validate: null channel_type: description: The type of the channel step. Always `in_app_feed` for in-app feed steps. enum: - in_app_feed example: in_app_feed type: string x-struct: null x-validate: null conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A set of conditions to be evaluated for this channel step. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Send a message to the channel nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Channel nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: channel_step type: string x-struct: null x-validate: null send_windows: description: A list of send window objects. Must include one send window object per day of the week. items: $ref: '#/components/schemas/SendWindow' nullable: true type: array x-struct: null x-validate: null template: $ref: '#/components/schemas/InAppFeedTemplate' type: description: The type of the workflow step. enum: - channel example: channel type: string x-struct: null x-validate: null required: - type - ref - template title: WorkflowInAppFeedStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowInAppFeedStep x-validate: null WorkflowRequest: description: A workflow request for upserting a workflow. example: name: My Workflow steps: - channel_key: in-app-feed name: Channel 1 ref: channel_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel properties: categories: description: A list of [categories](https://docs.knock.app/concepts/workflows#workflow-categories) that the workflow belongs to. items: type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A conditions object that describes one or more conditions to be met for the workflow to be executed. (optional). type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow object. Useful for adding notes about the workflow for internal purposes. Maximum of 280 characters allowed. type: string x-struct: null x-validate: null name: description: A name for the workflow. Must be at maximum 255 characters in length. type: string x-struct: null x-validate: null settings: description: A map of workflow settings. properties: is_commercial: description: Whether the workflow is commercial. Defaults to false. example: false type: boolean x-struct: null x-validate: null override_preferences: description: Whether to ignore recipient preferences for a given type of notification. If true, will send for every channel in the workflow even if the recipient has opted out of a certain kind. Defaults to false. example: false type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null steps: description: A list of workflow step objects in the workflow. items: $ref: '#/components/schemas/WorkflowStep' type: array x-struct: null x-validate: null trigger_data_json_schema: additionalProperties: true description: A 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). type: object x-struct: null x-validate: null trigger_frequency: description: 'The 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).' enum: - every_trigger - once_per_recipient - once_per_recipient_per_tenant example: every_trigger type: string x-struct: null x-validate: null required: - name - steps title: WorkflowRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowRequest x-validate: null EmailPartialBlock: description: A partial block in an email template, used to render a reusable partial component. example: attrs: foo: bar key: my_partial layout_attrs: padding_bottom: 8 padding_left: 4 padding_right: 4 padding_top: 8 name: my_partial type: partial properties: attrs: additionalProperties: true description: The attributes to pass to the partial block. type: object x-struct: null x-validate: null id: description: The ID of the block. example: 123e4567-e89b-12d3-a456-426614174000 format: uuid type: string x-struct: null x-validate: null key: description: The key of the partial block to invoke. type: string x-struct: null x-validate: null layout_attrs: description: The layout attributes of the block. properties: padding_bottom: description: The padding_bottom layout attribute of the block. type: integer x-struct: null x-validate: null padding_left: description: The padding_left layout attribute of the block. type: integer x-struct: null x-validate: null padding_right: description: The padding_right layout attribute of the block. type: integer x-struct: null x-validate: null padding_top: description: The padding_top layout attribute of the block. type: integer x-struct: null x-validate: null required: - padding_top - padding_right - padding_bottom - padding_left type: object x-struct: null x-validate: null name: description: The name of the partial block. type: string x-struct: null x-validate: null type: description: The type of the block. enum: - partial example: partial type: string x-struct: null x-validate: null version: description: The version of the block schema. This is automatically managed by Knock and should not be set manually. Currently all blocks are at version 1. example: 1 type: integer x-struct: null x-validate: null required: - type - name - key - attrs title: EmailPartialBlock type: object x-struct: Elixir.ControlWeb.V1.Specs.EmailBlocks.PartialBlock x-validate: null WrappedBroadcastRequestRequest: description: Wraps the BroadcastRequest request under the broadcast key. example: broadcast: categories: - announcement description: A broadcast to all users name: My Broadcast settings: is_commercial: true override_preferences: false steps: - channel_key: in-app-feed name: Channel 1 ref: channel_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: all-users properties: broadcast: $ref: '#/components/schemas/BroadcastRequest' required: - broadcast title: WrappedBroadcastRequestRequest type: object x-struct: null x-validate: null RecipientReference: description: A recipient reference, used when referencing a recipient by either their ID (for a user), or by a reference for an object. example: collection: projects id: project_1 oneOf: - description: A user ID. example: user_1 nullable: false title: UserRecipientReference type: string x-struct: null x-validate: null - description: An object reference. example: collection: projects id: project_1 properties: collection: description: The collection of the object. type: string x-struct: null x-validate: null id: description: The ID of the object. type: string x-struct: null x-validate: null required: - id - collection title: ObjectRecipientReference type: object x-struct: null x-validate: null title: RecipientReference type: object x-struct: Elixir.ControlWeb.V1.Specs.RecipientReference x-validate: null WrappedGuideResponse: description: Wraps the Guide response under the `guide` key. example: guide: activation_url_patterns: - directive: allow pathname: /dashboard/* active: true archived_at: null channel_key: in-app-guide created_at: '2024-01-01T00:00:00Z' description: A guide to help users get started with the application environment: development key: getting-started name: Getting Started Guide semver: 0.0.1 sha: '1234567890' steps: - name: Welcome to the App ref: welcome-step schema_key: tooltip schema_semver: 1.0.0 schema_variant_key: default values: text_field: value target_audience_id: null target_property_conditions: all: - argument: some_property operator: equal_to variable: recipient.property type: banner updated_at: '2024-01-01T00:00:00Z' valid: true properties: guide: $ref: '#/components/schemas/Guide' required: - guide title: WrappedGuideResponse type: object x-struct: null x-validate: null WorkflowEmailStep: description: An email step within a workflow. Read more in the [docs](https://docs.knock.app/designing-workflows/channel-step). example: channel_group_key: null channel_key: postmark channel_overrides: null channel_type: email conditions: null description: This is a description of the channel step name: Email channel step ref: channel_step send_windows: null template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }} text_body: 'Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here: {{ data.sign_in_url }}.' type: channel properties: channel_group_key: description: The 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. example: email nullable: true type: string x-struct: null x-validate: null channel_key: description: The 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. example: postmark nullable: true type: string x-struct: null x-validate: null channel_overrides: anyOf: - $ref: '#/components/schemas/EmailChannelSettings' - nullable: true x-struct: null x-validate: null description: A map of channel overrides for the channel step. type: object x-struct: null x-validate: null channel_type: description: The 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. enum: - email example: email type: string x-struct: null x-validate: null conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A set of conditions to be evaluated for this channel step. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Send a message to the channel nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Channel nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: channel_step type: string x-struct: null x-validate: null send_windows: description: A list of send window objects. Must include one send window object per day of the week. items: $ref: '#/components/schemas/SendWindow' nullable: true type: array x-struct: null x-validate: null template: $ref: '#/components/schemas/EmailTemplate' type: description: The type of the workflow step. enum: - channel example: channel type: string x-struct: null x-validate: null required: - type - ref - template title: WorkflowEmailStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowEmailStep x-validate: null EmailVisualBlocks: description: The visual blocks that make up the email template. example: - content: '# Hello, {{ recipient.name }}! Welcome to **{{ vars.app_name }}**. [Get started here]({{ data.sign_in_url }}).' type: markdown - content:Hello, {{ recipient.name }}!
Welcome to {{ vars.app_name }}. Get started here.
type: html - type: divider - attrs: foo: bar key: my-partial name: My partial type: partial - type: image url: https://example.com/image.png - buttons: - action: https://example.com/button-action label: Click me type: button variant: solid type: button_set items: anyOf: - $ref: '#/components/schemas/EmailButtonSetBlock' - $ref: '#/components/schemas/EmailDividerBlock' - $ref: '#/components/schemas/EmailHtmlBlock' - $ref: '#/components/schemas/EmailImageBlock' - $ref: '#/components/schemas/EmailMarkdownBlock' - $ref: '#/components/schemas/EmailPartialBlock' type: object x-struct: null x-validate: null title: EmailVisualBlocks type: array x-struct: Elixir.ControlWeb.V1.Specs.EmailTemplate.EmailVisualBlocks x-validate: null ConditionGroupAnyMatch: description: A group of conditions that any must be met. Can contain nested alls. example: any: - all: - argument: some_property operator: equal_to variable: recipient.property properties: any: description: An array of conditions or nested condition groups to evaluate. items: anyOf: - $ref: '#/components/schemas/Condition' - $ref: '#/components/schemas/ConditionGroupAllMatch' type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null title: ConditionGroupAnyMatch type: object x-struct: Elixir.ControlWeb.V1.Specs.ConditionGroup.ConditionGroupAnyMatch x-validate: null MessageTypeTextField: description: A text field used in a message type. example: key: text_field label: Text Field settings: description: A description of the text field max_length: 100 min_length: 10 placeholder: A placeholder for the text field required: true type: text properties: key: description: The unique key of the field. example: key type: string x-struct: null x-validate: null label: description: The label of the field. example: Label nullable: true type: string x-struct: null x-validate: null settings: description: Settings for the text field. properties: default: description: The default value of the text field. example: A placeholder nullable: true type: string x-struct: null x-validate: null description: example: A description of the field, used in the UI as a hint text. nullable: true type: string x-struct: null x-validate: null max_length: example: 100 type: integer x-struct: null x-validate: null min_length: example: 10 type: integer x-struct: null x-validate: null placeholder: example: A placeholder for the field. nullable: true type: string x-struct: null x-validate: null required: description: Whether the field is required. example: true type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the field. enum: - text example: text type: string x-struct: null x-validate: null required: - type - key - label title: MessageTypeTextField type: object x-struct: Elixir.ControlWeb.V1.Specs.MessageTypes.TextField x-validate: null GuideBooleanActivationParams: description: A request to activate or deactivate a guide. example: status: true properties: status: description: Whether to activate or deactivate the guide. example: true type: boolean x-struct: null x-validate: null required: - status title: GuideBooleanActivationParams type: object x-struct: null x-validate: null EmailTemplate: description: An email message template. example: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }} text_body: 'Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here: {{ data.sign_in_url }}.' properties: html_body: description: An HTML or MJML template for the email body. **Required** if `visual_blocks` is not provided. Only one of `html_body` or `visual_blocks` should be set. When `is_mjml` is true, this must contain MJML components. 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. example:Hello, world!
nullable: true type: string x-struct: null x-validate: null is_mjml: description: Whether this template uses MJML format. When true, the template content will be compiled from MJML to HTML. Only valid when the selected layout is also MJML or when no layout is selected. nullable: true type: boolean x-struct: null x-validate: null settings: description: The [settings](https://docs.knock.app/integrations/email/settings) for the email template. Must be supplied with at least `layout_key`. example: layout_key: default properties: attachment_key: description: The object path in the workflow trigger's `data` payload to resolve attachments.Defaults to `attachments`. example: attachments nullable: true type: string x-struct: null x-validate: null layout_key: description: The `key` of the [email layout](https://docs.knock.app/integrations/email/layouts) that wraps the email template. When omitted, the email template will need to define the `` structure. example: default nullable: true type: string x-struct: null x-validate: null pre_content: description: A liquid template that will be injected into the email layout above the message template content. Useful for setting variables that should be available to the email layout. nullable: true type: string x-struct: null x-validate: null title: EmailTemplateSettings type: object x-struct: null x-validate: null subject: description: The 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. example: Hello, world! type: string x-struct: null x-validate: null text_body: description: A text template for the email body. When omitted, the email template will be autogenerated from the `html_body` or `visual_blocks`. example: Hello, world! nullable: true type: string x-struct: null x-validate: null visual_blocks: anyOf: - $ref: '#/components/schemas/EmailVisualBlocks' - nullable: true x-struct: null x-validate: null description: The 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. type: object x-struct: null x-validate: null required: - subject - settings title: EmailTemplate type: object x-struct: Elixir.ControlWeb.V1.Specs.EmailTemplate x-validate: null WrappedMessageTypeResponse: description: Wraps the MessageType response under the `message_type` key. example: message_type: archived_at: null created_at: '2021-01-01T00:00:00Z' deleted_at: null description: Email message type environment: development icon_name: email key: email name: Email owner: user preview:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }}! type: channel trigger_data_json_schema: properties: onboarding_url: type: string required: - onboarding_url type: object trigger_frequency: every_trigger updated_at: '2023-02-08T22:15:19.846681Z' valid: true page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Workflow' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedWorkflowResponse type: object x-struct: null x-validate: null AudienceCondition: description: A condition to evaluate for audience membership. example: argument: premium operator: equal_to property: recipient.plan properties: argument: description: The argument to compare against. Can be a static value (string, number, boolean) or a dynamic path expression. example: premium nullable: true type: string x-struct: null x-validate: null operator: description: The operator to use when evaluating the condition. enum: - 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_on_or_after - is_timestamp_between - is_between - empty - not_empty - exists - not_exists - is_timestamp - is_audience_member - is_not_audience_member example: equal_to type: string x-struct: null x-validate: null property: description: The property to be evaluated. Properties are dynamic values using path expressions like `recipient.plan` or `recipient.created_at`. example: recipient.plan type: string x-struct: null x-validate: null required: - property - operator title: AudienceCondition type: object x-struct: Elixir.ControlWeb.V1.Specs.AudienceCondition x-validate: null WorkflowRandomCohortStep: description: An experiment step. Deterministically assigns recipients to percentage-based cohorts for A/B testing and experimentation. example: cohort_branches: - name: Control percentage: '50' steps: [] terminates: false - name: Variant percentage: '50' steps: [] terminates: false description: Experiment step description. name: Experiment ref: experiment_1 type: random_cohort properties: cohort_branches: description: A list of cohort branches. Must have between 2 and 10 branches, and percentages must sum to 100. items: $ref: '#/components/schemas/WorkflowRandomCohortStepBranch' type: array x-struct: null x-validate: null cohort_key: description: The key used to deterministically assign recipients to cohorts. Defaults to the recipient ID if not provided. example: tenant.id nullable: true type: string x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Experiment step description. nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Experiment nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: experiment_1 type: string x-struct: null x-validate: null type: description: The type of step. enum: - random_cohort example: random_cohort type: string x-struct: null x-validate: null required: - type - ref - cohort_branches title: WorkflowRandomCohortStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowRandomCohortStep x-validate: null WorkflowThrottleStep: description: A throttle function step. Read more in the [docs](https://docs.knock.app/designing-workflows/throttle-function). example: name: Throttle step ref: throttle_step settings: throttle_key: data.project_id throttle_limit: 1 throttle_window: unit: minutes value: 10 type: throttle properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A conditions object that describes one or more conditions to be met in order for the step to be executed. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Throttle step description nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Throttle step nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: throttle_step type: string x-struct: null x-validate: null settings: description: The settings for the throttle step. properties: throttle_key: description: The data property to use to throttle notifications per recipient. example: data.project_id nullable: true type: string x-struct: null x-validate: null throttle_limit: description: The maximum number of workflows to allow within the duration window. Defaults to 1. example: 1 nullable: true type: integer x-struct: null x-validate: null throttle_window: anyOf: - $ref: '#/components/schemas/Duration' - nullable: true x-struct: null x-validate: null description: The duration of the throttle window. nullable: true type: object x-struct: null x-validate: null throttle_window_field_path: description: The data path to resolve a dynamic throttle window. The resolved value must be an ISO-8601 timestamp. See more in the [docs](https://docs.knock.app/designing-workflows/throttle-function#set-a-dynamic-throttle-window). example: recipient.throttle_window nullable: true type: string x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - throttle example: throttle type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowThrottleStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowThrottleStep x-validate: null WorkflowBatchStep: description: A batch function step. Read more in the [docs](https://docs.knock.app/designing-workflows/batch-function). example: description: Batch step description name: Batch step ref: batch_step settings: batch_key: data.project_id batch_window: unit: minutes value: 10 type: batch properties: description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Batch step description nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Batch step nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: batch_step type: string x-struct: null x-validate: null settings: description: The settings for the batch step. properties: batch_execution_mode: description: 'The execution mode of the batch step. One of: `accumulate` or `flush_leading`. When set to `flush_leading`, the first item in the batch will be executed immediately, and the rest will be batched. See [these docs](https://docs.knock.app/designing-workflows/batch-function#immediately-flushing-the-first-item-in-a-batch) for more information.' enum: - accumulate - flush_leading example: accumulate nullable: true type: string x-struct: null x-validate: null batch_items_max_limit: description: 'The maximum number of batch items allowed in a batch. Between: 2 and 1000.' example: 1000 nullable: true type: integer x-struct: null x-validate: null batch_items_render_limit: description: 'The maximum number of batch items allowed to be rendered into a template. Between: 1 and 100. Defaults to 10.' example: 10 nullable: true type: integer x-struct: null x-validate: null batch_key: description: The data property to use to batch notifications per recipient. example: data.project_id nullable: true type: string x-struct: null x-validate: null batch_order: description: 'The order describing whether to return the first or last ten batch items in the activities variable. One of: `asc` or `desc`.' enum: - asc - desc example: asc nullable: true type: string x-struct: null x-validate: null batch_until_field_path: description: The data path to resolve the batch window. The resolved value must be an ISO-8601 timestamp. example: recipient.batch_until nullable: true type: string x-struct: null x-validate: null batch_window: anyOf: - $ref: '#/components/schemas/Duration' - nullable: true x-struct: null x-validate: null description: The window of time to collect events in the batch. type: object x-struct: null x-validate: null batch_window_extension_limit: anyOf: - $ref: '#/components/schemas/Duration' - nullable: true x-struct: null x-validate: null description: A duration object that describes the maximum duration a batch window can be extended to from opening when using a [sliding batch window](https://docs.knock.app/designing-workflows/batch-function#using-a-sliding-batch-window). type: object x-struct: null x-validate: null batch_window_type: description: 'The type of the batch window used. One of: `fixed` or `sliding`.' enum: - fixed - sliding example: fixed nullable: true type: string x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - batch example: batch type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowBatchStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowBatchStep x-validate: null Environment: description: An environment object. example: created_at: '2022-10-31T19:59:03Z' deleted_at: null hide_pii_data: false label_color: '#000000' last_commit_at: '2022-10-31T19:59:03Z' name: Development order: 0 owner: system slug: development updated_at: '2022-10-31T19:59:03Z' properties: created_at: description: The timestamp of when the environment was created. format: date-time type: string x-struct: null x-validate: null deleted_at: description: The timestamp of when the environment was deleted. format: date-time nullable: true type: string x-struct: null x-validate: null hide_pii_data: default: false description: Whether PII data is hidden from the environment. Read more in the [data obfuscation docs](https://docs.knock.app/manage-your-account/data-obfuscation). type: boolean x-struct: null x-validate: null label_color: description: The color of the environment label to display in the dashboard. nullable: true type: string x-struct: null x-validate: null last_commit_at: description: The timestamp of the most-recent commit in the environment. format: date-time nullable: true type: string x-struct: null x-validate: null name: description: A human-readable name for the environment. Cannot exceed 255 characters. type: string x-struct: null x-validate: null order: description: The 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. type: integer x-struct: null x-validate: null owner: description: The owner of the environment. enum: - system - user example: user type: string x-struct: null x-validate: null slug: description: A unique slug for the environment. Cannot exceed 255 characters. type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the environment was last updated. format: date-time type: string x-struct: null x-validate: null required: - name - slug - order - created_at - updated_at - owner title: Environment type: object x-struct: Elixir.ControlWeb.V1.Specs.Environment x-validate: null WhoamiResponse: description: Information about the current calling scope. example: account_features: batch_items_render_limit_allowed: false custom_branding_allowed: false data_retention_days: 30 data_warehouse_extension_allowed: false datadog_extension_allowed: true dsync_allowed: false guides_monthly_notified_recipients_limit: 500 guides_per_tenant_scope_allowed: false heap_extension_allowed: false knock_branding_required: true litmus_email_preview_allowed: false message_sent_limit: 10000 new_relic_extension_allowed: false segment_extension_allowed: false self_serve_allowed: true sso_allowed: false tenant_preferences_allowed: false translations_allowed: false account_name: Acme, Inc. account_slug: acme service_token_name: My Service Token type: service_token user_id: null properties: account_features: description: Account plan features and limits. properties: batch_items_render_limit_allowed: description: Whether batch rendering limits can be configured. type: boolean x-struct: null x-validate: null custom_branding_allowed: description: Whether custom branding can be applied to notifications. type: boolean x-struct: null x-validate: null data_retention_days: description: Number of days data is retained, null for unlimited retention. nullable: true type: integer x-struct: null x-validate: null data_warehouse_extension_allowed: description: Whether data warehouse integration extensions are available. type: boolean x-struct: null x-validate: null datadog_extension_allowed: description: Whether Datadog integration extension is available. type: boolean x-struct: null x-validate: null dsync_allowed: description: Whether directory sync functionality is available. type: boolean x-struct: null x-validate: null guides_monthly_notified_recipients_limit: description: Monthly limit for guide notification recipients, null for unlimited. nullable: true type: integer x-struct: null x-validate: null guides_per_tenant_scope_allowed: description: Whether per-tenant scope for guide messages is allowed. type: boolean x-struct: null x-validate: null heap_extension_allowed: description: Whether Heap integration extension is available. type: boolean x-struct: null x-validate: null knock_branding_required: description: Whether Knock branding is required to be displayed. type: boolean x-struct: null x-validate: null litmus_email_preview_allowed: description: Whether Litmus email preview integration is available. type: boolean x-struct: null x-validate: null message_sent_limit: description: Monthly limit for messages sent, null for unlimited. nullable: true type: integer x-struct: null x-validate: null new_relic_extension_allowed: description: Whether New Relic integration extension is available. type: boolean x-struct: null x-validate: null segment_extension_allowed: description: Whether Segment integration extension is available. type: boolean x-struct: null x-validate: null self_serve_allowed: description: Whether self-service account management features are available. type: boolean x-struct: null x-validate: null sso_allowed: description: Whether single sign-on (SSO) is enabled for the account. type: boolean x-struct: null x-validate: null tenant_preferences_allowed: description: Whether tenant-level preferences are supported. type: boolean x-struct: null x-validate: null translations_allowed: description: Whether multi-language translations are supported. type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null account_name: description: The display name of the account. type: string x-struct: null x-validate: null account_slug: description: The unique slug identifier for the account. type: string x-struct: null x-validate: null service_token_name: description: The name of the service token if authenticated via service token, null for OAuth contexts. nullable: true type: string x-struct: null x-validate: null type: description: The type of authentication context - either a service token or OAuth user context. enum: - service_token - oauth_context type: string x-struct: null x-validate: null user_id: description: The ID of the authenticated user if in OAuth context, null for service token contexts. nullable: true type: string x-struct: null x-validate: null required: - account_name - account_slug - type - account_features title: WhoamiResponse type: object x-struct: Elixir.ControlWeb.V1.Specs.WhoamiResponse x-validate: null ChannelGroupRequest: description: A request to create or update a channel group. example: channel_rules: - channel_key: push-fcm index: 0 rule_type: always channel_type: push name: Push Notification Group operator: any properties: channel_rules: description: Rules for determining which channels should be used. items: $ref: '#/components/schemas/ChannelGroupRuleRequest' type: array x-struct: null x-validate: null channel_type: description: The type of channels contained in this group. enum: - email - in_app - in_app_feed - in_app_guide - sms - push - chat - http type: string x-struct: null x-validate: null name: description: The human-readable name of the channel group. type: string x-struct: null x-validate: null operator: description: Determines how the channel rules are applied ('any' means any rule can match, 'all' means all rules must match). enum: - any - all type: string x-struct: null x-validate: null required: - name - channel_type title: ChannelGroupRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.ChannelGroupRequest x-validate: null MessageTypeUrlField: description: A URL field used in a message type. example: key: url_field label: URL Field settings: description: A description of the URL field placeholder: A placeholder for the URL field required: true type: url properties: key: description: The unique key of the field. example: key type: string x-struct: null x-validate: null label: description: The label of the field. example: Label nullable: true type: string x-struct: null x-validate: null settings: description: Settings for the url field. properties: default: description: The default value of the URL field. example: https://example.com nullable: true type: string x-struct: null x-validate: null description: example: A description of the field, used in the UI as a hint text. nullable: true type: string x-struct: null x-validate: null placeholder: example: A placeholder for the field. nullable: true type: string x-struct: null x-validate: null required: description: Whether the field is required. example: true type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the field. enum: - url example: url type: string x-struct: null x-validate: null required: - type - key - label title: MessageTypeUrlField type: object x-struct: Elixir.ControlWeb.V1.Specs.MessageTypes.UrlField x-validate: null PushChannelSettings: description: Push channel settings. Only used as configuration as part of a workflow channel step. example: token_deregistration: true properties: token_deregistration: description: Whether to deregister a push-token when a push send hard bounces. This is to prevent the same token from being used for future pushes. example: true type: boolean x-struct: null x-validate: null title: PushChannelSettings type: object x-struct: Elixir.ControlWeb.V1.Specs.PushChannelSettings x-validate: null WrappedAudienceRequestRequest: description: Wraps the AudienceRequest request under the audience key. example: audience: description: Users on the premium plan name: Premium users segments: - conditions: - argument: premium operator: equal_to property: recipient.plan type: dynamic properties: audience: $ref: '#/components/schemas/AudienceRequest' required: - audience title: WrappedAudienceRequestRequest type: object x-struct: null x-validate: null WrappedCommitResponse: description: Wraps the Commit response under the `commit` key. example: commit: author: email: john.doe@example.com name: John Doe commit_message: This is a commit message created_at: '2021-01-01T00:00:00Z' environment: development id: 123e4567-e89b-12d3-a456-426614174000 resource: identifier: my-email-layout type: email_layout properties: commit: $ref: '#/components/schemas/Commit' required: - commit title: WrappedCommitResponse type: object x-struct: null x-validate: null WrappedEmailLayoutResponse: description: Wraps the EmailLayout response under the `email_layout` key. example: email_layout: created_at: '2021-01-01T00:00:00Z' environment: development footer_links: - text: Example url: http://example.com html_layout: Hello, world! key: transactional name: Transactional sha: '1234567890' text_layout: Hello, world! updated_at: '2021-01-01T00:00:00Z' properties: email_layout: $ref: '#/components/schemas/EmailLayout' required: - email_layout title: WrappedEmailLayoutResponse type: object x-struct: null x-validate: null RequestTemplateHeadersArray: description: A list of key-value pairs for the request headers. Each object should contain key and value fields with string values. example: - key: X-API-Key value: '1234567890' items: properties: key: description: The key of the header. example: X-API-Key type: string x-struct: null x-validate: null value: description: The value of the header. example: '1234567890' type: string x-struct: null x-validate: null required: - key - value type: object x-struct: null x-validate: null title: RequestTemplateHeadersArray type: array x-struct: null x-validate: null GuideActivationUrlPattern: description: A rule that controls when a guide should be shown based on the user's location in the application. At least one of `pathname` or `search` must be provided. example: directive: allow pathname: /dashboard/* search: tab=settings properties: directive: default: allow description: Whether to allow or block the guide at the specified location. enum: - allow - block type: string x-struct: null x-validate: null pathname: description: The URL pathname pattern to match against. Must be a valid URI path. example: /dashboard/* type: string x-struct: null x-validate: null search: description: The URL query string pattern to match against (without the leading '?'). Supports URLPattern API syntax. example: tab=settings&* type: string x-struct: null x-validate: null required: - directive title: GuideActivationUrlPattern type: object x-struct: Elixir.ControlWeb.V1.Specs.GuideActivationUrlPattern x-validate: null WrappedTranslationRequestRequest: description: Wraps the TranslationRequest request under the translation key. example: translation: content: '{"hello":"Hello, world!"}' format: json properties: translation: $ref: '#/components/schemas/TranslationRequest' required: - translation title: WrappedTranslationRequestRequest type: object x-struct: null x-validate: null InAppFeedChannelSettings: description: In-app feed channel settings. Only used as configuration as part of a workflow channel step. example: link_tracking: true properties: link_tracking: description: Whether to track link clicks on in-app feed notifications. example: true type: boolean x-struct: null x-validate: null title: InAppFeedChannelSettings type: object x-struct: Elixir.ControlWeb.V1.Specs.InAppFeedChannelSettings x-validate: null Duration: description: A duration of time, represented as a unit and a value. example: unit: minutes value: 10 properties: unit: description: The unit of time. enum: - minutes - hours - days - weeks - months example: minutes type: string x-struct: null x-validate: null value: description: The value of the duration. example: 10 type: integer x-struct: null x-validate: null required: - unit - value title: Duration type: object x-struct: Elixir.ControlWeb.V1.Specs.Duration x-validate: null Channel: description: A configured channel, which is a way to route messages to a provider. example: archived_at: null created_at: '2021-01-01T00:00:00Z' custom_icon_url: null id: 01234567-89ab-cdef-0123-456789abcdef key: my-sendgrid-channel name: My Sendgrid Channel provider: sendgrid type: email updated_at: '2021-01-01T00:00:00Z' properties: archived_at: description: The timestamp of when the channel was deleted. format: date-time nullable: true type: string x-struct: null x-validate: null created_at: description: The timestamp of when the channel was created. format: date-time type: string x-struct: null x-validate: null custom_icon_url: description: Optional URL to a custom icon for the channel. Only used for display purposes in the dashboard. nullable: true type: string x-struct: null x-validate: null description: description: Optional description of the channel's purpose or usage. nullable: true type: string x-struct: null x-validate: null environment_settings: additionalProperties: $ref: '#/components/schemas/ChannelEnvironmentSettings' description: Per-environment settings for this channel, keyed by environment slug (e.g., 'development', 'production'). Only included when requested via the `include` parameter or when retrieving a single channel. nullable: true type: object x-struct: null x-validate: null id: description: The unique identifier for the channel. type: string x-struct: null x-validate: null key: description: Unique identifier for the channel within a project (immutable once created). type: string x-struct: null x-validate: null name: description: The human-readable name of the channel. type: string x-struct: null x-validate: null provider: description: The 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). type: string x-struct: null x-validate: null type: description: The type of channel, determining what kind of messages it can send. enum: - email - in_app - in_app_feed - in_app_guide - sms - push - chat - http type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the channel was last updated. format: date-time type: string x-struct: null x-validate: null required: - id - name - key - type - provider - created_at - updated_at title: Channel type: object x-struct: Elixir.ControlWeb.V1.Specs.Channel x-validate: null RunWorkflowRequest: description: A request to run (test) a workflow. example: data: park_id: 1 recipients: - dnedry properties: actor: anyOf: - $ref: '#/components/schemas/RecipientReference' - nullable: true x-struct: null x-validate: null description: The actor to reference in the the workflow run. type: object x-struct: null x-validate: null cancellation_key: description: A key to cancel the workflow run. nullable: true type: string x-struct: null x-validate: null data: additionalProperties: true description: A 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). type: object x-struct: null x-validate: null recipients: description: A list of recipients to run the workflow for. items: $ref: '#/components/schemas/RecipientReference' type: array x-struct: null x-validate: null tenant: description: The tenant to associate the workflow run with. Must not contain whitespace. type: string x-struct: null x-validate: null required: - recipients title: RunWorkflowRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.RunWorkflowRequest x-validate: null PaginatedChannelGroupResponse: description: A paginated list of ChannelGroup. Contains a list of entries and page information. example: entries: - channel_rules: - channel: archived_at: null created_at: '2021-01-01T00:00:00Z' custom_icon_url: null id: 01234567-89ab-cdef-0123-456789abcdef key: my-sendgrid-channel name: My Sendgrid Channel provider: sendgrid type: email updated_at: '2021-01-01T00:00:00Z' created_at: '2021-01-01T00:00:00Z' index: 0 rule_type: always updated_at: '2021-01-01T00:00:00Z' channel_type: push created_at: '2021-01-01T00:00:00Z' key: push-group name: Push Notification Group operator: any source: user updated_at: '2021-01-01T00:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/ChannelGroup' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedChannelGroupResponse type: object x-struct: null x-validate: null Member: description: A member of the account. example: created_at: '2024-01-15T10:30:00Z' id: d4b8e8e0-1234-5678-9abc-def012345678 role: admin updated_at: '2024-06-20T14:45:00Z' user: avatar_url: https://www.gravatar.com/avatar/abc123 created_at: '2024-01-10T08:00:00Z' email: jane@example.com id: a1b2c3d4-5678-9abc-def0-123456789abc name: Jane Doe updated_at: '2024-06-18T12:00:00Z' properties: created_at: description: The timestamp of when the member joined the account. format: date-time type: string x-struct: null x-validate: null id: description: The unique identifier of the member. format: uuid type: string x-struct: null x-validate: null role: description: The member's role in the account. enum: - owner - admin - member - production_only_member - billing - support type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the member was last updated. format: date-time type: string x-struct: null x-validate: null user: $ref: '#/components/schemas/MemberUser' required: - id - role - user - created_at - updated_at title: Member type: object x-struct: Elixir.ControlWeb.V1.Specs.Member x-validate: null ObjectRecipientReference: description: An object reference. example: collection: projects id: project_1 properties: collection: description: The collection of the object. type: string x-struct: null x-validate: null id: description: The ID of the object. type: string x-struct: null x-validate: null required: - id - collection title: ObjectRecipientReference type: object x-struct: null x-validate: null StaticAudience: description: A static audience where members are explicitly added or removed via the API. example: created_at: '2024-01-15T10:30:00Z' description: Users participating in the beta program. environment: development key: beta-testers name: Beta testers sha: a1b2c3d4e5f6 type: static updated_at: '2024-06-20T14:45:00Z' properties: created_at: description: The timestamp of when the audience was created. format: date-time type: string x-struct: null x-validate: null description: description: A description of the audience. nullable: true type: string x-struct: null x-validate: null environment: description: The slug of the environment in which the audience exists. type: string x-struct: null x-validate: null key: description: The unique key of the audience. type: string x-struct: null x-validate: null name: description: The name of the audience. type: string x-struct: null x-validate: null sha: description: The SHA hash of the audience data. nullable: true type: string x-struct: null x-validate: null type: description: The type of audience. Always `static` for static audiences. enum: - static type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the audience was last updated. format: date-time type: string x-struct: null x-validate: null required: - key - type - name - environment - created_at - updated_at title: StaticAudience type: object x-struct: Elixir.ControlWeb.V1.Specs.StaticAudience x-validate: null PromoteAllResponse: description: The response from promoting all changes. example: result: success properties: result: description: The result of the promote operation. example: success type: string x-struct: null x-validate: null required: - result title: PromoteAllResponse type: object x-struct: null x-validate: null PaginatedMemberResponse: description: A paginated list of Member. Contains a list of entries and page information. example: entries: - created_at: '2024-01-15T10:30:00Z' id: d4b8e8e0-1234-5678-9abc-def012345678 role: admin updated_at: '2024-06-20T14:45:00Z' user: avatar_url: https://www.gravatar.com/avatar/abc123 created_at: '2024-01-10T08:00:00Z' email: jane@example.com id: a1b2c3d4-5678-9abc-def0-123456789abc name: Jane Doe updated_at: '2024-06-18T12:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Member' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedMemberResponse type: object x-struct: null x-validate: null PageInfo: description: The information about a paginated result. example: after: null before: null page_size: 25 properties: after: description: The cursor to fetch entries after. Will only be present if there are more entries to fetch. nullable: true type: string x-struct: null x-validate: null before: description: The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page. nullable: true type: string x-struct: null x-validate: null page_size: description: The number of entries to fetch per-page. type: integer x-struct: null x-validate: null required: - page_size title: PageInfo type: object x-struct: Elixir.ControlWeb.V1.Specs.PageInfo x-validate: null CommitAllResponse: description: The response from committing all changes. example: result: success properties: result: description: The result of the commit operation. example: success type: string x-struct: null x-validate: null required: - result title: CommitAllResponse type: object x-struct: null x-validate: null Variable: description: An environment variable object. example: description: This is a description of my variable. environment_values: development: dev_value production: prod_value inserted_at: '2021-01-01T00:00:00Z' key: my_variable type: public updated_at: '2021-01-01T00:00:00Z' value: my_value properties: description: description: The description of the variable. nullable: true type: string x-struct: null x-validate: null environment_values: additionalProperties: nullable: true type: string x-struct: null x-validate: null description: A map of environment slugs to their override values. Only present for project-scoped responses. type: object x-struct: null x-validate: null inserted_at: description: The timestamp of when the variable was created. format: date-time type: string x-struct: null x-validate: null key: description: The key of the variable. type: string x-struct: null x-validate: null type: default: public description: The type of the variable. enum: - public - secret type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the variable was last updated. format: date-time type: string x-struct: null x-validate: null value: description: The default value of the variable. For secret variables, this is obfuscated. nullable: true type: string x-struct: null x-validate: null required: - key - type - inserted_at - updated_at title: Variable type: object x-struct: Elixir.ControlWeb.V1.Specs.Variable x-validate: null WorkflowUpdateUserStep: description: An update user step. Updates properties of a specific user referenced in the workflow. example: description: Update user step description. name: Update user ref: update_user_1 settings: recipient_gid: gid://Object/$users/user-123 recipient_mode: reference update_properties: '{"name": "Updated User"}' type: update_user properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A conditions object that describes one or more conditions to be met in order for the step to be executed. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Update user step description. nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Update user nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: update_user_1 type: string x-struct: null x-validate: null settings: description: The settings for the update user step. properties: recipient_gid: description: 'The global identifier (GID) of the user to update. Required when recipient_mode is ''reference''. Format: gid://Object/$users/{id}' example: gid://Object/$users/user-123 nullable: true type: string x-struct: null x-validate: null recipient_mode: description: The recipient mode determining how the user is selected. 'current' uses the workflow's current user. 'reference' uses a specific user ID. enum: - current - reference example: reference type: string x-struct: null x-validate: null update_properties: description: A JSON string or Liquid template that evaluates to the properties to update on the user. example: '{"name": "Updated User", "email": "user@example.com"}' type: string x-struct: null x-validate: null required: - recipient_mode - update_properties type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - update_user example: update_user type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowUpdateUserStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowUpdateUserStep x-validate: null PaginatedTranslationResponse: description: A paginated list of Translation. Contains a list of entries and page information. example: entries: - content: '{"hello":"Hello, world!"}' format: json inserted_at: '2021-01-01T00:00:00Z' locale_code: en namespace: my_app updated_at: '2021-01-01T00:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Translation' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedTranslationResponse type: object x-struct: null x-validate: null PaginatedCommitResponse: description: A paginated list of Commit. Contains a list of entries and page information. example: entries: - author: email: john.doe@example.com name: John Doe commit_message: This is a commit message created_at: '2021-01-01T00:00:00Z' environment: development id: 123e4567-e89b-12d3-a456-426614174000 resource: identifier: my-email-layout type: email_layout page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Commit' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedCommitResponse type: object x-struct: null x-validate: null Workflow: description: A workflow object. Read more in the [docs](https://docs.knock.app/concepts/workflows). example: active: false categories: - marketing - black-friday conditions: all: - argument: admin operator: equal_to variable: recipient.role created_at: '2022-12-16T19:07:50.027113Z' description: This is a dummy workflow for demo purposes. environment: development key: december-16-demo name: december-16-demo settings: override_preferences: true sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y steps: - channel_key: in-app-feed channel_type: in_app_feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ data.onboarding_url }}' markdown_body: Hello **{{ recipient.name }}**. Click here to get started. type: channel - ref: delay_1 settings: delay_for: unit: hours value: 1 type: delay - channel_key: postmark channel_type: email ref: email_1 template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }}! type: channel trigger_data_json_schema: properties: onboarding_url: type: string required: - onboarding_url type: object trigger_frequency: every_trigger updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: active: description: Whether the workflow is [active](https://docs.knock.app/concepts/workflows#workflow-status) in the current environment. (read-only). type: boolean x-struct: null x-validate: null categories: description: A list of [categories](https://docs.knock.app/concepts/workflows#workflow-categories) that the workflow belongs to. items: type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A conditions object that describes one or more conditions to be met for the workflow to be executed. (optional). type: object x-struct: null x-validate: null created_at: description: The timestamp of when the workflow was created. (read-only). format: date-time type: string x-struct: null x-validate: null deleted_at: description: The timestamp of when the workflow was deleted. (read-only). format: date-time type: string x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow object. Useful for adding notes about the workflow for internal purposes. Maximum of 280 characters allowed. type: string x-struct: null x-validate: null environment: description: The slug of the environment in which the workflow exists. (read-only). type: string x-struct: null x-validate: null key: description: The 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_-]+$. type: string x-struct: null x-validate: null name: description: A name for the workflow. Must be at maximum 255 characters in length. type: string x-struct: null x-validate: null settings: description: A map of workflow settings. properties: is_commercial: description: Whether the workflow is commercial. Defaults to false. example: false type: boolean x-struct: null x-validate: null override_preferences: description: Whether to ignore recipient preferences for a given type of notification. If true, will send for every channel in the workflow even if the recipient has opted out of a certain kind. Defaults to false. example: false type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null sha: description: The SHA hash of the workflow data. (read-only). type: string x-struct: null x-validate: null steps: description: A list of workflow step objects in the workflow. items: $ref: '#/components/schemas/WorkflowStep' type: array x-struct: null x-validate: null trigger_data_json_schema: additionalProperties: true description: A 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). type: object x-struct: null x-validate: null trigger_frequency: description: 'The 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).' enum: - every_trigger - once_per_recipient - once_per_recipient_per_tenant example: every_trigger type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the workflow was last updated. (read-only). format: date-time type: string x-struct: null x-validate: null valid: description: Whether the workflow and its steps are in a valid state. (read-only). type: boolean x-struct: null x-validate: null required: - key - name - steps - active - valid - environment - created_at - updated_at - sha title: Workflow type: object x-struct: Elixir.ControlWeb.V1.Specs.Workflow x-validate: null ChannelGroup: description: A group of channels with rules for when they are applicable. example: channel_rules: - channel: archived_at: null created_at: '2021-01-01T00:00:00Z' custom_icon_url: null id: 01234567-89ab-cdef-0123-456789abcdef key: my-sendgrid-channel name: My Sendgrid Channel provider: sendgrid type: email updated_at: '2021-01-01T00:00:00Z' created_at: '2021-01-01T00:00:00Z' index: 0 rule_type: always updated_at: '2021-01-01T00:00:00Z' channel_type: push created_at: '2021-01-01T00:00:00Z' key: push-group name: Push Notification Group operator: any source: user updated_at: '2021-01-01T00:00:00Z' properties: archived_at: description: The timestamp of when the channel group was archived (soft deleted). format: date-time nullable: true type: string x-struct: null x-validate: null channel_rules: description: Rules for determining which channels should be used. items: $ref: '#/components/schemas/ChannelGroupRule' type: array x-struct: null x-validate: null channel_type: description: The type of channels contained in this group. enum: - email - in_app - in_app_feed - in_app_guide - sms - push - chat - http type: string x-struct: null x-validate: null created_at: description: The timestamp of when the channel group was created. format: date-time type: string x-struct: null x-validate: null key: description: Unique identifier for the channel group within a project. type: string x-struct: null x-validate: null name: description: The human-readable name of the channel group. type: string x-struct: null x-validate: null operator: description: Determines how the channel rules are applied ('any' means any rule can match, 'all' means all rules must match). enum: - any - all type: string x-struct: null x-validate: null source: description: Whether this channel group was created by the system or a user. Only user created channel groups can be modified. enum: - system - user type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the channel group was last updated. format: date-time type: string x-struct: null x-validate: null required: - name - key - channel_type - operator - source - channel_rules - created_at - updated_at title: ChannelGroup type: object x-struct: Elixir.ControlWeb.V1.Specs.ChannelGroup x-validate: null ChannelGroupRule: description: A rule that determines if a channel should be executed as part of a channel group. example: channel: archived_at: null created_at: '2021-01-01T00:00:00Z' custom_icon_url: null id: 01234567-89ab-cdef-0123-456789abcdef key: my-sendgrid-channel name: My Sendgrid Channel provider: sendgrid type: email updated_at: '2021-01-01T00:00:00Z' created_at: '2021-01-01T00:00:00Z' index: 0 rule_type: always updated_at: '2021-01-01T00:00:00Z' properties: argument: description: For conditional rules, the value to compare against. nullable: true type: string x-struct: null x-validate: null channel: $ref: '#/components/schemas/Channel' created_at: description: The timestamp of when the rule was created. format: date-time type: string x-struct: null x-validate: null index: description: The order index of this rule within the channel group. type: integer x-struct: null x-validate: null operator: description: For conditional rules, the operator to apply. enum: - 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_on_or_after - is_timestamp_between - is_between - empty - not_empty - exists - not_exists - is_timestamp - is_audience_member - is_not_audience_member example: equal_to nullable: true type: string x-struct: null x-validate: null rule_type: description: The type of rule (if = conditional, unless = negative conditional, always = always apply). enum: - if - unless - always type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the rule was last updated. format: date-time type: string x-struct: null x-validate: null variable: description: For conditional rules, the variable to evaluate. nullable: true type: string x-struct: null x-validate: null required: - index - rule_type - channel - created_at - updated_at title: ChannelGroupRule type: object x-struct: Elixir.ControlWeb.V1.Specs.ChannelGroupRule x-validate: null Broadcast: description: A broadcast object. example: categories: - marketing - promotions created_at: '2022-12-16T19:07:50.027113Z' description: Holiday promotion broadcast for December environment: development key: december-promotion name: December Promotion scheduled_at: null sent_at: null settings: is_commercial: true override_preferences: false sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y status: draft steps: - channel_key: in-app-feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: premium-users updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: archived_at: description: The timestamp of when the broadcast was archived. format: date-time nullable: true type: string x-struct: null x-validate: null categories: description: A list of categories that the broadcast belongs to. items: type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null created_at: description: The timestamp of when the broadcast was created. (read-only). format: date-time type: string x-struct: null x-validate: null description: description: An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed. type: string x-struct: null x-validate: null environment: description: The slug of the environment in which the broadcast exists. (read-only). type: string x-struct: null x-validate: null key: description: The 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_-]+$. type: string x-struct: null x-validate: null name: description: A name for the broadcast. Must be at maximum 255 characters in length. type: string x-struct: null x-validate: null scheduled_at: description: The timestamp of when the broadcast is scheduled to be sent. format: date-time nullable: true type: string x-struct: null x-validate: null sent_at: description: The timestamp of when the broadcast was sent. (read-only). format: date-time nullable: true type: string x-struct: null x-validate: null settings: description: A map of broadcast settings. properties: is_commercial: description: Whether the broadcast is commercial. Defaults to true. example: true type: boolean x-struct: null x-validate: null override_preferences: description: Whether to ignore recipient preferences for a given type of notification. If true, will send for every channel in the workflow even if the recipient has opted out of a certain kind. Defaults to false. example: false type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null sha: description: The SHA hash of the workflow data. (read-only). type: string x-struct: null x-validate: null status: description: 'The current status of the broadcast. One of: `draft`, `scheduled`, `sent`.' enum: - draft - scheduled - sent type: string x-struct: null x-validate: null steps: description: A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps. items: anyOf: - $ref: '#/components/schemas/WorkflowWebhookStep' - $ref: '#/components/schemas/WorkflowInAppFeedStep' - $ref: '#/components/schemas/WorkflowChatStep' - $ref: '#/components/schemas/WorkflowSmsStep' - $ref: '#/components/schemas/WorkflowPushStep' - $ref: '#/components/schemas/WorkflowEmailStep' - $ref: '#/components/schemas/WorkflowBranchStep' - $ref: '#/components/schemas/WorkflowDelayStep' - $ref: '#/components/schemas/WorkflowRandomCohortStep' description: A step within a broadcast. Each step, regardless of its type, share a common set of core attributes (`type`, `ref`, `name`, `description`, `conditions`). type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null target_audience_key: description: The key of the audience to target for this broadcast. type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the broadcast was last updated. (read-only). format: date-time type: string x-struct: null x-validate: null valid: description: Whether the broadcast and its steps are in a valid state. (read-only). type: boolean x-struct: null x-validate: null required: - key - name - status - steps - valid - environment - created_at - updated_at - sha title: Broadcast type: object x-struct: Elixir.ControlWeb.V1.Specs.Broadcast x-validate: null WorkflowWebhookStep: description: A webhook step within a workflow to send an HTTP request to a generic channel. Read more in the [docs](https://docs.knock.app/designing-workflows/channel-step). example: channel_group_key: null channel_key: pagerduty channel_type: http conditions: null description: This is a description of the channel step name: Webhook channel step ref: channel_step send_windows: null template: body: null headers: - key: X-API-Key value: '1234567890' method: get query_params: - key: key value: value url: https://example.com type: channel properties: channel_group_key: description: The 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. example: email nullable: true type: string x-struct: null x-validate: null channel_key: description: The 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. example: postmark nullable: true type: string x-struct: null x-validate: null channel_type: description: The type of the channel step. Always `http` for webhook steps. enum: - http example: http type: string x-struct: null x-validate: null conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A set of conditions to be evaluated for this channel step. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Send a message to the channel nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Channel nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: channel_step type: string x-struct: null x-validate: null send_windows: description: A list of send window objects. Must include one send window object per day of the week. items: $ref: '#/components/schemas/SendWindow' nullable: true type: array x-struct: null x-validate: null template: $ref: '#/components/schemas/WebhookTemplate' type: description: The type of the workflow step. enum: - channel example: channel type: string x-struct: null x-validate: null required: - type - ref - template title: WorkflowWebhookStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowWebhookStep x-validate: null WorkflowUpdateDataStep: description: An update data function step. Merges data into the workflow's `data` scope for use in subsequent steps. example: description: Update data step description. name: Update data ref: update_data_1 settings: data: '{"key": "value"}' type: update_data properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A conditions object that describes one or more conditions to be met in order for the step to be executed. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: Update data step description. nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Update data nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: update_data_1 type: string x-struct: null x-validate: null settings: description: The settings for the update data step. properties: data: description: A JSON string or Liquid template that evaluates to the data to merge into the workflow's data scope. example: '{"key": "value"}' type: string x-struct: null x-validate: null required: - data type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - update_data example: update_data type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowUpdateDataStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowUpdateDataStep x-validate: null WrappedWorkflowResponse: description: Wraps the Workflow response under the `workflow` key. example: workflow: active: false categories: - marketing - black-friday conditions: all: - argument: admin operator: equal_to variable: recipient.role created_at: '2022-12-16T19:07:50.027113Z' description: This is a dummy workflow for demo purposes. environment: development key: december-16-demo name: december-16-demo settings: override_preferences: true sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y steps: - channel_key: in-app-feed channel_type: in_app_feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ data.onboarding_url }}' markdown_body: Hello **{{ recipient.name }}**. Click here to get started. type: channel - ref: delay_1 settings: delay_for: unit: hours value: 1 type: delay - channel_key: postmark channel_type: email ref: email_1 template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }}! type: channel trigger_data_json_schema: properties: onboarding_url: type: string required: - onboarding_url type: object trigger_frequency: every_trigger updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: workflow: $ref: '#/components/schemas/Workflow' required: - workflow title: WrappedWorkflowResponse type: object x-struct: null x-validate: null WrappedWorkflowRequestRequest: description: Wraps the WorkflowRequest request under the workflow key. example: workflow: name: My Workflow steps: - channel_key: in-app-feed name: Channel 1 ref: channel_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel properties: workflow: $ref: '#/components/schemas/WorkflowRequest' required: - workflow title: WrappedWorkflowRequestRequest type: object x-struct: null x-validate: null EmailLayout: description: A versioned email layout used within an environment. example: created_at: '2021-01-01T00:00:00Z' environment: development footer_links: - text: Example url: http://example.com html_layout: Hello, world! key: transactional name: Transactional sha: '1234567890' text_layout: Hello, world! updated_at: '2021-01-01T00:00:00Z' properties: created_at: description: The timestamp of when the email layout was created. format: date-time type: string x-struct: null x-validate: null environment: description: The environment of the email layout. type: string x-struct: null x-validate: null footer_links: description: A list of one or more items to show in the footer of the email layout. items: properties: text: description: The text to display as the link. type: string x-struct: null x-validate: null url: description: The URL to link to. type: string x-struct: null x-validate: null required: - text - url type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null html_layout: description: The complete HTML or MJML content of the email layout. type: string x-struct: null x-validate: null is_mjml: description: Whether this layout uses MJML format. When true, html_layout must containWelcome!
settings: layout_key: default subject: Hello {{ recipient.name }} properties: actor: anyOf: - $ref: '#/components/schemas/RecipientReference' - nullable: true x-struct: null x-validate: null description: The actor to reference in the preview. x-struct: null x-validate: null channel_type: description: The channel type of the template to preview. enum: - email - sms - push - chat - in_app_feed type: string x-struct: null x-validate: null data: additionalProperties: true description: The data to pass to the template for rendering. type: object x-struct: null x-validate: null layout: description: Email layout configuration. Only applicable for email channel type. Falls back to environment default if not provided. nullable: true properties: html_content: description: Inline HTML content for the layout. Must include `{{ content }}` placeholder. nullable: true type: string x-struct: null x-validate: null key: description: The key of an existing email layout to use. nullable: true type: string x-struct: null x-validate: null text_content: description: Inline text content for the layout. nullable: true type: string x-struct: null x-validate: null type: object x-struct: null x-validate: null recipient: $ref: '#/components/schemas/RecipientReference' template: anyOf: - $ref: '#/components/schemas/EmailTemplate' - $ref: '#/components/schemas/SmsTemplate' - $ref: '#/components/schemas/PushTemplate' - $ref: '#/components/schemas/ChatTemplate' - $ref: '#/components/schemas/InAppFeedTemplate' description: The template content to preview. Structure depends on channel_type. type: object x-struct: null x-validate: null tenant: description: The tenant to associate with the preview. Must not contain whitespace. nullable: true type: string x-struct: null x-validate: null workflow: description: Optional workflow context for variable hydration. When provided, recipient/actor/tenant are resolved via Knock. nullable: true properties: categories: description: Workflow categories. items: type: string x-struct: null x-validate: null nullable: true type: array x-struct: null x-validate: null key: description: The workflow key. type: string x-struct: null x-validate: null required: - key type: object x-struct: null x-validate: null required: - channel_type - template - recipient title: PreviewTemplateRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.PreviewTemplateRequest x-validate: null SendWindow: description: A send window time for a notification. Describes a single day. example: day: monday from: 09:00 type: send until: '17:00' properties: day: description: The day of the week. enum: - monday - tuesday - wednesday - thursday - friday - saturday - sunday type: string x-struct: null x-validate: null from: description: The start time of the send window. example: 09:00 format: time nullable: true type: string x-struct: null x-validate: null type: description: The type of send window. enum: - send - do_not_send example: send type: string x-struct: null x-validate: null until: description: The end time of the send window. example: '17:00' format: time nullable: true type: string x-struct: null x-validate: null required: - day - type title: SendWindow type: object x-struct: Elixir.ControlWeb.V1.Specs.SendWindow x-validate: null PaginatedEnvironmentResponse: description: A paginated list of Environment. Contains a list of entries and page information. example: entries: - created_at: '2022-10-31T19:59:03Z' deleted_at: null hide_pii_data: false label_color: '#000000' last_commit_at: '2022-10-31T19:59:03Z' name: Development order: 0 owner: system slug: development updated_at: '2022-10-31T19:59:03Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Environment' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedEnvironmentResponse type: object x-struct: null x-validate: null MemberUser: description: Information about a user within the Knock dashboard. Not to be confused with an external user (recipient) of a workflow. example: avatar_url: https://www.gravatar.com/avatar/abc123 created_at: '2024-01-10T08:00:00Z' email: jane@example.com id: a1b2c3d4-5678-9abc-def0-123456789abc name: Jane Doe updated_at: '2024-06-18T12:00:00Z' properties: avatar_url: description: The URL of the user's avatar image. nullable: true type: string x-struct: null x-validate: null created_at: description: The timestamp of when the user was created. format: date-time type: string x-struct: null x-validate: null email: description: The user's email address. format: email type: string x-struct: null x-validate: null id: description: The user's unique identifier. format: uuid type: string x-struct: null x-validate: null name: description: The user's display name. nullable: true type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the user was last updated. format: date-time type: string x-struct: null x-validate: null required: - id - email - created_at - updated_at title: MemberUser type: object x-struct: Elixir.ControlWeb.V1.Specs.MemberUser x-validate: null PreviewWorkflowTemplateRequest: description: A request to preview a workflow template. example: actor: dnedry data: park_id: 1 recipient: dnedry tenant: acme-corp properties: actor: anyOf: - $ref: '#/components/schemas/RecipientReference' - nullable: true x-struct: null x-validate: null description: The actor to reference in the the workflow run. type: object x-struct: null x-validate: null data: additionalProperties: true description: The data to pass to the workflow template for rendering. type: object x-struct: null x-validate: null recipient: $ref: '#/components/schemas/RecipientReference' tenant: description: The tenant to associate the workflow with. Must not contain whitespace. nullable: true type: string x-struct: null x-validate: null required: - recipient title: PreviewWorkflowTemplateRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.PreviewWorkflowTemplateRequest x-validate: null EmailTemplateSettings: description: The [settings](https://docs.knock.app/integrations/email/settings) for the email template. Must be supplied with at least `layout_key`. example: layout_key: default properties: attachment_key: description: The object path in the workflow trigger's `data` payload to resolve attachments.Defaults to `attachments`. example: attachments nullable: true type: string x-struct: null x-validate: null layout_key: description: The `key` of the [email layout](https://docs.knock.app/integrations/email/layouts) that wraps the email template. When omitted, the email template will need to define the `` structure. example: default nullable: true type: string x-struct: null x-validate: null pre_content: description: A liquid template that will be injected into the email layout above the message template content. Useful for setting variables that should be available to the email layout. nullable: true type: string x-struct: null x-validate: null title: EmailTemplateSettings type: object x-struct: null x-validate: null EmailHtmlBlock: description: An HTML block in an email template. example: content:Hello, world!
layout_attrs: padding_bottom: 8 padding_left: 4 padding_right: 4 padding_top: 8 type: html properties: content: description: The HTML content of the block. 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. type: string x-struct: null x-validate: null id: description: The ID of the block. example: 123e4567-e89b-12d3-a456-426614174000 format: uuid type: string x-struct: null x-validate: null layout_attrs: description: The layout attributes of the block. properties: padding_bottom: description: The padding_bottom layout attribute of the block. type: integer x-struct: null x-validate: null padding_left: description: The padding_left layout attribute of the block. type: integer x-struct: null x-validate: null padding_right: description: The padding_right layout attribute of the block. type: integer x-struct: null x-validate: null padding_top: description: The padding_top layout attribute of the block. type: integer x-struct: null x-validate: null required: - padding_top - padding_right - padding_bottom - padding_left type: object x-struct: null x-validate: null type: description: The type of the block. enum: - html example: html type: string x-struct: null x-validate: null version: description: The version of the block schema. This is automatically managed by Knock and should not be set manually. Currently all blocks are at version 1. example: 1 type: integer x-struct: null x-validate: null required: - type - content title: EmailHtmlBlock type: object x-struct: Elixir.ControlWeb.V1.Specs.EmailBlocks.HtmlBlock x-validate: null PaginatedEmailLayoutResponse: description: A paginated list of EmailLayout. Contains a list of entries and page information. example: entries: - created_at: '2021-01-01T00:00:00Z' environment: development footer_links: - text: Example url: http://example.com html_layout: Hello, world! key: transactional name: Transactional sha: '1234567890' text_layout: Hello, world! updated_at: '2021-01-01T00:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/EmailLayout' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedEmailLayoutResponse type: object x-struct: null x-validate: null ChannelEnvironmentSettings: description: Environment-specific settings for a channel. example: channel_settings: from_address: hello@example.com from_name: Example Inc id: 550e8400-e29b-41d4-a716-446655440001 is_sandbox: false is_valid: true provider_settings: api_key: '{{ vars.sendgrid_api_key }}' check_delivery_status: true link_tracking: true open_tracking: true properties: channel_settings: additionalProperties: true description: Channel-type-specific settings (e.g., from_address for email). Structure varies by channel type. nullable: true type: object x-struct: null x-validate: null id: description: The unique identifier for these environment settings. format: uuid type: string x-struct: null x-validate: null is_sandbox: description: Whether the channel is in sandbox mode for this environment. Sandbox mode may prevent actual message delivery. type: boolean x-struct: null x-validate: null is_valid: description: Whether the channel configuration is valid and ready to send messages in this environment. type: boolean x-struct: null x-validate: null provider_settings: additionalProperties: true description: Provider-specific settings (e.g., API keys, credentials). Structure varies by provider. Secret values are obfuscated unless they are Liquid templates. nullable: true type: object x-struct: null x-validate: null required: - id - is_valid - is_sandbox title: ChannelEnvironmentSettings type: object x-struct: Elixir.ControlWeb.V1.Specs.ChannelEnvironmentSettings x-validate: null WorkflowRandomCohortStepBranch: description: A cohort branch in an experiment step. example: name: Control percentage: '50' steps: [] terminates: false properties: name: description: The name of the cohort branch. example: Control type: string x-struct: null x-validate: null percentage: description: The percentage of recipients to assign to this cohort. Must be between 0 and 100 with at most 1 decimal place. All branch percentages must sum to 100. Sent as a number in requests; returned as a decimal string in responses (e.g. "50", "33.3"). example: '50' type: string x-struct: null x-validate: null steps: description: A list of steps that will be executed for recipients assigned to this cohort. items: $ref: '#/components/schemas/WorkflowStep' type: array x-struct: null x-validate: null terminates: description: If the workflow should halt at the end of the branch. Defaults to false if not provided. example: false type: boolean x-struct: null x-validate: null required: - percentage title: WorkflowRandomCohortStepBranch type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowRandomCohortStep.CohortBranch x-validate: null RunWorkflowResponse: description: A response to a run workflow request. example: workflow_run_id: 123e4567-e89b-12d3-a456-426614174000 properties: workflow_run_id: description: The ID of the workflow run. format: uuid type: string x-struct: null x-validate: null required: - workflow_run_id title: RunWorkflowResponse type: object x-struct: Elixir.ControlWeb.V1.Specs.RunWorkflowResponse x-validate: null AudienceRequest: description: 'An audience object with attributes to create or update an audience. Use `type: static` for audiences with explicitly managed members, or `type: dynamic` for audiences with segment-based membership.' discriminator: mapping: dynamic: '#/components/schemas/DynamicAudienceRequest' static: '#/components/schemas/StaticAudienceRequest' propertyName: type example: description: Users on the premium plan name: Premium users segments: - conditions: - argument: premium operator: equal_to property: recipient.plan type: dynamic oneOf: - $ref: '#/components/schemas/StaticAudienceRequest' - $ref: '#/components/schemas/DynamicAudienceRequest' title: AudienceRequest type: object x-struct: Elixir.ControlWeb.V1.Specs.AudienceRequest x-validate: null RequestTemplateQueryParams: description: The query params of the request. Can be a template string or a list of key-value pairs. example: - key: key value: value oneOf: - description: A template string that should resolve to a JSON object representing the query params. example: '{{ data.request_query_params }}' title: RequestTemplateQueryParamsString type: string x-struct: null x-validate: null - description: A list of key-value pairs for the request query params. Each object should contain key and value fields with string values. example: - key: key value: value items: properties: key: description: The key of the query param. example: key type: string x-struct: null x-validate: null value: description: The value of the query param. example: value type: string x-struct: null x-validate: null required: - key - value type: object x-struct: null x-validate: null title: RequestTemplateQueryParamsArray type: array x-struct: null x-validate: null title: RequestTemplateQueryParams type: object x-struct: null x-validate: null Branch: description: A branch object. example: created_at: '2022-10-31T19:59:03Z' deleted_at: null last_commit_at: '2022-10-31T19:59:03Z' slug: feature-branch updated_at: '2022-10-31T19:59:03Z' properties: created_at: description: The timestamp of when the branch was created. format: date-time type: string x-struct: null x-validate: null deleted_at: description: The timestamp of when the branch was deleted. format: date-time nullable: true type: string x-struct: null x-validate: null last_commit_at: description: The timestamp of the most-recent commit in the branch. format: date-time nullable: true type: string x-struct: null x-validate: null slug: description: A unique slug for the branch. Cannot exceed 255 characters. type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the branch was last updated. format: date-time type: string x-struct: null x-validate: null required: - slug - created_at - updated_at title: Branch type: object x-struct: Elixir.ControlWeb.V1.Specs.Branch x-validate: null WorkflowAIAgentStep: description: An AI agent function step. Fetches data from an AI model and merges it into the workflow's `data` scope for use in later steps. Supports Liquid templating in the prompt. Read more in the [docs](https://docs.knock.app/designing-workflows/ai-agent-function). example: name: AI agent step ref: ai_agent_step settings: model: anthropic:claude-haiku-4-5 request_prompt: You are a helpful assistant. response_type: text type: ai_agent properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A conditions object that describes one or more conditions to be met in order for the step to be executed. type: object x-struct: null x-validate: null description: description: An arbitrary string attached to a workflow step. Useful for adding notes about the workflow for internal purposes. example: AI agent step description nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: AI agent step nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: ai_1 type: string x-struct: null x-validate: null settings: description: The settings for the AI agent step. properties: halt_on_error: description: Whether to halt the workflow if the AI fetch fails. example: true nullable: true type: boolean x-struct: null x-validate: null model: description: The AI model to use in `provider:model` format (e.g. `anthropic:claude-haiku-4-5`, `openai:gpt-5.2-chat-latest`). See the documentation for a list of supported models. example: anthropic:claude-haiku-4-5 type: string x-struct: null x-validate: null request_prompt: description: The prompt template for the AI request. Supports Liquid templating. example: You are a helpful assistant. type: string x-struct: null x-validate: null response_schema: description: A JSON schema string for structured output. Required when `response_type` is `json`. Must not be set when `response_type` is `text`. example: '{"type": "object", "properties": {"summary": {"type": "string"}}}' nullable: true type: string x-struct: null x-validate: null response_type: description: The type of response to expect from the AI model. enum: - text - json example: text type: string x-struct: null x-validate: null web_search_enabled: description: Whether to enable web search for the AI request. example: false nullable: true type: boolean x-struct: null x-validate: null required: - model - response_type - request_prompt type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - ai_agent example: ai_agent type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowAIAgentStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowAIAgentStep x-validate: null RequestTemplateHeaders: description: The headers of the request. Can be a template string or a list of key-value pairs. example: - key: X-API-Key value: '1234567890' oneOf: - description: A template string that should resolve to a JSON object representing the headers. example: '{{ data.request_headers }}' title: RequestTemplateHeadersString type: string x-struct: null x-validate: null - description: A list of key-value pairs for the request headers. Each object should contain key and value fields with string values. example: - key: X-API-Key value: '1234567890' items: properties: key: description: The key of the header. example: X-API-Key type: string x-struct: null x-validate: null value: description: The value of the header. example: '1234567890' type: string x-struct: null x-validate: null required: - key - value type: object x-struct: null x-validate: null title: RequestTemplateHeadersArray type: array x-struct: null x-validate: null title: RequestTemplateHeaders type: object x-struct: null x-validate: null Partial: description: A partial is a reusable piece of content that can be used in a template. example: content:Hello, world!
description: This is a test partial environment: development icon_name: icon-name input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text inserted_at: '2021-01-01T00:00:00Z' key: my-partial name: My Partial type: html updated_at: '2021-01-01T00:00:00Z' valid: true visual_block_enabled: true properties: content: description: The partial content. type: string x-struct: null x-validate: null description: description: An arbitrary string attached to a partial object. Useful for adding notes about the partial for internal purposes. Maximum of 280 characters allowed. type: string x-struct: null x-validate: null environment: description: The slug of the environment in which the partial exists. type: string x-struct: null x-validate: null icon_name: description: The name of the icon to be used in the visual editor. type: string x-struct: null x-validate: null input_schema: description: The field types available for the partial. items: anyOf: - $ref: '#/components/schemas/MessageTypeBooleanField' - $ref: '#/components/schemas/MessageTypeButtonField' - $ref: '#/components/schemas/MessageTypeImageField' - $ref: '#/components/schemas/MessageTypeJsonField' - $ref: '#/components/schemas/MessageTypeMarkdownField' - $ref: '#/components/schemas/MessageTypeMultiSelectField' - $ref: '#/components/schemas/MessageTypeSelectField' - $ref: '#/components/schemas/MessageTypeTextField' - $ref: '#/components/schemas/MessageTypeTextareaField' - $ref: '#/components/schemas/MessageTypeUrlField' type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null inserted_at: description: The timestamp of when the partial was created. format: date-time type: string x-struct: null x-validate: null key: description: The 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_-]+$. type: string x-struct: null x-validate: null name: description: A name for the partial. Must be at maximum 255 characters in length. type: string x-struct: null x-validate: null type: description: The partial type. One of 'html', 'json', 'markdown', 'text'. enum: - html - text - json - markdown type: string x-struct: null x-validate: null updated_at: description: The timestamp of when the partial was last updated. format: date-time type: string x-struct: null x-validate: null valid: description: Whether the partial and its content are in a valid state. type: boolean x-struct: null x-validate: null visual_block_enabled: description: Indicates whether the partial can be used in the visual editor. Only applies to HTML partials. type: boolean x-struct: null x-validate: null required: - key - type - name - content - inserted_at - updated_at - valid title: Partial type: object x-struct: Elixir.ControlWeb.V1.Specs.Partial x-validate: null UserRecipientReference: description: A user ID. example: user_1 nullable: false title: UserRecipientReference type: string x-struct: null x-validate: null MessageType: description: A message type is a schema for a message that maps to a UI component or element within your application. example: archived_at: null created_at: '2021-01-01T00:00:00Z' deleted_at: null description: Email message type environment: development icon_name: email key: email name: Email owner: user preview:Hello, world!
description: This is a test partial environment: development icon_name: icon-name input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text inserted_at: '2021-01-01T00:00:00Z' key: my-partial name: My Partial type: html updated_at: '2021-01-01T00:00:00Z' valid: true visual_block_enabled: true page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Partial' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedPartialResponse type: object x-struct: null x-validate: null WrappedTranslationResponse: description: Wraps the Translation response under the `translation` key. example: translation: content: '{"hello":"Hello, world!"}' format: json inserted_at: '2021-01-01T00:00:00Z' locale_code: en namespace: my_app updated_at: '2021-01-01T00:00:00Z' properties: translation: $ref: '#/components/schemas/Translation' required: - translation title: WrappedTranslationResponse type: object x-struct: null x-validate: null WrappedGuideRequestRequest: description: Wraps the GuideRequest request under the guide key. example: guide: activation_url_patterns: - directive: allow pathname: /dashboard/* channel_key: in-app-guide description: A guide to help users get started with the application name: Getting Started Guide steps: - name: Welcome to the App ref: welcome-step schema_key: tooltip schema_semver: 1.0.0 schema_variant_key: default values: text_field: value target_audience_id: null target_property_conditions: all: - argument: some_property operator: equal_to variable: recipient.property properties: guide: $ref: '#/components/schemas/GuideRequest' required: - guide title: WrappedGuideRequestRequest type: object x-struct: null x-validate: null MessageTypeSelectField: description: A select field used in a message type. example: key: select_field label: Select Field settings: default: option1 description: A description of the select field options: - label: Option 1 value: option1 - label: Option 2 value: option2 - label: Option 3 value: option3 required: true type: select properties: key: description: The unique key of the field. example: key type: string x-struct: null x-validate: null label: description: The label of the field. example: Label nullable: true type: string x-struct: null x-validate: null settings: description: Settings for the select field. properties: default: description: The default value for the select field. example: option1 nullable: true type: string x-struct: null x-validate: null description: example: A description of the field, used in the UI as a hint text. nullable: true type: string x-struct: null x-validate: null options: description: The available options for the select field. items: properties: label: description: The display label for the option. example: Option 1 type: string x-struct: null x-validate: null value: description: The value for the option. example: option1 type: string x-struct: null x-validate: null required: - value type: object x-struct: null x-validate: null type: array x-struct: null x-validate: null placeholder: example: A placeholder for the field. nullable: true type: string x-struct: null x-validate: null required: description: Whether the field is required. example: true type: boolean x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the field. enum: - select example: select type: string x-struct: null x-validate: null required: - type - key - label - settings title: MessageTypeSelectField type: object x-struct: Elixir.ControlWeb.V1.Specs.MessageTypes.SelectField x-validate: null GuideStep: description: A step in a guide that corresponds to a piece of UI and its content. example: name: Welcome to the App ref: welcome-step schema_key: tooltip schema_semver: 1.0.0 schema_variant_key: default values: text_field: value properties: name: description: A name for the step. type: string x-struct: null x-validate: null ref: description: The 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_-]+$. example: welcome-step type: string x-struct: null x-validate: null schema_key: description: The key of the template schema to use for this step. example: tooltip type: string x-struct: null x-validate: null schema_semver: description: The semantic version of the template schema to use. example: 1.0.0 type: string x-struct: null x-validate: null schema_variant_key: description: The key of the template schema variant to use. example: default type: string x-struct: null x-validate: null values: additionalProperties: true description: A map of values that make up the step's content. Each value must conform to its respective template schema field settings. example: text_field: value type: object x-struct: null x-validate: null required: - ref - schema_key - schema_semver - schema_variant_key title: GuideStep type: object x-struct: Elixir.ControlWeb.V1.Specs.GuideStep x-validate: null WorkflowTriggerWorkflowStep: description: A workflow trigger function step. Read more in the [docs](https://docs.knock.app/designing-workflows/trigger-workflow-function). example: name: Trigger workflow step ref: trigger_workflow_step settings: actor: '{{ actor.id }}' cancellation_key: '{{ workflow.cancellation_key }}' data: '{{ data | json }}' recipients: '{{ recipient.id }}' tenant: '{{ tenant.id }}' workflow_key: dinosaurs-loose type: trigger_workflow properties: conditions: anyOf: - $ref: '#/components/schemas/ConditionGroup' - nullable: true x-struct: null x-validate: null description: A set of conditions to be evaluated for this trigger workflow step. type: object x-struct: null x-validate: null description: description: A description for the workflow step. example: Trigger workflow step description nullable: true type: string x-struct: null x-validate: null name: description: A name for the workflow step. example: Trigger workflow step nullable: true type: string x-struct: null x-validate: null ref: description: The reference key of the workflow step. Must be unique per workflow. example: trigger_workflow_step type: string x-struct: null x-validate: null settings: description: The settings for the workflow trigger workflow step. properties: actor: description: The actor to trigger the workflow with. Supports liquid. example: '{{ actor.id }}' type: string x-struct: null x-validate: null cancellation_key: description: The cancellation key to trigger the workflow with. Supports liquid. example: '{{ workflow.cancellation_key }}' type: string x-struct: null x-validate: null data: description: The data to be supplied to the workflow. Supports liquid. example: '{{ data | json }}' type: string x-struct: null x-validate: null recipients: description: The recipients or recipient to trigger the workflow for. Supports liquid. example: '{{ recipient.id }}' type: string x-struct: null x-validate: null tenant: description: The tenant to trigger the workflow with. Supports liquid. example: '{{ tenant.id }}' type: string x-struct: null x-validate: null workflow_key: description: The key of the workflow to trigger. Supports liquid. example: dinosaurs-loose type: string x-struct: null x-validate: null type: object x-struct: null x-validate: null type: description: The type of the workflow step. enum: - trigger_workflow example: trigger_workflow type: string x-struct: null x-validate: null required: - type - ref - settings title: WorkflowTriggerWorkflowStep type: object x-struct: Elixir.ControlWeb.V1.Specs.WorkflowTriggerWorkflowStep x-validate: null Audience: description: An audience defines a set of users that can be targeted for notifications. Can be either a `StaticAudience` (members explicitly added/removed) or a `DynamicAudience` (members determined by segment conditions). discriminator: mapping: dynamic: '#/components/schemas/DynamicAudience' static: '#/components/schemas/StaticAudience' propertyName: type example: created_at: '2024-01-15T10:30:00Z' description: Customers who signed up in the last 30 days. environment: development key: new-customers name: New customers segments: - conditions: - argument: 30_days_ago operator: greater_than property: recipient.created_at sha: a1b2c3d4e5f6 type: dynamic updated_at: '2024-06-20T14:45:00Z' oneOf: - $ref: '#/components/schemas/StaticAudience' - $ref: '#/components/schemas/DynamicAudience' title: Audience type: object x-struct: Elixir.ControlWeb.V1.Specs.Audience x-validate: null Condition: description: A condition to be evaluated. example: argument: some_property operator: equal_to variable: recipient.property properties: argument: description: The 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. example: some_property nullable: true type: string x-struct: null x-validate: null operator: description: The operator to use in the evaluation of the condition. enum: - 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_on_or_after - is_timestamp_between - is_between - empty - not_empty - exists - not_exists - is_timestamp - is_audience_member - is_not_audience_member example: equal_to type: string x-struct: null x-validate: null variable: description: The 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. example: recipient.property type: string x-struct: null x-validate: null required: - variable - operator title: Condition type: object x-struct: Elixir.ControlWeb.V1.Specs.Condition x-validate: null PushTemplate: description: A push notification template. example: settings: delivery_type: content payload_overrides: '{"name": "John"}' text_body: Hello, world! title: Hello, world! properties: settings: description: The [settings](https://docs.knock.app/integrations/sms/settings-and-overrides) for the push template. properties: delivery_type: description: The delivery type of the push notification. Set as silent to send a data-only notification. When set to `silent`, no body will be sent. enum: - silent - content example: content type: string x-struct: null x-validate: null payload_overrides: description: A JSON object that overrides the payload sent to the push provider. example: '{"name": "John"}' type: string x-struct: null x-validate: null required: - delivery_type type: object x-struct: null x-validate: null text_body: description: The body of the push notification. example: Hello, world! type: string x-struct: null x-validate: null title: description: The title of the push notification. example: Hello, world! type: string x-struct: null x-validate: null required: - title - text_body - settings title: PushTemplate type: object x-struct: Elixir.ControlWeb.V1.Specs.PushTemplate x-validate: null CommitAuthor: description: The author of the commit. example: email: john.doe@example.com name: John Doe properties: email: description: The email address of the commit author. type: string x-struct: null x-validate: null name: description: The name of the commit author. nullable: true type: string x-struct: null x-validate: null required: - email title: CommitAuthor type: object x-struct: null x-validate: null CommitResource: description: The resource object associated with the commit. example: identifier: my-email-layout type: email_layout properties: identifier: description: The unique identifier for the resource. type: string x-struct: null x-validate: null type: description: The type of the resource object. enum: - audience - email_layout - guide - message_type - partial - translation - workflow example: workflow type: string x-struct: null x-validate: null required: - identifier - type title: CommitResource type: object x-struct: null x-validate: null securitySchemes: BearerAuth: type: http scheme: bearer description: Knock service token (kst_...) as a Bearer token. info: title: Knock Management API (mAPI) version: '1.0' description: Knock Management API (mAPI) — the resource-management surface for Knock. Programmatic CRUD over Workflows, Channels, Email Layouts, Partials, Templates, Translations, Audiences, Broadcasts, Guides, Message Types, Variables, Members, Channel Groups, Environments, Branches, Commits, and API Keys. Distinct from the runtime Knock API (api.knock.app) — mAPI lives at control.knock.app and is what powers the Knock CLI and MCP server. contact: name: Knock url: https://knock.app openapi: 3.0.3 paths: /v1/environments/{environment_slug}: get: callbacks: {} description: Returns a single environment by the `environment_slug`. operationId: getEnvironment parameters: - description: The slug of the environment to retrieve. in: path name: environment_slug required: true schema: example: development type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Environment' description: OK summary: Get an environment tags: - Environments /v1/branches: get: callbacks: {} description: Returns a paginated list of branches. The branches will be returned in order of their last commit time (newest first). operationId: listBranches parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Branch. Contains a list of entries and page information. example: entries: - created_at: '2022-10-31T19:59:03Z' deleted_at: null last_commit_at: '2022-10-31T19:59:03Z' slug: feature-branch updated_at: '2022-10-31T19:59:03Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Branch' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedBranchResponse type: object x-struct: null x-validate: null description: OK summary: List branches tags: - Branches /v1/workflows/{workflow_key}/validate: put: callbacks: {} description: '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. ' operationId: validateWorkflow parameters: - description: The key of the workflow. in: path name: workflow_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the WorkflowRequest request under the workflow key. example: workflow: name: My Workflow steps: - channel_key: in-app-feed name: Channel 1 ref: channel_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel properties: workflow: $ref: '#/components/schemas/WorkflowRequest' required: - workflow title: WrappedWorkflowRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Workflow response under the `workflow` key. example: workflow: active: false categories: - marketing - black-friday conditions: all: - argument: admin operator: equal_to variable: recipient.role created_at: '2022-12-16T19:07:50.027113Z' description: This is a dummy workflow for demo purposes. environment: development key: december-16-demo name: december-16-demo settings: override_preferences: true sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y steps: - channel_key: in-app-feed channel_type: in_app_feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ data.onboarding_url }}' markdown_body: Hello **{{ recipient.name }}**. Click here to get started. type: channel - ref: delay_1 settings: delay_for: unit: hours value: 1 type: delay - channel_key: postmark channel_type: email ref: email_1 template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }}! type: channel trigger_data_json_schema: properties: onboarding_url: type: string required: - onboarding_url type: object trigger_frequency: every_trigger updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: workflow: $ref: '#/components/schemas/Workflow' required: - workflow title: WrappedWorkflowResponse type: object x-struct: null x-validate: null description: OK summary: Validate a workflow tags: - Workflows /v1/workflows/{workflow_key}/run: put: callbacks: {} description: Runs the latest version of a committed workflow in a given environment using the params provided. operationId: runWorkflow parameters: - description: The key of the workflow. in: path name: workflow_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: $ref: '#/components/schemas/RunWorkflowRequest' description: Params required: false responses: '200': content: application/json: schema: $ref: '#/components/schemas/RunWorkflowResponse' description: OK summary: Run a workflow tags: - Workflows /v1/email_layouts: get: callbacks: {} description: Returns a paginated list of email layouts available in a given environment. operationId: listEmailLayouts parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of EmailLayout. Contains a list of entries and page information. example: entries: - created_at: '2021-01-01T00:00:00Z' environment: development footer_links: - text: Example url: http://example.com html_layout: Hello, world! key: transactional name: Transactional sha: '1234567890' text_layout: Hello, world! updated_at: '2021-01-01T00:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/EmailLayout' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedEmailLayoutResponse type: object x-struct: null x-validate: null description: OK summary: List email layouts tags: - Email layouts /v1/guides/{guide_key}: delete: callbacks: {} description: Archives a given guide across all environments. operationId: archiveGuide parameters: - description: The key of the guide to archive. in: path name: guide_key required: true schema: type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: description: The response from archiving a guide. example: result: success properties: result: description: The result of the promote operation. example: success type: string x-struct: null x-validate: null required: - result title: ArchiveGuideResponse type: object x-struct: null x-validate: null description: OK summary: Archive a guide tags: - Guides get: callbacks: {} description: Get a guide by its key. operationId: getGuide parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The key of the guide to retrieve. in: path name: guide_key required: true schema: type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Guide' description: OK summary: Get a guide tags: - Guides put: callbacks: {} description: '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. ' operationId: upsertGuide parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The key of the guide to upsert. in: path name: guide_key required: true schema: type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: When set to true, forces the upsert to override existing content regardless of environment restrictions. This bypasses the development-only environment check and origin environment checks. in: query name: force required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to commit the resource at the same time as modifying it. in: query name: commit required: false schema: type: boolean x-struct: null x-validate: null - description: The message to commit the resource with, only used if `commit` is `true`. in: query name: commit_message required: false schema: type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the GuideRequest request under the guide key. example: guide: activation_url_patterns: - directive: allow pathname: /dashboard/* channel_key: in-app-guide description: A guide to help users get started with the application name: Getting Started Guide steps: - name: Welcome to the App ref: welcome-step schema_key: tooltip schema_semver: 1.0.0 schema_variant_key: default values: text_field: value target_audience_id: null target_property_conditions: all: - argument: some_property operator: equal_to variable: recipient.property properties: guide: $ref: '#/components/schemas/GuideRequest' required: - guide title: WrappedGuideRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Guide response under the `guide` key. example: guide: activation_url_patterns: - directive: allow pathname: /dashboard/* active: true archived_at: null channel_key: in-app-guide created_at: '2024-01-01T00:00:00Z' description: A guide to help users get started with the application environment: development key: getting-started name: Getting Started Guide semver: 0.0.1 sha: '1234567890' steps: - name: Welcome to the App ref: welcome-step schema_key: tooltip schema_semver: 1.0.0 schema_variant_key: default values: text_field: value target_audience_id: null target_property_conditions: all: - argument: some_property operator: equal_to variable: recipient.property type: banner updated_at: '2024-01-01T00:00:00Z' valid: true properties: guide: $ref: '#/components/schemas/Guide' required: - guide title: WrappedGuideResponse type: object x-struct: null x-validate: null description: OK summary: Upsert a guide tags: - Guides /v1/broadcasts/{broadcast_key}/send: put: callbacks: {} description: 'Sends a broadcast immediately or schedules it to send at a future time. ' operationId: sendBroadcast parameters: - description: The key of the broadcast. in: path name: broadcast_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: $ref: '#/components/schemas/BroadcastSendRequest' description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Broadcast response under the `broadcast` key. example: broadcast: categories: - marketing - promotions created_at: '2022-12-16T19:07:50.027113Z' description: Holiday promotion broadcast for December environment: development key: december-promotion name: December Promotion scheduled_at: null sent_at: null settings: is_commercial: true override_preferences: false sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y status: draft steps: - channel_key: in-app-feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: premium-users updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: broadcast: $ref: '#/components/schemas/Broadcast' required: - broadcast title: WrappedBroadcastResponse type: object x-struct: null x-validate: null description: OK summary: Send a broadcast tags: - Broadcasts /v1/guides: get: callbacks: {} description: Returns a paginated list of guides available in a given environment. operationId: listGuides parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Guide. Contains a list of entries and page information. example: entries: - activation_url_patterns: - directive: allow pathname: /dashboard/* active: true archived_at: null channel_key: in-app-guide created_at: '2024-01-01T00:00:00Z' description: A guide to help users get started with the application environment: development key: getting-started name: Getting Started Guide semver: 0.0.1 sha: '1234567890' steps: - name: Welcome to the App ref: welcome-step schema_key: tooltip schema_semver: 1.0.0 schema_variant_key: default values: text_field: value target_audience_id: null target_property_conditions: all: - argument: some_property operator: equal_to variable: recipient.property type: banner updated_at: '2024-01-01T00:00:00Z' valid: true page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Guide' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedGuideResponse type: object x-struct: null x-validate: null description: OK summary: List guides tags: - Guides /v1/broadcasts/{broadcast_key}/validate: put: callbacks: {} description: 'Validates a broadcast payload without persisting it. ' operationId: validateBroadcast parameters: - description: The key of the broadcast. in: path name: broadcast_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the BroadcastRequest request under the broadcast key. example: broadcast: categories: - announcement description: A broadcast to all users name: My Broadcast settings: is_commercial: true override_preferences: false steps: - channel_key: in-app-feed name: Channel 1 ref: channel_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: all-users properties: broadcast: $ref: '#/components/schemas/BroadcastRequest' required: - broadcast title: WrappedBroadcastRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Broadcast response under the `broadcast` key. example: broadcast: categories: - marketing - promotions created_at: '2022-12-16T19:07:50.027113Z' description: Holiday promotion broadcast for December environment: development key: december-promotion name: December Promotion scheduled_at: null sent_at: null settings: is_commercial: true override_preferences: false sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y status: draft steps: - channel_key: in-app-feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: premium-users updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: broadcast: $ref: '#/components/schemas/Broadcast' required: - broadcast title: WrappedBroadcastResponse type: object x-struct: null x-validate: null description: OK summary: Validate a broadcast tags: - Broadcasts /v1/variables/{key}: get: callbacks: {} description: Returns a single variable by key with per-environment value overrides. operationId: getVariable parameters: - description: The key of the variable to retrieve. in: path name: key required: true schema: type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Variable' description: OK summary: Get a variable tags: - Variables /v1/translations: get: callbacks: {} description: 'Returns a paginated list of translations available in a given environment. The translations are returned in alphabetical order by locale code. ' operationId: listTranslations parameters: - description: A specific locale code to filter translations for. in: query name: locale_code required: false schema: type: string x-struct: null x-validate: null - description: A specific namespace to filter translations for. in: query name: namespace required: false schema: type: string x-struct: null x-validate: null - description: A specific tenant to filter translations for. in: query name: tenant required: false schema: type: string x-struct: null x-validate: null - description: Optionally specify the returned content format. Supports 'json' and 'po'. Defaults to 'json'. in: query name: format required: false schema: enum: - json - po type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Translation. Contains a list of entries and page information. example: entries: - content: '{"hello":"Hello, world!"}' format: json inserted_at: '2021-01-01T00:00:00Z' locale_code: en namespace: my_app updated_at: '2021-01-01T00:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Translation' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedTranslationResponse type: object x-struct: null x-validate: null description: OK summary: List translations tags: - Translations /v1/workflows/{workflow_key}/steps/{step_ref}/preview_template: post: callbacks: {} description: Generates a rendered template for a given channel step in a workflow. operationId: previewWorkflowTemplate parameters: - description: The key of the workflow. in: path name: workflow_key required: true schema: type: string x-struct: null x-validate: null - description: The reference key of the channel step in the workflow to preview. in: path name: step_ref required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: $ref: '#/components/schemas/PreviewWorkflowTemplateRequest' description: Params required: false responses: '200': content: application/json: schema: $ref: '#/components/schemas/PreviewWorkflowTemplateResponse' description: OK summary: Preview a workflow template tags: - Workflows /v1/templates/preview: post: callbacks: {} description: 'Renders a template preview, without requiring a template to be persisted within Knock. This is useful for previewing templates in isolation, without the need to use a workflow. For email templates, you can optionally specify a layout by key or provide inline layout content. ' operationId: previewTemplate parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: $ref: '#/components/schemas/PreviewTemplateRequest' description: Params required: false responses: '200': content: application/json: schema: $ref: '#/components/schemas/PreviewTemplateResponse' description: OK summary: Preview a template tags: - Templates /v1/guides/{guide_key}/activate: put: callbacks: {} description: '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. ' operationId: activateGuide parameters: - description: The key of the guide. in: path name: guide_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: $ref: '#/components/schemas/GuideActivationParams' description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Guide response under the `guide` key. example: guide: activation_url_patterns: - directive: allow pathname: /dashboard/* active: true archived_at: null channel_key: in-app-guide created_at: '2024-01-01T00:00:00Z' description: A guide to help users get started with the application environment: development key: getting-started name: Getting Started Guide semver: 0.0.1 sha: '1234567890' steps: - name: Welcome to the App ref: welcome-step schema_key: tooltip schema_semver: 1.0.0 schema_variant_key: default values: text_field: value target_audience_id: null target_property_conditions: all: - argument: some_property operator: equal_to variable: recipient.property type: banner updated_at: '2024-01-01T00:00:00Z' valid: true properties: guide: $ref: '#/components/schemas/Guide' required: - guide title: WrappedGuideResponse type: object x-struct: null x-validate: null description: OK summary: Activate a guide tags: - Guides /v1/partials: get: callbacks: {} description: List all partials for a given environment. operationId: listPartials parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Partial. Contains a list of entries and page information. example: entries: - content:Hello, world!
description: This is a test partial environment: development icon_name: icon-name input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text inserted_at: '2021-01-01T00:00:00Z' key: my-partial name: My Partial type: html updated_at: '2021-01-01T00:00:00Z' valid: true visual_block_enabled: true page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Partial' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedPartialResponse type: object x-struct: null x-validate: null description: OK summary: List partials tags: - Partials /v1/partials/{partial_key}: get: callbacks: {} description: Get a partial by its key. operationId: getPartial parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The key of the partial to retrieve. in: path name: partial_key required: true schema: type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Partial' description: OK summary: Get a partial tags: - Partials put: callbacks: {} description: '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. ' operationId: upsertPartial parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The key of the partial to upsert. in: path name: partial_key required: true schema: type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: When set to true, forces the upsert to override existing content regardless of environment restrictions. This bypasses the development-only environment check and origin environment checks. in: query name: force required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to commit the resource at the same time as modifying it. in: query name: commit required: false schema: type: boolean x-struct: null x-validate: null - description: The message to commit the resource with, only used if `commit` is `true`. in: query name: commit_message required: false schema: type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the PartialRequest request under the partial key. example: partial: content:Hello, world!
description: This is a test partial input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text name: My Partial type: html visual_block_enabled: true properties: partial: $ref: '#/components/schemas/PartialRequest' required: - partial title: WrappedPartialRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Partial response under the `partial` key. example: partial: content:Hello, world!
description: This is a test partial environment: development icon_name: icon-name input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text inserted_at: '2021-01-01T00:00:00Z' key: my-partial name: My Partial type: html updated_at: '2021-01-01T00:00:00Z' valid: true visual_block_enabled: true properties: partial: $ref: '#/components/schemas/Partial' required: - partial title: WrappedPartialResponse type: object x-struct: null x-validate: null description: OK summary: Upsert a partial tags: - Partials /v1/channels: get: callbacks: {} description: 'Returns a paginated list of channels. Note: the list of channels is across the entire account, not scoped to an environment.' operationId: listChannels parameters: - description: A channel id to filter the results by. in: query name: id required: false schema: format: uuid type: string x-struct: null x-validate: null - description: Associated resources to include in the response. Accepts `environment_settings` to include per-environment channel configuration. in: query name: include required: false schema: items: enum: - environment_settings type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Channel. Contains a list of entries and page information. example: entries: - archived_at: null created_at: '2021-01-01T00:00:00Z' custom_icon_url: null id: 01234567-89ab-cdef-0123-456789abcdef key: my-sendgrid-channel name: My Sendgrid Channel provider: sendgrid type: email updated_at: '2021-01-01T00:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Channel' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedChannelResponse type: object x-struct: null x-validate: null description: OK summary: List channels tags: - Channels /v1/members/{id}: delete: callbacks: {} description: Removes a member from the account. operationId: removeMember parameters: - description: The ID of the member to remove. in: path name: id required: true schema: format: uuid type: string x-struct: null x-validate: null responses: '204': description: No Content summary: Remove a member tags: - Members get: callbacks: {} description: Returns a single member by their ID. operationId: getMember parameters: - description: The ID of the member to retrieve. in: path name: id required: true schema: format: uuid type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Member' description: OK summary: Get a member tags: - Members /v1/email_layouts/{email_layout_key}: get: callbacks: {} description: Retrieve an email layout by its key, in a given environment. operationId: getEmailLayout parameters: - description: The key of the email layout to show. in: path name: email_layout_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/EmailLayout' description: OK summary: Get email layout tags: - Email layouts put: callbacks: {} description: 'Updates an email layout, or creates a new one if it does not yet exist. Note: this endpoint only operates in the "development" environment. ' operationId: upsertEmailLayout parameters: - description: The key of the email layout to upsert. in: path name: email_layout_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: When set to true, forces the upsert to override existing content regardless of environment restrictions. This bypasses the development-only environment check and origin environment checks. in: query name: force required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to commit the resource at the same time as modifying it. in: query name: commit required: false schema: type: boolean x-struct: null x-validate: null - description: The message to commit the resource with, only used if `commit` is `true`. in: query name: commit_message required: false schema: type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the EmailLayoutRequest request under the email_layout key. example: email_layout: footer_links: - text: Example url: http://example.com html_layout: Hello, world! name: Transactional text_layout: Hello, world! properties: email_layout: $ref: '#/components/schemas/EmailLayoutRequest' required: - email_layout title: WrappedEmailLayoutRequestRequest type: object x-struct: null x-validate: null description: Email layout required: false responses: '200': content: application/json: schema: description: Wraps the EmailLayout response under the `email_layout` key. example: email_layout: created_at: '2021-01-01T00:00:00Z' environment: development footer_links: - text: Example url: http://example.com html_layout: Hello, world! key: transactional name: Transactional sha: '1234567890' text_layout: Hello, world! updated_at: '2021-01-01T00:00:00Z' properties: email_layout: $ref: '#/components/schemas/EmailLayout' required: - email_layout title: WrappedEmailLayoutResponse type: object x-struct: null x-validate: null description: OK summary: Upsert email layout tags: - Email layouts /v1/channel_groups: get: callbacks: {} description: 'Returns a paginated list of channel groups. Note: the list of channel groups is across the entire account, not scoped to an environment.' operationId: listChannelGroups parameters: - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of ChannelGroup. Contains a list of entries and page information. example: entries: - channel_rules: - channel: archived_at: null created_at: '2021-01-01T00:00:00Z' custom_icon_url: null id: 01234567-89ab-cdef-0123-456789abcdef key: my-sendgrid-channel name: My Sendgrid Channel provider: sendgrid type: email updated_at: '2021-01-01T00:00:00Z' created_at: '2021-01-01T00:00:00Z' index: 0 rule_type: always updated_at: '2021-01-01T00:00:00Z' channel_type: push created_at: '2021-01-01T00:00:00Z' key: push-group name: Push Notification Group operator: any source: user updated_at: '2021-01-01T00:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/ChannelGroup' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedChannelGroupResponse type: object x-struct: null x-validate: null description: OK summary: List channel groups tags: - Channel Groups /v1/workflows: get: callbacks: {} description: Returns a paginated list of workflows available in a given environment. The workflows are returned alphabetically by `key`. operationId: listWorkflows parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Workflow. Contains a list of entries and page information. example: entries: - active: false categories: - marketing - black-friday conditions: all: - argument: admin operator: equal_to variable: recipient.role created_at: '2022-12-16T19:07:50.027113Z' description: This is a dummy workflow for demo purposes. environment: development key: december-16-demo name: december-16-demo settings: override_preferences: true sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y steps: - channel_key: in-app-feed channel_type: in_app_feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ data.onboarding_url }}' markdown_body: Hello **{{ recipient.name }}**. Click here to get started. type: channel - ref: delay_1 settings: delay_for: unit: hours value: 1 type: delay - channel_key: postmark channel_type: email ref: email_1 template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }}! type: channel trigger_data_json_schema: properties: onboarding_url: type: string required: - onboarding_url type: object trigger_frequency: every_trigger updated_at: '2023-02-08T22:15:19.846681Z' valid: true page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Workflow' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedWorkflowResponse type: object x-struct: null x-validate: null description: OK summary: List workflows tags: - Workflows /v1/broadcasts: get: callbacks: {} description: Returns a paginated list of broadcasts available in a given environment. The broadcasts are returned ordered by creation time (newest first). operationId: listBroadcasts parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Broadcast. Contains a list of entries and page information. example: entries: - categories: - marketing - promotions created_at: '2022-12-16T19:07:50.027113Z' description: Holiday promotion broadcast for December environment: development key: december-promotion name: December Promotion scheduled_at: null sent_at: null settings: is_commercial: true override_preferences: false sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y status: draft steps: - channel_key: in-app-feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: premium-users updated_at: '2023-02-08T22:15:19.846681Z' valid: true page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Broadcast' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedBroadcastResponse type: object x-struct: null x-validate: null description: OK summary: List broadcasts tags: - Broadcasts /v1/translations/{locale_code}/validate: put: callbacks: {} description: 'Validates a translation payload without persisting it. Note: this endpoint only operates on translations in the "development" environment. ' operationId: validateTranslation parameters: - description: The translation's locale code. in: path name: locale_code required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the TranslationRequest request under the translation key. example: translation: content: '{"hello":"Hello, world!"}' format: json properties: translation: $ref: '#/components/schemas/TranslationRequest' required: - translation title: WrappedTranslationRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Translation response under the `translation` key. example: translation: content: '{"hello":"Hello, world!"}' format: json inserted_at: '2021-01-01T00:00:00Z' locale_code: en namespace: my_app updated_at: '2021-01-01T00:00:00Z' properties: translation: $ref: '#/components/schemas/Translation' required: - translation title: WrappedTranslationResponse type: object x-struct: null x-validate: null description: OK summary: Validate translation tags: - Translations /v1/whoami: get: callbacks: {} description: Return information about the current calling scope. Will either be a service token or from an OAuth context. operationId: getWhoami parameters: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/WhoamiResponse' description: OK summary: Verify scope tags: - Accounts /v1/audiences/{audience_key}: delete: callbacks: {} description: Archives a given audience across all environments. operationId: archiveAudience parameters: - description: The key of the audience to archive. in: path name: audience_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: description: The response from archiving an audience. example: result: success properties: result: description: The result of the archive operation. example: success type: string x-struct: null x-validate: null required: - result title: ArchiveAudienceResponse type: object x-struct: null x-validate: null description: OK summary: Archive an audience tags: - Audiences get: callbacks: {} description: Retrieve an audience by its key in a given environment. operationId: getAudience parameters: - description: The key of the audience to retrieve. in: path name: audience_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Audience' description: OK summary: Get an audience tags: - Audiences put: callbacks: {} description: Updates an audience of a given key, or creates a new one if it does not yet exist. operationId: upsertAudience parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The key of the audience to upsert. in: path name: audience_key required: true schema: type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: When set to true, forces the upsert to override existing content regardless of environment restrictions. This bypasses the development-only environment check and origin environment checks. in: query name: force required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to commit the resource at the same time as modifying it. in: query name: commit required: false schema: type: boolean x-struct: null x-validate: null - description: The message to commit the resource with, only used if `commit` is `true`. in: query name: commit_message required: false schema: type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the AudienceRequest request under the audience key. example: audience: description: Users on the premium plan name: Premium users segments: - conditions: - argument: premium operator: equal_to property: recipient.plan type: dynamic properties: audience: $ref: '#/components/schemas/AudienceRequest' required: - audience title: WrappedAudienceRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Audience response under the `audience` key. example: audience: created_at: '2024-01-15T10:30:00Z' description: Customers who signed up in the last 30 days. environment: development key: new-customers name: New customers segments: - conditions: - argument: 30_days_ago operator: greater_than property: recipient.created_at sha: a1b2c3d4e5f6 type: dynamic updated_at: '2024-06-20T14:45:00Z' properties: audience: $ref: '#/components/schemas/Audience' required: - audience title: WrappedAudienceResponse type: object x-struct: null x-validate: null description: OK summary: Upsert an audience tags: - Audiences /v1/commits/{id}: get: callbacks: {} description: Retrieve a single commit by its ID. operationId: getCommit parameters: - description: The id of the commit to retrieve. in: path name: id required: true schema: format: uuid type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Commit' description: OK summary: Get a commit tags: - Commits /v1/audiences/{audience_key}/validate: put: callbacks: {} description: Validates an audience payload without persisting it. operationId: validateAudience parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The key of the audience to validate. in: path name: audience_key required: true schema: type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the AudienceRequest request under the audience key. example: audience: description: Users on the premium plan name: Premium users segments: - conditions: - argument: premium operator: equal_to property: recipient.plan type: dynamic properties: audience: $ref: '#/components/schemas/AudienceRequest' required: - audience title: WrappedAudienceRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Audience response under the `audience` key. example: audience: created_at: '2024-01-15T10:30:00Z' description: Customers who signed up in the last 30 days. environment: development key: new-customers name: New customers segments: - conditions: - argument: 30_days_ago operator: greater_than property: recipient.created_at sha: a1b2c3d4e5f6 type: dynamic updated_at: '2024-06-20T14:45:00Z' properties: audience: $ref: '#/components/schemas/Audience' required: - audience title: WrappedAudienceResponse type: object x-struct: null x-validate: null description: OK summary: Validate an audience tags: - Audiences /v1/variables: get: callbacks: {} description: Returns a list of variables. When an environment is specified, returns per-environment variables. Otherwise, returns project-scoped variables with per-environment overrides. operationId: listVariables parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Filter variables by type. Supports 'public' or 'secret'. in: query name: type required: false schema: enum: - public - secret type: string x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Variable. Contains a list of entries and page information. example: entries: - description: This is a description of my variable. environment_values: development: dev_value production: prod_value inserted_at: '2021-01-01T00:00:00Z' key: my_variable type: public updated_at: '2021-01-01T00:00:00Z' value: my_value page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Variable' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedVariableResponse type: object x-struct: null x-validate: null description: OK summary: List variables tags: - Variables /v1/workflows/{workflow_key}/activate: put: callbacks: {} description: 'Activates (or deactivates) a workflow in a given environment. Read more in the [docs](https://docs.knock.app/concepts/workflows#workflow-status). Note: This immediately enables or disables a workflow in a given environment without needing to go through environment promotion. ' operationId: activateWorkflow parameters: - description: The key of the workflow. in: path name: workflow_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: example: status: true properties: status: description: Whether to activate or deactivate the workflow. Set to `true` by default, which will activate the workflow. example: true type: boolean x-struct: null x-validate: null required: - status type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Workflow response under the `workflow` key. example: workflow: active: false categories: - marketing - black-friday conditions: all: - argument: admin operator: equal_to variable: recipient.role created_at: '2022-12-16T19:07:50.027113Z' description: This is a dummy workflow for demo purposes. environment: development key: december-16-demo name: december-16-demo settings: override_preferences: true sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y steps: - channel_key: in-app-feed channel_type: in_app_feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ data.onboarding_url }}' markdown_body: Hello **{{ recipient.name }}**. Click here to get started. type: channel - ref: delay_1 settings: delay_for: unit: hours value: 1 type: delay - channel_key: postmark channel_type: email ref: email_1 template: html_body:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }}! type: channel trigger_data_json_schema: properties: onboarding_url: type: string required: - onboarding_url type: object trigger_frequency: every_trigger updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: workflow: $ref: '#/components/schemas/Workflow' required: - workflow title: WrappedWorkflowResponse type: object x-struct: null x-validate: null description: OK summary: Activate a workflow tags: - Workflows /v1/partials/{partial_key}/validate: put: callbacks: {} description: 'Validates a partial payload without persisting it. Note: this endpoint only operates on partials in the “development” environment. ' operationId: validatePartial parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The key of the partial to validate. in: path name: partial_key required: true schema: type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the PartialRequest request under the partial key. example: partial: content:Hello, world!
description: This is a test partial input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text name: My Partial type: html visual_block_enabled: true properties: partial: $ref: '#/components/schemas/PartialRequest' required: - partial title: WrappedPartialRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Partial response under the `partial` key. example: partial: content:Hello, world!
description: This is a test partial environment: development icon_name: icon-name input_schema: - key: text_field label: My text field settings: description: A description of the text field max_length: 100 min_length: 10 required: true type: text inserted_at: '2021-01-01T00:00:00Z' key: my-partial name: My Partial type: html updated_at: '2021-01-01T00:00:00Z' valid: true visual_block_enabled: true properties: partial: $ref: '#/components/schemas/Partial' required: - partial title: WrappedPartialResponse type: object x-struct: null x-validate: null description: OK summary: Validate a partial tags: - Partials /v1/message_types/{message_type_key}/validate: put: callbacks: {} description: 'Validates a message type payload without persisting it. Note: this endpoint only operates on message types in the `development` environment. ' operationId: validateMessageType parameters: - description: The key of the message type to validate. in: path name: message_type_key required: true schema: example: email type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the MessageTypeRequest request under the message_type key. example: message_type: description: This is a message type name: My Message Type preview:Hello, {{ recipient.name }}! Welcome to {{ vars.app_name }} Get started here.
settings: layout_key: default subject: Welcome to {{ vars.app_name }}! type: channel trigger_data_json_schema: properties: onboarding_url: type: string required: - onboarding_url type: object trigger_frequency: every_trigger updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: workflow: $ref: '#/components/schemas/Workflow' required: - workflow title: WrappedWorkflowResponse type: object x-struct: null x-validate: null description: OK summary: Upsert a workflow tags: - Workflows /v1/branches/{branch_slug}: delete: callbacks: {} description: Deletes a branch by the `branch_slug`. operationId: deleteBranch parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of the branch to delete. in: path name: branch_slug required: true schema: example: feature-branch type: string x-struct: null x-validate: null responses: '204': description: No Content summary: Delete a branch tags: - Branches get: callbacks: {} description: Returns a single branch by the `branch_slug`. operationId: getBranch parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of the branch to retrieve. in: path name: branch_slug required: true schema: example: feature-branch type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Branch' description: OK summary: Get a branch tags: - Branches post: callbacks: {} description: Creates a new branch off of the development environment with the given slug. operationId: createBranch parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug for the new branch to create. in: path name: branch_slug required: true schema: example: feature-branch type: string x-struct: null x-validate: null responses: '201': content: application/json: schema: $ref: '#/components/schemas/Branch' description: Created summary: Create a branch tags: - Branches /v1/commits/promote: put: callbacks: {} description: Promote all changes across all resources to the target environment from its preceding environment. operationId: promoteAllCommits parameters: - description: 'A 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. ' in: query name: to_environment required: true schema: type: string x-struct: null x-validate: null - description: The slug of the branch to promote all changes from. in: query name: branch required: false schema: type: string x-struct: null x-validate: null - description: Filter 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. in: query name: resource_type required: false schema: oneOf: - enum: - audience - email_layout - guide - message_type - partial - translation - workflow type: string x-struct: null x-validate: null - items: enum: - audience - email_layout - guide - message_type - partial - translation - workflow type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null x-struct: null x-validate: null - description: Filter commits to promote by resource identifier. Must be used together with resource_type. in: query name: resource_id required: false schema: type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: description: The response from promoting all changes. example: result: success properties: result: description: The result of the promote operation. example: success type: string x-struct: null x-validate: null required: - result title: PromoteAllResponse type: object x-struct: null x-validate: null description: OK summary: Promote all changes tags: - Commits /v1/commits: get: callbacks: {} description: Returns a paginated list of commits in a given environment. The commits are ordered from most recent first. operationId: listCommits parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to show commits in the given environment that have not been promoted to the subsequent environment (false) or commits which have been promoted (true). in: query name: promoted required: false schema: type: boolean x-struct: null x-validate: null - description: Filter commits by resource type(s). Accepts a single type or array of types. Can be combined with resource_id to filter for specific resources. in: query name: resource_type required: false schema: oneOf: - enum: - audience - email_layout - guide - message_type - partial - translation - workflow type: string x-struct: null x-validate: null - items: enum: - audience - email_layout - guide - message_type - partial - translation - workflow type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null x-struct: null x-validate: null - description: Filter 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`. in: query name: resource_id required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Commit. Contains a list of entries and page information. example: entries: - author: email: john.doe@example.com name: John Doe commit_message: This is a commit message created_at: '2021-01-01T00:00:00Z' environment: development id: 123e4567-e89b-12d3-a456-426614174000 resource: identifier: my-email-layout type: email_layout page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Commit' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedCommitResponse type: object x-struct: null x-validate: null description: OK summary: List commits tags: - Commits put: callbacks: {} description: Commit all changes across all resources in the development environment. operationId: commitAllChanges parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: An optional message to include in a commit. in: query name: commit_message required: false schema: type: string x-struct: null x-validate: null - description: Filter 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. in: query name: resource_type required: false schema: oneOf: - enum: - audience - email_layout - guide - message_type - partial - translation - workflow type: string x-struct: null x-validate: null - items: enum: - audience - email_layout - guide - message_type - partial - translation - workflow type: string x-struct: null x-validate: null type: array x-struct: null x-validate: null x-struct: null x-validate: null - description: Filter changes to commit by resource identifier. Must be used together with resource_type. in: query name: resource_id required: false schema: type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: description: The response from committing all changes. example: result: success properties: result: description: The result of the commit operation. example: success type: string x-struct: null x-validate: null required: - result title: CommitAllResponse type: object x-struct: null x-validate: null description: OK summary: Commit all changes tags: - Commits /v1/audiences: get: callbacks: {} description: Returns a paginated list of audiences for the given environment. operationId: listAudiences parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Audience. Contains a list of entries and page information. example: entries: - created_at: '2024-01-15T10:30:00Z' description: Customers who signed up in the last 30 days. environment: development key: new-customers name: New customers segments: - conditions: - argument: 30_days_ago operator: greater_than property: recipient.created_at sha: a1b2c3d4e5f6 type: dynamic updated_at: '2024-06-20T14:45:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Audience' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedAudienceResponse type: object x-struct: null x-validate: null description: OK summary: List audiences tags: - Audiences /v1/members: get: callbacks: {} description: Returns a paginated list of members for the current account. Optionally filter by role. operationId: listMembers parameters: - description: 'Filter members by role. One of: owner, admin, member, production_only_member, billing, support.' in: query name: role required: false schema: type: string x-struct: null x-validate: null - description: Filter members by email address (exact match). in: query name: email required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of Member. Contains a list of entries and page information. example: entries: - created_at: '2024-01-15T10:30:00Z' id: d4b8e8e0-1234-5678-9abc-def012345678 role: admin updated_at: '2024-06-20T14:45:00Z' user: avatar_url: https://www.gravatar.com/avatar/abc123 created_at: '2024-01-10T08:00:00Z' email: jane@example.com id: a1b2c3d4-5678-9abc-def0-123456789abc name: Jane Doe updated_at: '2024-06-18T12:00:00Z' page_info: after: null before: null page_size: 25 properties: entries: description: A list of entries. items: $ref: '#/components/schemas/Member' nullable: false type: array x-struct: null x-validate: null page_info: $ref: '#/components/schemas/PageInfo' required: - entries - page_info title: PaginatedMemberResponse type: object x-struct: null x-validate: null description: OK summary: List members tags: - Members /v1/api_keys/exchange: post: callbacks: {} description: Given 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. operationId: exchangeForApiKey parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null responses: '200': content: application/json: schema: description: Returns an API key that can be used to make requests to the public API. example: api_key: sk_1234567890 properties: api_key: description: The secret API key exchanged from the service token. type: string x-struct: null x-validate: null required: - api_key title: ExchangeForApiKeyResponse type: object x-struct: null x-validate: null description: OK summary: Exchange for API key tags: - API keys /v1/broadcasts/{broadcast_key}: get: callbacks: {} description: Get a broadcast by its key in a given environment. operationId: getBroadcast parameters: - description: The key of the broadcast to retrieve. in: path name: broadcast_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null responses: '200': content: application/json: schema: $ref: '#/components/schemas/Broadcast' description: OK summary: Get a broadcast tags: - Broadcasts put: callbacks: {} description: 'Updates a broadcast of a given key, or creates a new one if it does not yet exist. ' operationId: upsertBroadcast parameters: - description: The key of the broadcast. in: path name: broadcast_key required: true schema: type: string x-struct: null x-validate: null - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null requestBody: content: application/json: schema: description: Wraps the BroadcastRequest request under the broadcast key. example: broadcast: categories: - announcement description: A broadcast to all users name: My Broadcast settings: is_commercial: true override_preferences: false steps: - channel_key: in-app-feed name: Channel 1 ref: channel_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: all-users properties: broadcast: $ref: '#/components/schemas/BroadcastRequest' required: - broadcast title: WrappedBroadcastRequestRequest type: object x-struct: null x-validate: null description: Params required: false responses: '200': content: application/json: schema: description: Wraps the Broadcast response under the `broadcast` key. example: broadcast: categories: - marketing - promotions created_at: '2022-12-16T19:07:50.027113Z' description: Holiday promotion broadcast for December environment: development key: december-promotion name: December Promotion scheduled_at: null sent_at: null settings: is_commercial: true override_preferences: false sha: f7e9d3b2a1c8e6m4k5j7h9g0i2l3n4p6q8r0t1u3v5w7x9y status: draft steps: - channel_key: in-app-feed description: Main in-app feed name: In-app step ref: in_app_feed_1 template: action_url: '{{ vars.app_url }}' markdown_body: Hello **{{ recipient.name }}** type: channel target_audience_key: premium-users updated_at: '2023-02-08T22:15:19.846681Z' valid: true properties: broadcast: $ref: '#/components/schemas/Broadcast' required: - broadcast title: WrappedBroadcastResponse type: object x-struct: null x-validate: null description: OK summary: Upsert a broadcast tags: - Broadcasts /v1/message_types: get: callbacks: {} description: Returns a paginated list of message types available in a given environment. operationId: listMessageTypes parameters: - description: The environment slug. in: query name: environment required: true schema: example: development type: string x-struct: null x-validate: null - description: The slug of a branch to use. This option can only be used when `environment` is `"development"`. in: query name: branch required: false schema: example: feature-branch type: string x-struct: null x-validate: null - description: Whether to annotate the resource. Only used in the Knock CLI. in: query name: annotate required: false schema: type: boolean x-struct: null x-validate: null - description: Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned. in: query name: hide_uncommitted_changes required: false schema: type: boolean x-struct: null x-validate: null - description: The cursor to fetch entries after. in: query name: after required: false schema: type: string x-struct: null x-validate: null - description: The cursor to fetch entries before. in: query name: before required: false schema: type: string x-struct: null x-validate: null - description: The number of entries to fetch per-page. in: query name: limit required: false schema: type: integer x-struct: null x-validate: null responses: '200': content: application/json: schema: description: A paginated list of MessageType. Contains a list of entries and page information. example: entries: - archived_at: null created_at: '2021-01-01T00:00:00Z' deleted_at: null description: Email message type environment: development icon_name: email key: email name: Email owner: user preview: