Docs
/
/

Guides Management API reference

Complete reference documentation for the Guides resource.

Guides

#

Guides let you define in-app messaging for your users, powered by your own components.

List guides

#

Returns a paginated list of guides available in a given environment.

Endpoint

GET/v1/guides

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.

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.

Returns

PaginatedGuideResponse

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

entries

A list of entries.

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

active
boolean
Required

Whether the guide is active.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string

The key of the channel in which the guide exists.

created_at
string(date-time)
Required

The timestamp of when the guide was created.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

environment
string
Required

The slug of the environment in which the guide exists.

key
string
Required

The unique key string for the guide object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.

name
string
Required

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

semver
string

The semver of the guide.

sha
string
Required

The SHA hash of the guide.

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

type
string

The type of the guide. This is derived from the message type of the guide steps.

updated_at
string(date-time)
Required

The timestamp of when the guide was last updated.

valid
boolean

Whether the guide is valid.

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 guide

#

Get a guide by its key.

Endpoint

GET/v1/guides/{guide_key}

Path parameters

guide_key
string

The key of the guide 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 guide defines an in-app guide that can be displayed to users based on priority and other conditions.

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

active
boolean

Whether the guide is active.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string

The key of the channel in which the guide exists.

created_at
string(date-time)

The timestamp of when the guide was created.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

environment
string

The slug of the environment in which the guide exists.

key
string

The unique key string for the guide object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.

name
string

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

semver
string

The semver of the guide.

sha
string

The SHA hash of the guide.

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

type
string

The type of the guide. This is derived from the message type of the guide steps.

updated_at
string(date-time)

The timestamp of when the guide was last updated.

valid
boolean

Whether the guide is valid.

Archive a guide

#

Archives a given guide across all environments.

Endpoint

DELETE/v1/guides/{guide_key}

Path parameters

guide_key
string

The key of the guide to archive.

Returns

ArchiveGuideResponse

The response from archiving a guide.

result
string

The result of the promote operation.

Upsert a guide

#

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

Note: this endpoint only operates on guides in the "development" environment.

Endpoint

PUT/v1/guides/{guide_key}

Path parameters

guide_key
string

The key of the guide to upsert.

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.

commit
boolean

Whether to commit the resource at the same time as modifying it.

commit_message
string

The message to commit the resource with, only used if commit is true.

Request body

guide
GuideRequest

A request to create or update a guide.

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string
Required

The key of the channel in which the guide exists.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

name
string
Required

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

stepsRequired

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

Returns

WrappedGuideResponse

Wraps the Guide response under the guide key.

guide

A guide defines an in-app guide that can be displayed to users based on priority and other conditions.

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

active
boolean

Whether the guide is active.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string

The key of the channel in which the guide exists.

created_at
string(date-time)

The timestamp of when the guide was created.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

environment
string

The slug of the environment in which the guide exists.

key
string

The unique key string for the guide object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.

name
string

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

semver
string

The semver of the guide.

sha
string

The SHA hash of the guide.

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

type
string

The type of the guide. This is derived from the message type of the guide steps.

updated_at
string(date-time)

The timestamp of when the guide was last updated.

valid
boolean

Whether the guide is valid.

Validate a guide

#

Validates a guide payload without persisting it.

Note: Validating a guide is only done in the development environment context.

Endpoint

PUT/v1/guides/{guide_key}/validate

Path parameters

guide_key
string

The key of the guide.

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

guide
GuideRequest

A request to create or update a guide.

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string
Required

The key of the channel in which the guide exists.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

name
string
Required

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

stepsRequired

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

Returns

WrappedGuideResponse

Wraps the Guide response under the guide key.

guide

A guide defines an in-app guide that can be displayed to users based on priority and other conditions.

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

active
boolean

Whether the guide is active.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string

The key of the channel in which the guide exists.

created_at
string(date-time)

The timestamp of when the guide was created.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

environment
string

The slug of the environment in which the guide exists.

key
string

The unique key string for the guide object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.

name
string

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

semver
string

The semver of the guide.

sha
string

The SHA hash of the guide.

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

type
string

The type of the guide. This is derived from the message type of the guide steps.

updated_at
string(date-time)

The timestamp of when the guide was last updated.

valid
boolean

Whether the guide is valid.

Activate a guide

#

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.

Endpoint

PUT/v1/guides/{guide_key}/activate

Path parameters

guide_key
string

The key of the guide.

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

GuideActivationParams
2 possible types

A request to activate or schedule the activation of a guide.

Returns

WrappedGuideResponse

Wraps the Guide response under the guide key.

guide

A guide defines an in-app guide that can be displayed to users based on priority and other conditions.

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

active
boolean

Whether the guide is active.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string

The key of the channel in which the guide exists.

created_at
string(date-time)

The timestamp of when the guide was created.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

environment
string

The slug of the environment in which the guide exists.

key
string

The unique key string for the guide object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.

name
string

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

semver
string

The semver of the guide.

sha
string

The SHA hash of the guide.

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

type
string

The type of the guide. This is derived from the message type of the guide steps.

updated_at
string(date-time)

The timestamp of when the guide was last updated.

valid
boolean

Whether the guide is valid.

Guide

#

A guide defines an in-app guide that can be displayed to users based on priority and other conditions.

Attributes

activation_url_patterns

A list of activation url patterns that describe when the guide should be shown.

directive
enum(string)
Required

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string
Required

The URL pathname pattern to match against. Must be a valid URI path.

active
boolean

Whether the guide is active.

archived_at
string(date-time)

The timestamp of when the guide was archived.

channel_key
string

The key of the channel in which the guide exists.

created_at
string(date-time)

The timestamp of when the guide was created.

deleted_at
string(date-time)

The timestamp of when the guide was deleted.

description
string

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

environment
string

The slug of the environment in which the guide exists.

key
string

The unique key string for the guide object. Must be at minimum 3 characters and at maximum 255 characters in length. Must be in the format of ^[a-z0-9_-]+$.

name
string

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

semver
string

The semver of the guide.

sha
string

The SHA hash of the guide.

A list of guide step objects in the guide.

name
string

A name for the step.

ref
string
Required

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

schema_key
string
Required

The key of the template schema to use for this step.

schema_semver
string
Required

The semantic version of the template schema to use.

schema_variant_key
string
Required

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

target_audience_id
string

The ID of the target audience for the guide. When not set, will default to targeting all users.

target_property_conditions

A conditions object that describes one or more conditions to be met for the guide to be shown to an audience member.

type
string

The type of the guide. This is derived from the message type of the guide steps.

updated_at
string(date-time)

The timestamp of when the guide was last updated.

valid
boolean

Whether the guide is valid.

GuideStep

#

A step in a guide that corresponds to a piece of UI and its content.

Attributes

name
string

A name for the step.

ref
string

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

schema_key
string

The key of the template schema to use for this step.

schema_semver
string

The semantic version of the template schema to use.

schema_variant_key
string

The key of the template schema variant to use.

values
object(any)

A map of values that make up the step's content. Each value must conform to its respective template schema field settings.

GuideActivationUrlPattern

#

A rule that controls when a guide should be shown based on the user's location in the application.

Attributes

directive
enum(string)

Whether to allow or block the guide at the specified pathname.

allowblock
pathname
string

The URL pathname pattern to match against. Must be a valid URI path.

New chat