Docs
/
/

Users

A [User](/concepts/users) represents an individual in your system who can receive notifications through Knock. Users are the most common recipients of notifications and are always referenced by your internal identifier.

Get user

#

Retrieve a specific user by their ID.

Endpoint

GET/v1/users/{user_id}

Rate limit

Tier 4

Path parameters

user_id
string

The ID of the user to retrieve.

Returns

A User represents an individual in your system who can receive notifications through Knock. Users are the most common recipients of notifications and are always referenced by your internal identifier.

__typename
string

The typename of the schema.

avatar
string

A URL for the avatar of the user.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

id
string

The unique identifier of the user.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

updated_at
string(date-time)

The timestamp when the resource was last updated.

*
object(any)

Any additional custom properties.

List users

#

Retrieve a paginated list of users in the environment. Defaults to 50 users per page.

Endpoint

GET/v1/users

Rate limit

Tier 4

Query parameters

include[]
enum(string)[]

Associated resources to include in the response.

preferences
after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

Returns

ListUsersResponse

A paginated list of users.

entries

A list of users.

__typename
string
Required

The typename of the schema.

avatar
string

A URL for the avatar of the user.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

id
string
Required

The unique identifier of the user.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

updated_at
string(date-time)
Required

The timestamp when the resource was last updated.

page_info

Pagination information for a list of resources.

__typename
string

The typename of the schema.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

Identify user

#

Create or update a user with the provided identification data. When you identify an existing user, the system merges the properties you specific with what is currently set on the user, updating only the fields included in your requests.

Endpoint

PUT/v1/users/{user_id}

Rate limit

Tier 3

Path parameters

user_id
string

The unique identifier of the user.

Request body

avatar
string

A URL for the avatar of the user.

Channel-specific information that's needed to deliver a notification to an end provider.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

locale
string

The locale of the user. Used for message localization.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

A set of preferences for the user.

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

*
object(any)

Any additional custom properties.

Returns

A User represents an individual in your system who can receive notifications through Knock. Users are the most common recipients of notifications and are always referenced by your internal identifier.

__typename
string

The typename of the schema.

avatar
string

A URL for the avatar of the user.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

id
string

The unique identifier of the user.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

updated_at
string(date-time)

The timestamp when the resource was last updated.

*
object(any)

Any additional custom properties.

Merge users

#

Merge two users together, where the user specified with the from_user_id param will be merged into the user specified by user_id.

Endpoint

POST/v1/users/{user_id}/merge

Rate limit

Tier 2

Path parameters

user_id
string

The id of the user to merge into.

Request body

from_user_id
string
Required

The user ID to merge from.

Returns

A User represents an individual in your system who can receive notifications through Knock. Users are the most common recipients of notifications and are always referenced by your internal identifier.

__typename
string

The typename of the schema.

avatar
string

A URL for the avatar of the user.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

id
string

The unique identifier of the user.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

updated_at
string(date-time)

The timestamp when the resource was last updated.

*
object(any)

Any additional custom properties.

Delete user

#

Permanently delete a user and all associated data.

Endpoint

DELETE/v1/users/{user_id}

Rate limit

Tier 2

Path parameters

user_id
string

The ID of the user to delete.

Returns

204 No Content

List user messages

#

Returns a paginated list of messages for a specific user. Messages are sorted with the most recent ones appearing first. Messages outside the account's retention window will not be included in the results.

Endpoint

GET/v1/users/{user_id}/messages

Rate limit

Tier 4

Path parameters

user_id
string

The user ID to list messages for.

Query parameters

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

tenant
string

Limits the results to items with the corresponding tenant.

channel_id
string

Limits the results to items with the corresponding channel ID.

status[]
enum(string)[]

Limits the results to messages with the given delivery status.

queuedsentdelivereddelivery_attemptedundeliverednot_sentbounced
engagement_status[]
enum(string)[]

Limits the results to messages with the given engagement status.

seenunseenreadunreadarchivedunarchivedlink_clickedinteracted
message_ids[]
string[]

