Docs
/
/

Broadcasts Management API reference

Complete reference documentation for the Broadcasts resource.

Broadcasts

#

Broadcasts are a way to send one-time, cross-channel notifications to your users through Knock. They use the Knock workflow engine, but are configured in the Knock dashboard to run once.

Send a broadcast

#

Sends a broadcast immediately or schedules it to send at a future time.

Endpoint

PUT/v1/broadcasts/{broadcast_key}/send

Path parameters

broadcast_key
string

The key of the broadcast.

Query parameters

environment
string

The environment slug.

branch
string

The slug of a branch to use. This option can only be used when environment is "development".

Request body

send_at
string(date-time)

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.

Returns

WrappedBroadcastResponse

Wraps the Broadcast response under the broadcast key.

broadcast

A broadcast object.

archived_at
string(date-time)

The timestamp of when the broadcast was archived.

categories
string[]

A list of categories that the broadcast belongs to.

created_at
string(date-time)

The timestamp of when the broadcast was created. (read-only).

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

environment
string

The slug of the environment in which the broadcast exists. (read-only).

key
string

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_-]+$.

name
string

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

sent_at
string(date-time)

The timestamp of when the broadcast was sent. (read-only).

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

sha
string

The SHA hash of the workflow data. (read-only).

status
enum(string)

The current status of the broadcast. One of: draft, scheduled, sent.

draftscheduledsent
steps
object[]

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

updated_at
string(date-time)

The timestamp of when the broadcast was last updated. (read-only).

valid
boolean

Whether the broadcast and its steps are in a valid state. (read-only).

Validate a broadcast

#

Validates a broadcast payload without persisting it.

Endpoint

PUT/v1/broadcasts/{broadcast_key}/validate

Path parameters

broadcast_key
string

The key of the broadcast.

Query parameters

environment
string

The environment slug.

branch
string

The slug of a branch to use. This option can only be used when environment is "development".

Request body

A broadcast request for upserting a broadcast.

categories
string[]

A list of categories that the broadcast belongs to.

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

name
string
Required

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

steps
object[]
Required

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

Returns

WrappedBroadcastResponse

Wraps the Broadcast response under the broadcast key.

broadcast

A broadcast object.

archived_at
string(date-time)

The timestamp of when the broadcast was archived.

categories
string[]

A list of categories that the broadcast belongs to.

created_at
string(date-time)

The timestamp of when the broadcast was created. (read-only).

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

environment
string

The slug of the environment in which the broadcast exists. (read-only).

key
string

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_-]+$.

name
string

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

sent_at
string(date-time)

The timestamp of when the broadcast was sent. (read-only).

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

sha
string

The SHA hash of the workflow data. (read-only).

status
enum(string)

The current status of the broadcast. One of: draft, scheduled, sent.

draftscheduledsent
steps
object[]

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

updated_at
string(date-time)

The timestamp of when the broadcast was last updated. (read-only).

valid
boolean

Whether the broadcast and its steps are in a valid state. (read-only).

List broadcasts

#

Returns a paginated list of broadcasts available in a given environment. The broadcasts are returned ordered by creation time (newest first).

Endpoint

GET/v1/broadcasts

Query parameters

environment
string

The environment slug.

branch
string

The slug of a branch to use. This option can only be used when environment is "development".

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

limit
integer

The number of entries to fetch per-page.

annotate
boolean

Whether to annotate the resource. Only used in the Knock CLI.

hide_uncommitted_changes
boolean

Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.

Returns

PaginatedBroadcastResponse

A paginated list of Broadcast. Contains a list of entries and page information.

A list of entries.

archived_at
string(date-time)

The timestamp of when the broadcast was archived.

categories
string[]

A list of categories that the broadcast belongs to.

created_at
string(date-time)
Required

The timestamp of when the broadcast was created. (read-only).

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

environment
string
Required

The slug of the environment in which the broadcast exists. (read-only).

key
string
Required

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_-]+$.

name
string
Required

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

sent_at
string(date-time)

The timestamp of when the broadcast was sent. (read-only).

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

sha
string
Required

The SHA hash of the workflow data. (read-only).

status
enum(string)
Required

The current status of the broadcast. One of: draft, scheduled, sent.

draftscheduledsent
steps
object[]
Required

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

updated_at
string(date-time)
Required

The timestamp of when the broadcast was last updated. (read-only).

valid
boolean
Required

Whether the broadcast and its steps are in a valid state. (read-only).

page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

Get a broadcast

#

Get a broadcast by its key in a given environment.

Endpoint

GET/v1/broadcasts/{broadcast_key}

Path parameters

broadcast_key
string

The key of the broadcast to retrieve.

Query parameters

environment
string

The environment slug.

branch
string

The slug of a branch to use. This option can only be used when environment is "development".

annotate
boolean

Whether to annotate the resource. Only used in the Knock CLI.

hide_uncommitted_changes
boolean

Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.

Returns

A broadcast object.

archived_at
string(date-time)

The timestamp of when the broadcast was archived.

categories
string[]

A list of categories that the broadcast belongs to.

