Knock Users API
Identify, list, update, delete, and merge users plus manage their channel data, preferences, in-app feeds, guides, subscriptions, messages, and schedules. The primary recipient surface for Knock.
Identify, list, update, delete, and merge users plus manage their channel data, preferences, in-app feeds, guides, subscriptions, messages, and schedules. The primary recipient surface for Knock.
openapi: 3.0.3
info:
title: Knock Users API
version: '1.0'
description: Identify, list, update, delete, and merge users plus manage their channel data, preferences, in-app feeds,
guides, subscriptions, messages, and schedules. The primary recipient surface for Knock.
contact:
name: Knock
url: https://knock.app
license:
name: Proprietary
servers:
- url: https://api.knock.app
variables: {}
security:
- BearerAuth: []
paths:
/v1/users/{user_id}/guides/messages/seen:
put:
callbacks: {}
description: Records that a guide has been seen by a user, triggering any associated seen events.
operationId: markUserGuideAsSeen (2)
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
example:
channel_id: 123e4567-e89b-12d3-a456-426614174000
content:
body: Limited spots available for today's behind-the-scenes DNA extraction demonstration.
title: DNA Lab Tour Available
data:
next_time: '14:30'
spots_left: 8
tour_id: dna_lab_tour
guide_id: 7e9dc78c-b3b1-4127-a54e-71f1899b831a
guide_key: tour_notification
guide_step_ref: lab_tours
is_final: false
metadata:
cta: Reserve Spot
theme: amber
type: banner
tenant: ingen_isla_nublar
schema:
$ref: '#/components/schemas/GuideActionRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionResponse'
description: OK
summary: Mark guide as seen
tags:
- Guides
- Users
x-ratelimit-tier: 2
/v1/users/{user_id}/feeds/{id}:
get:
callbacks: {}
description: '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](/integrations/in-app/knock#customizing-api-response-content)
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](/integrations/email/attachments) present in trigger data are automatically excluded from both
the `data` and `activities` fields of `UserInAppFeedResponse`.
'
operationId: listUserInAppFeedItems
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
- description: The unique identifier for the channel.
in: path
name: id
required: true
schema:
format: uuid
type: string
x-struct: null
x-validate: null
- description: The status of the feed items.
example: unread
in: query
name: status
required: false
schema:
enum:
- unread
- read
- unseen
- seen
- all
type: string
x-struct: null
x-validate: null
- description: The workflow key associated with the message in the feed.
example: my_source
in: query
name: source
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: The tenant associated with the feed items.
example: my_tenant
in: query
name: tenant
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: Whether the feed items have a tenant.
example: true
in: query
name: has_tenant
required: false
schema:
type: boolean
x-struct: null
x-validate: null
- description: The workflow categories of the feed items.
example:
- my_workflow_category
in: query
name: workflow_categories[]
required: false
schema:
items:
type: string
x-struct: null
x-validate: null
type: array
x-struct: null
x-validate: null
- description: The archived status of the feed items.
example: exclude
in: query
name: archived
required: false
schema:
enum:
- exclude
- include
- only
type: string
x-struct: null
x-validate: null
- description: The trigger data of the feed items (as a JSON string).
example: '{ "key": "value" }'
in: query
name: trigger_data
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: 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.
example: en-US
in: query
name: locale
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: Comma-separated list of field paths to exclude from the response. Use dot notation for nested fields
(e.g., `entries.archived_at`). Limited to 3 levels deep.
example: entries.archived_at,entries.clicked_at
in: query
name: exclude
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: The mode to render the feed items in. Can be `compact` or `rich`. Defaults to `rich`. When `mode` is
`compact`, feed items will not have `activities` and `total_activities` fields; the `data` field will not include
nested arrays and objects; and the `actors` field will only have up to one actor.
example: compact
in: query
name: mode
required: false
schema:
default: rich
enum:
- compact
- rich
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 items per page (defaults to 50).
in: query
name: page_size
required: false
schema:
type: integer
x-struct: null
x-validate: null
- description: Limits the results to items inserted after the given date.
example: '2025-01-01T00:00:00Z'
in: query
name: inserted_at.gt
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: Limits the results to items inserted after or on the given date.
example: '2025-01-01T00:00:00Z'
in: query
name: inserted_at.gte
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: Limits the results to items inserted before the given date.
example: '2025-01-01T00:00:00Z'
in: query
name: inserted_at.lt
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: Limits the results to items inserted before or on the given date.
example: '2025-01-01T00:00:00Z'
in: query
name: inserted_at.lte
required: false
schema:
type: string
x-struct: null
x-validate: null
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/UserInAppFeedResponse'
description: OK
summary: List feed items
tags:
- Feeds
- Users
x-ratelimit-tier: 2
/v1/users/{user_id}/feeds/{id}/settings:
get:
callbacks: {}
description: Returns the feed settings for a user.
operationId: getUserInAppFeedSettings
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
- description: The unique identifier for the channel.
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/UserInAppFeedSettingsResponse'
description: OK
summary: Get feed settings
tags:
- Feeds
- Users
x-ratelimit-tier: 4
/v1/users/{user_id}/subscriptions:
get:
callbacks: {}
description: Retrieves a paginated list of subscriptions for a specific user, in descending order.
operationId: listSubscriptionsForUser
parameters:
- description: The user ID to list subscriptions for.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
- description: Associated resources to include in the response.
in: query
name: include[]
required: false
schema:
items:
enum:
- preferences
type: string
x-struct: null
x-validate: null
type: array
x-struct: null
x-validate: null
- description: Only returns subscriptions for the specified object references.
in: query
name: objects[]
required: false
schema:
items:
$ref: '#/components/schemas/RecipientReference'
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 items per page (defaults to 50).
in: query
name: page_size
required: false
schema:
type: integer
x-struct: null
x-validate: null
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ListSubscriptionsResponse'
description: OK
summary: List user subscriptions
tags:
- Subscriptions
- Users
x-ratelimit-tier: 4
/v1/users/{user_id}:
delete:
callbacks: {}
description: Permanently delete a user and all associated data.
operationId: deleteUser
parameters:
- description: The ID of the user to delete.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
responses:
'204':
description: No Content
summary: Delete user
tags:
- Users
x-ratelimit-tier: 2
get:
callbacks: {}
description: Retrieve a specific user by their ID.
operationId: getUser
parameters:
- description: The ID of the user to retrieve.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: OK
summary: Get user
tags:
- Users
x-ratelimit-tier: 4
put:
callbacks: {}
description: 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.
operationId: identifyUser
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
example:
channel_data:
97c5837d-c65c-4d54-aa39-080eeb81c69d:
tokens:
- push_token_123
email: ian.malcolm@chaos.theory
name: Dr. Ian Malcolm
preferences:
default:
channel_types:
email: true
workflows:
dinosaurs-loose:
channel_types:
email: true
timezone: America/New_York
schema:
$ref: '#/components/schemas/IdentifyUserRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: OK
summary: Identify user
tags:
- Users
x-ratelimit-tier: 3
/v1/users/{user_id}/preferences/{id}/categories/{key}:
put:
callbacks: {}
deprecated: true
description: Updates a single category in a specific user preference set. This operation is deprecated.
operationId: updateUserPreferenceCategory
parameters: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PreferenceSet'
description: OK
summary: Update category in user preference set
tags:
- Users
- Preferences
x-ratelimit-tier: 3
/v1/users/{user_id}/guides/messages/{message_id}/seen:
put:
callbacks: {}
description: Records that a guide has been seen by a user, triggering any associated seen events.
operationId: markUserGuideAsSeen
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
example:
channel_id: 123e4567-e89b-12d3-a456-426614174000
content:
body: Limited spots available for today's behind-the-scenes DNA extraction demonstration.
title: DNA Lab Tour Available
data:
next_time: '14:30'
spots_left: 8
tour_id: dna_lab_tour
guide_id: 7e9dc78c-b3b1-4127-a54e-71f1899b831a
guide_key: tour_notification
guide_step_ref: lab_tours
is_final: false
metadata:
cta: Reserve Spot
theme: amber
type: banner
tenant: ingen_isla_nublar
schema:
$ref: '#/components/schemas/GuideActionRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionResponse'
description: OK
summary: Mark guide as seen
tags:
- Guides
- Users
x-ratelimit-tier: 2
/v1/users/{user_id}/guides/messages/archived:
delete:
callbacks: {}
description: Records that a guide has been unarchived, triggering any associated unarchived events.
operationId: markUserGuideAsUnarchived
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionResponse'
description: OK
summary: Mark guide as unarchived
tags:
- Guides
- Users
x-ratelimit-tier: 2
put:
callbacks: {}
description: Records that a guide has been archived by a user, triggering any associated archived events.
operationId: markUserGuideAsArchived (2)
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionResponse'
description: OK
summary: Mark guide as archived
tags:
- Guides
- Users
x-ratelimit-tier: 2
/v1/users/{user_id}/channel_data/{channel_id}:
delete:
callbacks: {}
description: Deletes channel data for a specific user and channel ID.
operationId: unsetUserChannelData
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
- description: The unique identifier for the channel.
in: path
name: channel_id
required: true
schema:
format: uuid
type: string
x-struct: null
x-validate: null
responses:
'204':
description: No Content
summary: Unset channel data
tags:
- Channel data
- Users
x-ratelimit-tier: 3
get:
callbacks: {}
description: Retrieves the channel data for a specific user and channel ID.
operationId: getUserChannelData
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
- description: The unique identifier for the channel.
in: path
name: channel_id
required: true
schema:
format: uuid
type: string
x-struct: null
x-validate: null
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ChannelData'
description: OK
summary: Get channel data
tags:
- Channel data
- Users
x-ratelimit-tier: 4
put:
callbacks: {}
description: 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.
operationId: setUserChannelData
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
- description: The unique identifier for the channel.
in: path
name: channel_id
required: true
schema:
format: uuid
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
example:
data:
tokens:
- push_token_1
schema:
$ref: '#/components/schemas/ChannelDataRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ChannelData'
description: OK
summary: Set channel data
tags:
- Channel data
- Users
x-ratelimit-tier: 3
/v1/users/{user_id}/merge:
post:
callbacks: {}
description: Merge two users together, where the user specified with the `from_user_id` param will be merged into the
user specified by `user_id`.
operationId: mergeUser
parameters:
- description: The id of the user to merge into.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
example:
from_user_id: user_1
schema:
$ref: '#/components/schemas/MergeUserRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: OK
summary: Merge users
tags:
- Users
x-ratelimit-tier: 2
/v1/users/{user_id}/guides/messages/interacted:
put:
callbacks: {}
description: Records that a user has interacted with a guide, triggering any associated interacted events.
operationId: markUserGuideAsInteracted (2)
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionResponse'
description: OK
summary: Mark guide as interacted
tags:
- Guides
- Users
x-ratelimit-tier: 2
/v1/users/{user_id}/guides/engagements/reset:
put:
callbacks: {}
description: Resets the engagement state of a guide for a user, removing the guide's engagement log entry so the next
interaction creates a fresh engagement.
operationId: resetUserGuideEngagement
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionResponse'
description: OK
summary: Reset guide engagement
tags:
- Guides
- Users
x-ratelimit-tier: 2
/v1/users/bulk/preferences:
post:
callbacks: {}
description: 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](/preferences/tenant-preferences). Note that this is a destructive
operation and will replace any existing users' preferences with the preferences sent.
operationId: bulkSetUserPreferences
parameters: []
requestBody:
content:
application/json:
example:
preferences:
__persistence_strategy__: merge
categories:
marketing: false
transactional:
channel_types:
email: false
channel_types:
email: true
channels:
2f641633-95d3-4555-9222-9f1eb7888a80:
conditions:
- argument: US
operator: equal_to
variable: recipient.country_code
aef6e715-df82-4ab6-b61e-b743e249f7b6: true
commercial_subscribed: true
workflows:
dinosaurs-loose:
channel_types:
email: false
user_ids:
- user_1
- user_2
schema:
$ref: '#/components/schemas/BulkSetUserPreferencesRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/BulkOperation'
description: OK
summary: Bulk set preferences
tags:
- Users
- Bulk operations
x-ratelimit-tier: 1
/v1/users/{user_id}/guides/{channel_id}:
get:
callbacks: {}
description: Returns a list of eligible in-app guides for a specific user and channel.
operationId: listUserGuides
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
- description: The unique identifier for the channel.
in: path
name: channel_id
required: true
schema:
format: uuid
type: string
x-struct: null
x-validate: null
- description: The tenant ID to use for targeting and rendering guides.
in: query
name: tenant
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: The data (JSON encoded object) to use for targeting and rendering guides.
in: query
name: data
required: false
schema:
type: string
x-struct: null
x-validate: null
- description: The type of guides to filter by.
in: query
name: type
required: false
schema:
type: string
x-struct: null
x-validate: null
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuidesResponse'
description: OK
summary: List guides
tags:
- Guides
- Users
x-ratelimit-tier: 2
/v1/users/bulk/identify:
post:
callbacks: {}
description: 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.
operationId: bulkIdentifyUsers
parameters: []
requestBody:
content:
application/json:
example:
users:
- email: jane@ingen.net
id: user_1
name: Jane Doe
timezone: America/New_York
schema:
$ref: '#/components/schemas/BulkIdentifyUsersRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/BulkOperation'
description: OK
summary: Bulk identify users
tags:
- Users
- Bulk operations
x-ratelimit-tier: 1
/v1/users/{user_id}/preferences/{id}/workflows:
put:
callbacks: {}
deprecated: true
description: Updates the workflows in a specific user preference set. This operation is deprecated.
operationId: updateUserPreferenceWorkflows
parameters: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PreferenceSet'
description: OK
summary: Update workflows in preference set
tags:
- Users
- Preferences
x-ratelimit-tier: 3
/v1/users/{user_id}/preferences/{id}/categories:
put:
callbacks: {}
deprecated: true
description: Updates the categories in a specific user preference set. This operation is deprecated.
operationId: updateUserPreferenceCategories
parameters: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PreferenceSet'
description: OK
summary: Update categories in user preference set
tags:
- Users
- Preferences
x-ratelimit-tier: 3
/v1/users/{user_id}/guides/messages/{message_id}/interacted:
put:
callbacks: {}
description: Records that a user has interacted with a guide, triggering any associated interacted events.
operationId: markUserGuideAsInteracted
parameters:
- description: The unique identifier of the user.
in: path
name: user_id
required: true
schema:
type: string
x-struct: null
x-validate: null
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GuideActionResponse'
description: OK
summary: Mark guide as interacted
tags:
- Guides
- Users
x-ratelimit-tier: 2
/v1/users/bulk/delete:
post:
callbacks: {}
description: Permanently deletes up to 1,000 users at a time.
operationId: bulkDeleteUsers
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BulkDeleteUsersRequest'
description: Params
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/BulkOperation'
description: OK
summary: Bulk delete users
tags:
- Users
- Bulk operations
x-ratelimit-tier: 1
/v1/users/{user_id}/preferences/{id}/channel_types/{type}:
put:
callbacks: {}
deprecated: true
description: Updates a single channel type in a specific user preference set. This operation is deprecated.
operationId: updateUserPreferenceChannelType
parameters: []
responses:
'200':
content:
application/json:
# --- truncated at 32 KB (170 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/knock-app/refs/heads/main/openapi/knock-users-api-openapi.yml