Limits the results to only the message IDs given (max 50). Note: when using this option, the results will be subject to any other filters applied to the query.

workflow_categories[]
string[]

Limits the results to messages related to any of the provided categories.

source
string

Limits the results to messages triggered by the given workflow key.

workflow_run_id
string(uuid)

Limits the results to messages associated with the top-level workflow run ID returned by the workflow trigger request.

workflow_recipient_run_id
string(uuid)

Limits the results to messages for a specific recipient's workflow run.

trigger_data
string

Limits the results to only messages that were generated with the given data. See trigger data filtering for more information.

inserted_at.gte
string

Limits the results to messages inserted after or on the given date.

inserted_at.lte
string

Limits the results to messages inserted before or on the given date.

inserted_at.gt
string

Limits the results to messages inserted after the given date.

inserted_at.lt
string

Limits the results to messages inserted before the given date.

Returns

ListMessagesResponse

A paginated list of messages.

A list of messages.

__typename
string
Required

The typename of the schema.

One or more actors that are associated with this message. Note: this is a list that can contain up to 10 actors if the message is produced from a batch.

archived_at
string(date-time)

Timestamp when the message was archived.

channel
object

A configured channel, which is a way to route messages to a provider.

created_at
string(date-time)
Required

The timestamp of when the channel was created.

id
string
Required

The unique identifier for the channel.

key
string

Unique identifier for the channel within a project (immutable once created).

name
string

The human-readable name of the channel.

provider
string
Required

The ID of the provider that this channel uses to deliver messages.

type
enum(string)
Required

The type of channel, determining what kind of messages it can send.

emailin_appin_app_feedin_app_guidesmspushchathttp
updated_at
string(date-time)
Required

The timestamp of when the channel was last updated.

channel_id
string(uuid)
Required

Deprecated, use channel.id instead.

clicked_at
string(date-time)

Timestamp when the message was clicked.

data
object(any)

Data associated with the message’s workflow run. Includes the workflow trigger request’s data payload merged with any additional data returned by a fetch function. For messages produced after a batch step, includes the payload data from the most-recent trigger request (the final activity in the batch).

engagement_statuses
enum(string)[]
Required

A list of engagement statuses.

seenreadinteractedlink_clickedarchived
id
string
Required

The unique identifier for the message.

inserted_at
string(date-time)
Required

Timestamp when the resource was created.

interacted_at
string(date-time)

Timestamp when the message was interacted with.

link_clicked_at
string(date-time)

Timestamp when a link in the message was clicked.

metadata
object(any)

The metadata associated with the message.

read_at
string(date-time)

Timestamp when the message was read.

recipient
2 possible types
Required

A reference to a recipient, either a user identifier (string) or an object reference (ID, collection).

scheduled_at
string(date-time)

Timestamp when the message was scheduled to be sent.

seen_at
string(date-time)

Timestamp when the message was seen.

source
object
Required

The workflow or guide that triggered the message.

__typename
string
Required
categories
string[]
Required

The categories associated with the message.

key
string
Required

The key of the workflow or guide that triggered the message.

step_ref
string

The step reference for the step in the workflow that generated the message.

type
enum(string)

Whether this message was generated from a workflow, broadcast, or guide.

broadcastworkflowguide
version_id
string(uuid)
Required

The ID of the version of the workflow or guide that triggered the message.

workflow_recipient_run_id
string(uuid)

The unique identifier for the workflow recipient run that generated this message. Only present for workflow/broadcast messages.

workflow_run_id
string(uuid)

The unique identifier for the workflow run that generated this message. Only present for workflow/broadcast messages.

status
enum(string)
Required

The message delivery status.

queuedsentdelivereddelivery_attemptedundeliverednot_sentbounced
tenant
string

The ID of the tenant associated with the message. Only present when a tenant is provided on a workflow trigger request.

updated_at
string(date-time)
Required

The timestamp when the resource was last updated.

workflow
string

The key of the workflow that generated the message.