created_at
string(date-time)

The timestamp of when the broadcast was created. (read-only).

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

environment
string

The slug of the environment in which the broadcast exists. (read-only).

key
string

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_-]+$.

name
string

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

sent_at
string(date-time)

The timestamp of when the broadcast was sent. (read-only).

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

sha
string

The SHA hash of the workflow data. (read-only).

status
enum(string)

The current status of the broadcast. One of: draft, scheduled, sent.

draftscheduledsent
steps
object[]

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

updated_at
string(date-time)

The timestamp of when the broadcast was last updated. (read-only).

valid
boolean

Whether the broadcast and its steps are in a valid state. (read-only).

Upsert a broadcast

#

Updates a broadcast of a given key, or creates a new one if it does not yet exist.

Endpoint

PUT/v1/broadcasts/{broadcast_key}

Path parameters

broadcast_key
string

The key of the broadcast.

Query parameters

environment
string

The environment slug.

branch
string

The slug of a branch to use. This option can only be used when environment is "development".

annotate
boolean

Whether to annotate the resource. Only used in the Knock CLI.

Request body

A broadcast request for upserting a broadcast.

categories
string[]

A list of categories that the broadcast belongs to.

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

name
string
Required

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

steps
object[]
Required

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

Returns

WrappedBroadcastResponse

Wraps the Broadcast response under the broadcast key.

broadcast

A broadcast object.

archived_at
string(date-time)

The timestamp of when the broadcast was archived.

categories
string[]

A list of categories that the broadcast belongs to.

created_at
string(date-time)

The timestamp of when the broadcast was created. (read-only).

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

environment
string

The slug of the environment in which the broadcast exists. (read-only).

key
string

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_-]+$.

name
string

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

sent_at
string(date-time)

The timestamp of when the broadcast was sent. (read-only).

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

sha
string

The SHA hash of the workflow data. (read-only).

status
enum(string)

The current status of the broadcast. One of: draft, scheduled, sent.

draftscheduledsent
steps
object[]

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

updated_at
string(date-time)

The timestamp of when the broadcast was last updated. (read-only).

valid
boolean

Whether the broadcast and its steps are in a valid state. (read-only).

Cancel a scheduled broadcast

#

Cancels sending a scheduled broadcast. The broadcast will return to draft status.

Endpoint

PUT/v1/broadcasts/{broadcast_key}/cancel

Path parameters

broadcast_key
string

The key of the broadcast.

Query parameters

environment
string

The environment slug.

branch
string

The slug of a branch to use. This option can only be used when environment is "development".

Returns

WrappedBroadcastResponse

Wraps the Broadcast response under the broadcast key.

broadcast

A broadcast object.

archived_at
string(date-time)

The timestamp of when the broadcast was archived.

categories
string[]

A list of categories that the broadcast belongs to.

created_at
string(date-time)

The timestamp of when the broadcast was created. (read-only).

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

environment
string

The slug of the environment in which the broadcast exists. (read-only).

key
string

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_-]+$.

name
string

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

sent_at
string(date-time)

The timestamp of when the broadcast was sent. (read-only).

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

sha
string

The SHA hash of the workflow data. (read-only).

status
enum(string)

The current status of the broadcast. One of: draft, scheduled, sent.

draftscheduledsent
steps
object[]

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

updated_at
string(date-time)

The timestamp of when the broadcast was last updated. (read-only).

valid
boolean

Whether the broadcast and its steps are in a valid state. (read-only).

BroadcastRequest

#

A broadcast request for upserting a broadcast.

Attributes

categories
string[]

A list of categories that the broadcast belongs to.

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

name
string

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

steps
object[]

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

Broadcast

#

A broadcast object.

Attributes

archived_at
string(date-time)

The timestamp of when the broadcast was archived.

categories
string[]

A list of categories that the broadcast belongs to.

created_at
string(date-time)

The timestamp of when the broadcast was created. (read-only).

description
string

An arbitrary string attached to a broadcast object. Useful for adding notes about the broadcast for internal purposes. Maximum of 280 characters allowed.

environment
string

The slug of the environment in which the broadcast exists. (read-only).

key
string

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_-]+$.

name
string

A name for the broadcast. Must be at maximum 255 characters in length.

scheduled_at
string(date-time)

The timestamp of when the broadcast is scheduled to be sent.

sent_at
string(date-time)

The timestamp of when the broadcast was sent. (read-only).

settings
object

A map of broadcast settings.

is_commercial
boolean

Whether the broadcast is commercial. Defaults to true.

override_preferences
boolean

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.

sha
string

The SHA hash of the workflow data. (read-only).

status
enum(string)

The current status of the broadcast. One of: draft, scheduled, sent.

draftscheduledsent
steps
object[]

A list of broadcast step objects in the broadcast. Broadcasts only support channel, branch, and delay steps.

target_audience_key
string

The key of the audience to target for this broadcast.

updated_at
string(date-time)

The timestamp of when the broadcast was last updated. (read-only).

valid
boolean

Whether the broadcast and its steps are in a valid state. (read-only).

New chat