page_info

Pagination information for a list of resources.

__typename
string

The typename of the schema.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

List user schedules

#

Returns a paginated list of schedules for a specific user, in descending order.

Endpoint

GET/v1/users/{user_id}/schedules

Rate limit

Tier 4

Path parameters

user_id
string

The user ID to list schedules for.

Query parameters

workflow
string

The workflow key to filter schedules for.

tenant
string

The tenant ID to filter schedules for.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

Returns

ListSchedulesResponse

A response containing a list of schedules.

entries

A list of schedules.

__typename
string

The typename of the schema.

A map of properties describing a user or an object to identify in Knock and mark as who or what performed the action.

data
object(any)

An optional map of data to pass into the workflow execution. There is a 10MB limit on the size of the full data payload. Any individual string value greater than 1024 bytes in length will be truncated in your logs.

id
string(uuid)
Required

Unique identifier for the schedule.

inserted_at
string(date-time)
Required

Timestamp when the resource was created.

last_occurrence_at
string(date-time)

The last occurrence of the schedule.

next_occurrence_at
string(date-time)

The next occurrence of the schedule.

recipient
2 possible types
Required

A recipient of a notification, which is either a user or an object.

repeatsRequired

The repeat rule for the schedule.

__typename
string

The typename of the schema.

day_of_month
integer

The day of the month to repeat the schedule.

days
enum(string)[]

The days of the week to repeat the schedule.

montuewedthufrisatsun
frequency
enum(string)
Required

The frequency of the schedule.

dailyweeklymonthlyhourly
hours
integer

The hour of the day to repeat the schedule.

interval
integer

The interval of the schedule.

minutes
integer

The minute of the hour to repeat the schedule.

tenant
string

The tenant to trigger the workflow for. Triggering with a tenant will use any tenant-level overrides associated with the tenant object, and all messages produced from workflow runs will be tagged with the tenant.

updated_at
string(date-time)
Required

The timestamp when the resource was last updated.

workflow
string
Required

The workflow the schedule is applied to.

page_info

Pagination information for a list of resources.

__typename
string

The typename of the schema.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

List user subscriptions

#

Retrieves a paginated list of subscriptions for a specific user, in descending order.

Endpoint

GET/v1/users/{user_id}/subscriptions

Rate limit

Tier 4

Path parameters

user_id
string

The user ID to list subscriptions for.

Query parameters

include[]
enum(string)[]

Associated resources to include in the response.

preferences

Only returns subscriptions for the specified object references.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

Returns

ListSubscriptionsResponse

A response containing a list of subscriptions.

A list of subscriptions.

__typename
string
Required

The typename of the schema.

inserted_at
string(date-time)
Required

Timestamp when the resource was created.

objectRequired

A custom Object entity which belongs to a collection.

__typename
string
Required

The typename of the schema.

collection
string
Required

The collection this object belongs to.

created_at
string(date-time)

Timestamp when the resource was created.

id
string
Required

Unique identifier for the object.

properties
object(any)

The custom properties associated with the object.

updated_at
string(date-time)
Required

The timestamp when the resource was last updated.

properties
object(any)

The custom properties associated with the subscription relationship.

recipient
2 possible types
Required

A recipient of a notification, which is either a user or an object.

updated_at
string(date-time)
Required

The timestamp when the resource was last updated.

page_info

Pagination information for a list of resources.

__typename
string

The typename of the schema.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

List user preference sets

#

Retrieves a list of all preference sets for a specific user.

Endpoint

GET/v1/users/{user_id}/preferences

Rate limit

Tier 4

Path parameters

user_id
string

The unique identifier of the user.

Returns

ListUserPreferenceSetsResponse

A list of preference sets for the user.

Get user preference set

#

Retrieves a specific preference set for a user identified by the preference set ID.

Endpoint

GET/v1/users/{user_id}/preferences/{id}

Rate limit

Tier 4

Path parameters

user_id
string

The unique identifier of the user.

id
string

Unique identifier for the preference set.

Query parameters

tenant
string

The unique identifier for the tenant.

Returns

A preference set represents a specific set of notification preferences for a recipient. A recipient can have multiple preference sets.

categories
PreferenceSetCategories

An object where the key is the category and the values are the preference settings for that category.

An object where the key is the channel type and the values are the preference settings for that channel type.

channels
PreferenceSetChannels

An object where the key is the channel ID and the values are the preference settings for that channel ID.

commercial_subscribed
boolean

Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications.

id
string

Unique identifier for the preference set.

workflows
PreferenceSetWorkflows

An object where the key is the workflow key and the values are the preference settings for that workflow.

Update user preference set

#

Updates a complete preference set for a user. By default, this is a destructive operation and will replace any existing preferences with the preferences given. Use 'persistence_strategy': 'merge' to merge with existing preferences instead.

Endpoint

PUT/v1/users/{user_id}/preferences/{id}

Rate limit

Tier 3

Path parameters

user_id
string

The unique identifier of the user.

id
string

Unique identifier for the preference set.

Request body

__persistence_strategy__
enum(string)

Controls how the preference set is persisted. 'replace' will completely replace the preference set, 'merge' will merge with existing preferences.

mergereplace
categories
PreferenceSetRequestCategories

An object where the key is the category and the values are the preference settings for that category.

An object where the key is the channel type and the values are the preference settings for that channel type.

channels
PreferenceSetChannels

An object where the key is the channel ID and the values are the preference settings for that channel ID.

commercial_subscribed
boolean

Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications.

workflows
PreferenceSetRequestWorkflows

An object where the key is the workflow key and the values are the preference settings for that workflow.

Returns

A preference set represents a specific set of notification preferences for a recipient. A recipient can have multiple preference sets.

categories
PreferenceSetCategories

An object where the key is the category and the values are the preference settings for that category.

An object where the key is the channel type and the values are the preference settings for that channel type.

channels
PreferenceSetChannels

An object where the key is the channel ID and the values are the preference settings for that channel ID.

commercial_subscribed
boolean

Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications.

id
string

Unique identifier for the preference set.

workflows
PreferenceSetWorkflows

An object where the key is the workflow key and the values are the preference settings for that workflow.

Get channel data

#

Retrieves the channel data for a specific user and channel ID.

Endpoint

GET/v1/users/{user_id}/channel_data/{channel_id}

Rate limit

Tier 4

Path parameters

user_id
string

The unique identifier of the user.

channel_id
string(uuid)

The unique identifier for the channel.

Returns

Channel data for a given channel type.

__typename
string

The typename of the schema.

channel_id
string(uuid)

The unique identifier for the channel.

data
6 possible types

Channel data for a given channel type.

provider
enum(string)

The type of provider.

push_fcmpush_apnspush_aws_snspush_expopush_one_signalchat_slackchat_ms_teamschat_discordhttp_knock_webhook

Set channel data

#

Updates or creates channel data for a specific user and channel ID. If no user exists in the current environment for the given user_id, Knock will create the user entry as part of this request.

Endpoint

PUT/v1/users/{user_id}/channel_data/{channel_id}

Rate limit

Tier 3

Path parameters

user_id
string

The unique identifier of the user.

channel_id
string(uuid)

The unique identifier for the channel.

Request body

data
8 possible types
Required

Channel data for a given channel type.

Returns

Channel data for a given channel type.

__typename
string

The typename of the schema.

channel_id
string(uuid)

The unique identifier for the channel.

data
6 possible types

Channel data for a given channel type.

provider
enum(string)

The type of provider.

push_fcmpush_apnspush_aws_snspush_expopush_one_signalchat_slackchat_ms_teamschat_discordhttp_knock_webhook

Unset channel data

#

Deletes channel data for a specific user and channel ID.

Endpoint

DELETE/v1/users/{user_id}/channel_data/{channel_id}

Rate limit

Tier 3

Path parameters

user_id
string

The unique identifier of the user.

channel_id
string(uuid)

The unique identifier for the channel.

Returns

204 No Content

Feeds

#

A feed exposes the messages delivered to an in-app feed channel, formatted specially to be consumed in a notification feed.

A feed will always return a list of FeedItems, which are pointers to a message delivered and contain all of the information needed in order to render an item within a notification feed.

Note: Feeds are a specialized form of messages that are designed purely for in-app rendering, and as such return information that is required on the client to do so.

List feed items

#

Returns a paginated list of feed items for a user in reverse chronological order, including metadata about the feed. If the user has not yet been identified within Knock, an empty feed will be returned.

You can customize the response using response filters to exclude or only include specific properties on your resources.

Notes:

  • When making this call from a client-side environment, use your publishable key along with a user token.
  • This endpoint’s rate limit is always scoped per-user and per-environment. This is true even for requests made without a signed user token.
  • Any attachments present in trigger data are automatically excluded from both the data and activities fields of UserInAppFeedResponse.

Endpoint

GET/v1/users/{user_id}/feeds/{id}

Rate limit

Tier 2

Path parameters

user_id
string

The unique identifier of the user.

id
string(uuid)

The unique identifier for the channel.

Query parameters

status
enum(string)

The status of the feed items.

unreadreadunseenseenall
source
string

The workflow key associated with the message in the feed.

tenant
string

The tenant associated with the feed items.

has_tenant
boolean

Whether the feed items have a tenant.

workflow_categories[]
string[]

The workflow categories of the feed items.

archived
enum(string)

The archived status of the feed items.

excludeincludeonly
trigger_data
string

The trigger data of the feed items (as a JSON string).

locale
string

The locale to render the feed items in. Must be in the IETF 5646 format (e.g. en-US). When not provided, will default to the locale that the feed items were rendered in. Only available for enterprise plan customers using custom translations.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

Returns

UserInAppFeedResponse

A paginated list of feed items.

entries
InAppFeedItem[]

The list of feed items in the user's feed.

__typename
string
Required

The typename of the schema.

activitiesRequired

List of activities associated with this feed item.

__typename
string

The typename of the schema.

The actor who performed the activity.

data
object(any)

The workflow trigger data payload associated with the activity.

id
string

Unique identifier for the activity.

inserted_at
string(date-time)

Timestamp when the activity was created.

recipient
2 possible types

A recipient of a notification, which is either a user or an object.

updated_at
string(date-time)

Timestamp when the activity was last updated.

actorsRequired

List of actors associated with this feed item.

archived_at
string

Timestamp when the feed item was archived.

blocks
object[]
Required

Content blocks that make up the feed item.

clicked_at
string

Timestamp when the feed item was clicked.

data
object(any)
Required

Additional data associated with the feed item.

id
string
Required

Unique identifier for the feed.

inserted_at
string
Required

Timestamp when the resource was created.

interacted_at
string

Timestamp when the feed item was interacted with.

link_clicked_at
string

Timestamp when a link within the feed item was clicked.

read_at
string

Timestamp when the feed item was marked as read.

seen_at
string

Timestamp when the feed item was marked as seen.

source
object
Required

Source information for the feed item.

__typename
string
Required

The typename of the schema.

categories
string[]
Required

Categories this workflow belongs to.

key
string
Required

The key of the workflow.

version_id
string(uuid)
Required

The workflow version ID.

tenant
string
Required

Tenant ID that the feed item belongs to.

total_activities
integer
Required

Total number of activities related to this feed item.

total_actors
integer
Required

Total number of actors related to this feed item.

updated_at
string
Required

The timestamp when the resource was last updated.

meta
object

The metadata for the user's feed.

__typename
string

The typename of the schema.

total_count
integer

The total number of feed items in the user's feed.

unread_count
integer

The number of unread feed items in the user's feed.

unseen_count
integer

The number of unseen feed items in the user's feed.

page_info

Pagination information for a list of resources.

__typename
string

The typename of the schema.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

page_size
integer

The number of items per page (defaults to 50).

vars
object(any)

Additional variables for the feed item.

Get feed settings

#

Returns the feed settings for a user.

Endpoint

GET/v1/users/{user_id}/feeds/{id}/settings

Rate limit

Tier 4

Path parameters

user_id
string

The unique identifier of the user.

id
string(uuid)

The unique identifier for the channel.

Returns

UserInAppFeedSettingsResponse

The response for the user's feed settings.

features
object

Features configuration for the user's feed.

branding_required
boolean

Whether branding is required for the user's feed.

List guides

#

Returns a list of eligible in-app guides for a specific user and channel.

Endpoint

GET/v1/users/{user_id}/guides/{channel_id}

Rate limit

Tier 2

Path parameters

user_id
string

The unique identifier of the user.

channel_id
string(uuid)

The unique identifier for the channel.

Query parameters

tenant
string

The tenant ID to use for targeting and rendering guides.

data
string

The data (JSON encoded object) to use for targeting and rendering guides.

type
string

The type of guides to filter by.

Returns

GuidesResponse

A response for a list of guides.

entries
object[]

A list of guides.

__typename
string

The typename of the schema.

activation_url_patterns
object[]

A list of URL Patterns to evaluate user's current location to activate the guide, if matched

directive
string

The directive for the URL pattern ('allow' or 'block')

pathname
string

The pathname pattern to match (supports wildcards like /*)

activation_url_rules
object[]

A list of URL rules to evaluate user's current location to activate the guide, if matched

argument
string

The value to compare against

directive
string

The directive for the URL pattern ('allow' or 'block')

operator
string

The comparison operator ('contains' or 'equal_to')

variable
string

The variable to evaluate ('pathname')

active
boolean

Whether the guide is active.

bypass_global_group_limit
boolean
channel_id
string(uuid)
id
string(uuid)

The unique identifier for the guide.

inserted_at
string(date-time)
key
string

The key of the guide.

semver
string
steps
object[]
content
object(any)
message
object
archived_at
string(date-time)
id
string
interacted_at
string(date-time)
link_clicked_at
string(date-time)
read_at
string(date-time)
seen_at
string(date-time)
ref
string
schema_key
string
schema_semver
string
schema_variant_key
string
type
string

The type of the guide.

updated_at
string(date-time)
guide_group_display_logs
object(any)

A map of guide group keys to their last display timestamps.

guide_groups
object[]

A list of guide groups with their display sequences and intervals.

__typename
string
display_interval
integer
display_sequence
string[]
inserted_at
string(date-time)
key
string
updated_at
string(date-time)
ineligible_guides
object[]

Markers for guides the user is not eligible to see.

key
string
Required

The guide's key identifier

message
string
Required

Human-readable explanation of ineligibility

reason
enum(string)
Required

Reason code for ineligibility

guide_not_activemarked_as_archivedtarget_conditions_not_metnot_in_target_audience

Mark guide as seen

#

Records that a guide has been seen by a user, triggering any associated seen events.

Endpoint

PUT/v1/users/{user_id}/guides/messages/{message_id}/seen

Rate limit

Tier 2

Path parameters

user_id
string

The unique identifier of the user.

Request body

channel_id
string(uuid)
Required

The unique identifier for the channel.

content
object(any)

The content of the guide.

data
object(any)

The data of the guide.

guide_id
string(uuid)
Required

The unique identifier for the guide.

guide_key
string
Required

The key of the guide.

guide_step_ref
string
Required

The step reference of the guide.

is_final
boolean

Whether the guide is final.

metadata
object(any)

The metadata of the guide.

tenant
string

The tenant ID of the guide.

Returns

GuideActionResponse

A response for a guide action.

status
string

The status of a guide's action.

Mark guide as interacted

#

Records that a user has interacted with a guide, triggering any associated interacted events.

Endpoint

PUT/v1/users/{user_id}/guides/messages/{message_id}/interacted

Rate limit

Tier 2

Path parameters

user_id
string

The unique identifier of the user.

Request body

channel_id
string(uuid)
Required

The unique identifier for the channel.

content
object(any)

The content of the guide.

data
object(any)

The data of the guide.

guide_id
string(uuid)
Required

The unique identifier for the guide.

guide_key
string
Required

The key of the guide.

guide_step_ref
string
Required

The step reference of the guide.

is_final
boolean

Whether the guide is final.

metadata
object(any)

The metadata of the guide.

tenant
string

The tenant ID of the guide.

Returns

GuideActionResponse

A response for a guide action.

status
string

The status of a guide's action.

Mark guide as archived

#

Records that a guide has been archived by a user, triggering any associated archived events.

Endpoint

PUT/v1/users/{user_id}/guides/messages/{message_id}/archived

Rate limit

Tier 2

Path parameters

user_id
string

The unique identifier of the user.

Request body

channel_id
string(uuid)
Required

The unique identifier for the channel.

content
object(any)

The content of the guide.

data
object(any)

The data of the guide.

guide_id
string(uuid)
Required

The unique identifier for the guide.

guide_key
string
Required

The key of the guide.

guide_step_ref
string
Required

The step reference of the guide.

is_final
boolean

Whether the guide is final.

metadata
object(any)

The metadata of the guide.

tenant
string

The tenant ID of the guide.

Returns

GuideActionResponse

A response for a guide action.

status
string

The status of a guide's action.

Bulk operations

#

Bulk operations available for users. These endpoints return a BulkOperation that executes the job asynchronously. Progress can be tracked via the Bulk operations API.

Bulk identify users

#

Identifies multiple users in a single operation. Allows creating or updating up to 1,000 users in a single batch with various properties, preferences, and channel data.

Endpoint

POST/v1/users/bulk/identify

Rate limit

Tier 1

Request body

A list of users.

avatar
string

A URL for the avatar of the user.

Channel-specific information that's needed to deliver a notification to an end provider.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

id
string
Required

The unique identifier of the user.

locale
string

The locale of the user. Used for message localization.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

A set of preferences for the user.

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

Returns

A bulk operation entity.

__typename
string

The typename of the schema.

completed_at
string(date-time)

Timestamp when the bulk operation was completed.

error_count
integer

The number of failed operations.

error_items
object[]

A list of items that failed to be processed.

collection
string

The collection this object belongs to.

id
string
Required

Unique identifier for the object.

estimated_total_rows
integer

The estimated total number of rows to process.

failed_at
string(date-time)

Timestamp when the bulk operation failed.

id
string(uuid)

Unique identifier for the bulk operation.

inserted_at
string(date-time)

Timestamp when the resource was created.

name
string

The name of the bulk operation.

processed_rows
integer

The number of rows processed so far.

progress_path
string(uri)

The URI to the bulk operation's progress.

started_at
string(date-time)

Timestamp when the bulk operation was started.

status
enum(string)

The status of the bulk operation.

queuedprocessingcompletedfailed
success_count
integer

The number of successful operations.

updated_at
string(date-time)

The timestamp when the resource was last updated.

Bulk set preferences

#

Bulk sets the preferences for up to 1,000 users at a time. The preference set :id can be either default or a tenant.id. Learn more about per-tenant preferences. Note that this is a destructive operation and will replace any existing users' preferences with the preferences sent.

Endpoint

POST/v1/users/bulk/preferences

Rate limit

Tier 1

Request body

preferencesRequired

A request to set a preference set for a recipient.

__persistence_strategy__
enum(string)

Controls how the preference set is persisted. 'replace' will completely replace the preference set, 'merge' will merge with existing preferences.

mergereplace
categories
PreferenceSetRequestCategories

An object where the key is the category and the values are the preference settings for that category.

An object where the key is the channel type and the values are the preference settings for that channel type.

channels
PreferenceSetChannels

An object where the key is the channel ID and the values are the preference settings for that channel ID.

commercial_subscribed
boolean

Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications.

workflows
PreferenceSetRequestWorkflows

An object where the key is the workflow key and the values are the preference settings for that workflow.

user_ids
string[]
Required

A list of user IDs.

Returns

A bulk operation entity.

__typename
string

The typename of the schema.

completed_at
string(date-time)

Timestamp when the bulk operation was completed.

error_count
integer

The number of failed operations.

error_items
object[]

A list of items that failed to be processed.

collection
string

The collection this object belongs to.

id
string
Required

Unique identifier for the object.

estimated_total_rows
integer

The estimated total number of rows to process.

failed_at
string(date-time)

Timestamp when the bulk operation failed.

id
string(uuid)

Unique identifier for the bulk operation.

inserted_at
string(date-time)

Timestamp when the resource was created.

name
string

The name of the bulk operation.

processed_rows
integer

The number of rows processed so far.

progress_path
string(uri)

The URI to the bulk operation's progress.

started_at
string(date-time)

Timestamp when the bulk operation was started.

status
enum(string)

The status of the bulk operation.

queuedprocessingcompletedfailed
success_count
integer

The number of successful operations.

updated_at
string(date-time)

The timestamp when the resource was last updated.

Bulk delete users

#

Permanently deletes up to 1,000 users at a time.

Endpoint

POST/v1/users/bulk/delete

Rate limit

Tier 1

Request body

user_ids
string[]
Required

A list of user IDs.

Returns

A bulk operation entity.

__typename
string

The typename of the schema.

completed_at
string(date-time)

Timestamp when the bulk operation was completed.

error_count
integer

The number of failed operations.

error_items
object[]

A list of items that failed to be processed.

collection
string

The collection this object belongs to.

id
string
Required

Unique identifier for the object.

estimated_total_rows
integer

The estimated total number of rows to process.

failed_at
string(date-time)

Timestamp when the bulk operation failed.

id
string(uuid)

Unique identifier for the bulk operation.

inserted_at
string(date-time)

Timestamp when the resource was created.

name
string

The name of the bulk operation.

processed_rows
integer

The number of rows processed so far.

progress_path
string(uri)

The URI to the bulk operation's progress.

started_at
string(date-time)

Timestamp when the bulk operation was started.

status
enum(string)

The status of the bulk operation.

queuedprocessingcompletedfailed
success_count
integer

The number of successful operations.

updated_at
string(date-time)

The timestamp when the resource was last updated.

User

#

A User represents an individual in your system who can receive notifications through Knock. Users are the most common recipients of notifications and are always referenced by your internal identifier.

Attributes

__typename
string

The typename of the schema.

avatar
string

A URL for the avatar of the user.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

id
string

The unique identifier of the user.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

updated_at
string(date-time)

The timestamp when the resource was last updated.

*
object(any)

Any additional custom properties.

IdentifyUserRequest

#

A set of parameters to identify a user with. Does not include the user ID, as that's specified elsewhere in the request. You can supply any additional properties you'd like to upsert for the user.

Attributes

avatar
string

A URL for the avatar of the user.

Channel-specific information that's needed to deliver a notification to an end provider.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

locale
string

The locale of the user. Used for message localization.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

A set of preferences for the user.

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

*
object(any)

Any additional custom properties.

InlineIdentifyUserRequest

#

A set of parameters to inline-identify a user with. Inline identifying the user will ensure that the user is available before the request is executed in Knock. It will perform an upsert for the user you're supplying, replacing any properties specified.

Attributes

avatar
string

A URL for the avatar of the user.

Channel-specific information that's needed to deliver a notification to an end provider.

created_at
string(date-time)

The creation date of the user from your system.

email
string

The primary email address for the user.

id
string

The unique identifier of the user.

locale
string

The locale of the user. Used for message localization.

name
string

Display name of the user.

phone_number
string

The E.164 phone number of the user (required for SMS channels).

A set of preferences for the user.

timezone
string

The timezone of the user. Must be a valid tz database time zone string. Used for recurring schedules.

*
object(any)

Any additional custom properties.

New chat