Appearance
Chat
About 20450 wordsAbout 68 min
Typescript SDK - Chat API
Table of Contents
- queryCampaigns
- getCampaign
- startCampaign
- stopCampaign
- queryChannels
- channelBatchUpdate
- deleteChannels
- markDelivered
- markChannelsRead
- getOrCreateDistinctChannel
- updateChannel
- updateChannelPartial
- deleteChannel
- getDraft
- deleteDraft
- sendEvent
- uploadChannelFile
- deleteChannelFile
- hideChannel
- uploadChannelImage
- deleteChannelImage
- updateMemberPartial
- sendMessage
- getManyMessages
- getOrCreateChannel
- markRead
- showChannel
- truncateChannel
- markUnread
- listChannelTypes
- createChannelType
- getChannelType
- updateChannelType
- deleteChannelType
- listCommands
- createCommand
- getCommand
- updateCommand
- deleteCommand
- queryDrafts
- exportChannels
- queryMembers
- queryMessageHistory
- getMessage
- updateMessage
- updateMessagePartial
- deleteMessage
- runMessageAction
- commitMessage
- ephemeralMessageUpdate
- sendReaction
- deleteReaction
- getReactions
- queryReactions
- translateMessage
- undeleteMessage
- castPollVote
- deletePollVote
- createReminder
- updateReminder
- deleteReminder
- getReplies
- queryMessageFlags
- muteChannel
- unmuteChannel
- queryBannedUsers
- queryFutureChannelBans
- queryReminders
- getRetentionPolicy
- setRetentionPolicy
- deleteRetentionPolicy
- getRetentionPolicyRuns
- search
- querySegments
- getSegment
- deleteSegment
- deleteSegmentTargets
- segmentTargetExists
- querySegmentTargets
- queryTeamUsageStats
- queryThreads
- getThread
- updateThreadPartial
- unreadCounts
- unreadCountsBatch
- sendUserCustomEvent
- Types Reference
queryCampaigns
Retrieve a list of campaigns based on specific criteria, helping you manage and analyze multiple marketing efforts simultaneously.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query campaigns
const response = await client.chat.queryCampaigns({
limit: 25,
filter: {},
sort: [],
});
console.log(response);Example: with prev and next
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query campaigns
const response = await client.chat.queryCampaigns({
prev: null,
next: null,
});
console.log(response);Example: with user_limit
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query campaigns
const response = await client.chat.queryCampaigns({
user_limit: 10,
});
console.log(response);Response: QueryCampaignsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | No | - |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | - |
| user_limit | number | No | - |
getCampaign
Obtain detailed information about a specific campaign, allowing you to review its current status and settings.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get campaign
const response = await client.chat.getCampaign({
id: 'activity-123',
limit: 25,
next: null,
});
console.log(response);Example: with prev
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get campaign
const response = await client.chat.getCampaign({
id: 'activity-123',
prev: null,
});
console.log(response);Response: GetCampaignResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| prev | string | No | - |
| next | string | No | - |
| limit | number | No | - |
startCampaign
Initiate or schedule a campaign to begin at a designated time, enabling you to automate your marketing and outreach activities.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Start/schedule campaign
const response = await client.chat.startCampaign({
id: 'activity-123',
scheduled_for: 10,
stop_at: 10,
});
console.log(response);Response: StartCampaignResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| scheduled_for | float | No | - |
| stop_at | float | No | - |
stopCampaign
Stop an ongoing campaign to prevent further messages from being sent, useful when campaign objectives have been achieved or if errors are detected.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Stop campaign
const response = await client.chat.stopCampaign({
id: 'activity-123',
});
console.log(response);Response: CampaignResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
queryChannels
Access a list of communication channels available in your account, facilitating efficient management and selection for your campaigns.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query channels
const response = await client.chat.queryChannels({
user_id: 'john',
limit: 25,
sort: [],
});
console.log(response);Example: with filter_conditions and message_limit
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query channels
const response = await client.chat.queryChannels({
filter_conditions: {},
message_limit: 10,
});
console.log(response);Example: with offset and predefined_filter
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query channels
const response = await client.chat.queryChannels({
offset: 0,
predefined_filter: 'value',
});
console.log(response);Example: with filter_values and sort_values
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query channels
const response = await client.chat.queryChannels({
filter_values: {},
sort_values: {},
});
console.log(response);Response: QueryChannelsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter_conditions | Record<string, any> | No | Filter conditions to apply to the query |
| filter_values | Record<string, any> | No | Values to interpolate into the predefined filter template |
| limit | number | No | Number of channels to limit |
| member_limit | number | No | Number of members to limit |
| message_limit | number | No | Number of messages to limit |
| offset | number | No | Channel pagination offset |
| predefined_filter | string | No | ID of a predefined filter to use instead of filter_conditions |
| sort | []SortParamRequest | No | List of sort parameters |
| sort_values | Record<string, any> | No | - |
| state | boolean | No | Whether to update channel state or not |
| user | UserRequest | No | - |
| user_id | string | No | - |
channelBatchUpdate
Update multiple channels simultaneously to save time and ensure consistency across channel settings or configurations.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channels in batch
const response = await client.chat.channelBatchUpdate({
filter: {},
operation: 'add',
data: { auto_translation_enabled: false },
members: [],
});
console.log(response);Response: ChannelBatchUpdateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | Yes | - |
| operation | string | Yes | - |
| data | ChannelDataUpdate | No | - |
| members | []ChannelBatchMemberRequest | No | - |
deleteChannels
Asynchronously remove specific channels from your account, helping you maintain an organized and relevant channel list without immediate blocking.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Deletes channels asynchronously
const response = await client.chat.deleteChannels({
cids: [],
hard_delete: false,
});
console.log(response);Response: DeleteChannelsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cids | []string | Yes | All channels that should be deleted |
| hard_delete | boolean | No | Specify if channels and all ressources should be hard deleted |
markDelivered
Update the delivery status of messages sent through a channel, ensuring accurate tracking and reporting of message delivery outcomes.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mark channel message delivery status
const response = await client.chat.markDelivered({
user_id: 'john',
latest_delivered_messages: [],
});
console.log(response);Response: MarkDeliveredResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | No | - |
| latest_delivered_messages | []DeliveredMessagePayload | No | - |
markChannelsRead
Mark all messages in selected channels as read, allowing you to streamline communication management and reduce notification clutter.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mark channels as read
const response = await client.chat.markChannelsRead({
user_id: 'john',
user: { id: 'activity-123', custom: {} },
read_by_channel: {},
});
console.log(response);Response: MarkReadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| read_by_channel | Record<string, any> | No | Map of channel ID to last read message ID |
| user | UserRequest | No | - |
| user_id | string | No | - |
getOrCreateDistinctChannel
Retrieve an existing channel or create a new one based on unique identifiers, simplifying the process of managing distinct communication threads.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateDistinctChannel({
type: 'like',
data: { auto_translation_enabled: false },
hide_for_creator: false,
});
console.log(response);Example: with members and messages
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateDistinctChannel({
type: 'like',
members: { limit: 25 },
messages: { created_at_after: 10 },
});
console.log(response);Example: with state and thread_unread_counts
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateDistinctChannel({
type: 'like',
state: false,
thread_unread_counts: false,
});
console.log(response);Example: with watchers
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateDistinctChannel({
type: 'like',
watchers: { limit: 25 },
});
console.log(response);Response: ChannelStateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| data | ChannelInput | No | - |
| hide_for_creator | boolean | No | Whether this channel will be hidden for the user who created the channel or not |
| members | PaginationParams | No | - |
| messages | MessagePaginationParams | No | - |
| state | boolean | No | Refresh channel state |
| thread_unread_counts | boolean | No | - |
| watchers | PaginationParams | No | - |
updateChannel
Modify the settings or attributes of an existing channel to keep your communication channels up-to-date and aligned with your needs.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel
const response = await client.chat.updateChannel({
type: 'like',
id: 'activity-123',
user_id: 'john',
skip_push: false,
});
console.log(response);Example: with add_members and add_moderators
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel
const response = await client.chat.updateChannel({
type: 'like',
id: 'activity-123',
add_members: [],
add_moderators: [],
});
console.log(response);Example: with assign_roles and cooldown
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel
const response = await client.chat.updateChannel({
type: 'like',
id: 'activity-123',
assign_roles: [],
cooldown: 10,
});
console.log(response);Example: with data and demote_moderators
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel
const response = await client.chat.updateChannel({
type: 'like',
id: 'activity-123',
data: { auto_translation_enabled: false },
demote_moderators: [],
});
console.log(response);Response: UpdateChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| accept_invite | boolean | No | Set to true to accept the invite |
| add_filter_tags | []string | No | List of filter tags to add to the channel |
| add_members | []ChannelMemberRequest | No | List of user IDs to add to the channel |
| add_moderators | []string | No | List of user IDs to make channel moderators |
| assign_roles | []ChannelMemberRequest | No | List of channel member role assignments. If any specified user is not part of the channel, the re... |
| cooldown | number | No | Sets cool down period for the channel in seconds |
| data | ChannelInputRequest | No | - |
| demote_moderators | []string | No | List of user IDs to take away moderators status from |
| hide_history | boolean | No | Set to true to hide channel's history when adding new members |
| hide_history_before | float | No | If set, hides channel's history before this time when adding new members. Takes precedence over `... |
| invites | []ChannelMemberRequest | No | List of user IDs to invite to the channel |
| message | MessageRequest | No | Message to send to the chat when channel is successfully updated |
| reject_invite | boolean | No | Set to true to reject the invite |
| remove_filter_tags | []string | No | List of filter tags to remove from the channel |
| remove_members | []string | No | List of user IDs to remove from the channel |
| skip_push | boolean | No | When message is set disables all push notifications for it |
| user | UserRequest | No | - |
| user_id | string | No | - |
updateChannelPartial
Update specific attributes of a channel without altering the entire channel configuration. Use this to make targeted changes, such as updating channel metadata or settings.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially update channel
const response = await client.chat.updateChannelPartial({
type: 'like',
id: 'activity-123',
user_id: 'john',
unset: [],
});
console.log(response);Example: with user and set
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially update channel
const response = await client.chat.updateChannelPartial({
type: 'like',
id: 'activity-123',
user: { id: 'activity-123', custom: {} },
set: {},
});
console.log(response);Response: UpdateChannelPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| set | Record<string, any> | No | - |
| unset | []string | No | - |
| user | UserRequest | No | - |
| user_id | string | No | - |
deleteChannel
Remove a channel from the system entirely. Use this when you want to permanently delete a channel and its associated data.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete channel
const response = await client.chat.deleteChannel({
type: 'like',
id: 'activity-123',
hard_delete: false,
});
console.log(response);Response: DeleteChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| hard_delete | boolean | No | - |
getDraft
Retrieve a draft message for editing or review. Use this to access unsent messages saved as drafts before finalizing or sending them.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get draft
const response = await client.chat.getDraft({
type: 'like',
id: 'activity-123',
user_id: 'john',
parent_id: 'parent-123',
});
console.log(response);Response: GetDraftResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| parent_id | string | No | - |
| user_id | string | No | - |
deleteDraft
Remove a draft message from the system. Use this when a draft is no longer needed and you want to declutter saved drafts.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete draft
const response = await client.chat.deleteDraft({
type: 'like',
id: 'activity-123',
user_id: 'john',
parent_id: 'parent-123',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| parent_id | string | No | - |
| user_id | string | No | - |
sendEvent
Trigger an event within a channel to notify users of actions or updates. Use this to communicate important events, such as member joins or message reactions.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Send event
const response = await client.chat.sendEvent({
type: 'like',
id: 'activity-123',
event: { type: 'like', custom: {} },
});
console.log(response);Response: EventResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| event | EventRequest | Yes | - |
uploadChannelFile
Upload a file to a channel for sharing with other members. Use this to share documents, images, or any relevant files within the channel.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Upload file
const response = await client.chat.uploadChannelFile({
type: 'like',
id: 'activity-123',
file: 'value',
user: { id: 'activity-123' },
});
console.log(response);Response: UploadChannelFileResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| file | string | No | file field |
| user | OnlyUserID | No | user for the request server side only |
deleteChannelFile
Remove a previously uploaded file from a channel. Use this to manage or clean up files that are no longer needed in the channel.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete file
const response = await client.chat.deleteChannelFile({
type: 'like',
id: 'activity-123',
url: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| url | string | No | - |
hideChannel
Temporarily hide a channel from the user's view without deleting it. Use this to reduce clutter while retaining access to the channel for future engagement.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Hide channel
const response = await client.chat.hideChannel({
type: 'like',
id: 'activity-123',
user_id: 'john',
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with clear_history
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Hide channel
const response = await client.chat.hideChannel({
type: 'like',
id: 'activity-123',
clear_history: false,
});
console.log(response);Response: HideChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| clear_history | boolean | No | Whether to clear message history of the channel or not |
| user | UserRequest | No | - |
| user_id | string | No | - |
uploadChannelImage
Upload an image to a channel, enhancing communication with visual content. Use this to share images relevant to the channel's discussions or activities.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Upload image
const response = await client.chat.uploadChannelImage({
type: 'like',
id: 'activity-123',
file: 'value',
upload_sizes: [],
});
console.log(response);Example: with user
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Upload image
const response = await client.chat.uploadChannelImage({
type: 'like',
id: 'activity-123',
user: { id: 'activity-123' },
});
console.log(response);Response: UploadChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| file | string | No | - |
| upload_sizes | []ImageSize | No | field with JSON-encoded array of image size configurations |
| user | OnlyUserID | No | - |
deleteChannelImage
Remove an uploaded image from a channel. Use this to manage the visual content and keep the channel's media relevant and up-to-date.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete image
const response = await client.chat.deleteChannelImage({
type: 'like',
id: 'activity-123',
url: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| url | string | No | - |
updateMemberPartial
Partially update the details of a channel member, such as their role or nickname, without altering their entire profile. Use this when you need to make specific updates to a member's attributes in a channel.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially channel member update
const response = await client.chat.updateMemberPartial({
type: 'like',
id: 'activity-123',
user_id: 'john',
set: {},
});
console.log(response);Example: with unset
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially channel member update
const response = await client.chat.updateMemberPartial({
type: 'like',
id: 'activity-123',
unset: [],
});
console.log(response);Response: UpdateMemberPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| user_id | string | No | - |
| set | Record<string, any> | No | - |
| unset | []string | No | - |
sendMessage
Send a new message to a specified channel, allowing you to initiate or continue a conversation. Use this to communicate with channel members through text, attachments, or other supported message types.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Send new message
const response = await client.chat.sendMessage({
type: 'like',
id: 'activity-123',
message: { attachments: [] },
skip_push: false,
keep_channel_hidden: false,
});
console.log(response);Example: with pending and pending_message_metadata
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Send new message
const response = await client.chat.sendMessage({
type: 'like',
id: 'activity-123',
message: { attachments: [] },
pending: false,
pending_message_metadata: {},
});
console.log(response);Example: with skip_enrich_url and force_moderation
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Send new message
const response = await client.chat.sendMessage({
type: 'like',
id: 'activity-123',
message: { attachments: [] },
skip_enrich_url: false,
force_moderation: false,
});
console.log(response);Response: SendMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| message | MessageRequest | Yes | - |
| force_moderation | boolean | No | - |
| keep_channel_hidden | boolean | No | - |
| pending | boolean | No | - |
| pending_message_metadata | Record<string, any> | No | - |
| skip_enrich_url | boolean | No | - |
| skip_push | boolean | No | - |
getManyMessages
Retrieve a batch of messages from a channel, which can be useful for loading conversation history or displaying older messages. Use this to efficiently access multiple messages at once.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get many messages
const response = await client.chat.getManyMessages({
type: 'like',
id: 'activity-123',
ids: ['activity-1', 'activity-2'],
});
console.log(response);Response: GetManyMessagesResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| ids | []string | Yes | - |
getOrCreateChannel
Retrieve an existing channel or create a new one if it doesn't exist, ensuring you have a channel to work with for communication. Use this when you need to set up or access a channel dynamically.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateChannel({
type: 'like',
id: 'activity-123',
data: { auto_translation_enabled: false },
hide_for_creator: false,
});
console.log(response);Example: with members and messages
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateChannel({
type: 'like',
id: 'activity-123',
members: { limit: 25 },
messages: { created_at_after: 10 },
});
console.log(response);Example: with state and thread_unread_counts
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateChannel({
type: 'like',
id: 'activity-123',
state: false,
thread_unread_counts: false,
});
console.log(response);Example: with watchers
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get or create channel
const response = await client.chat.getOrCreateChannel({
type: 'like',
id: 'activity-123',
watchers: { limit: 25 },
});
console.log(response);Response: ChannelStateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| data | ChannelInput | No | - |
| hide_for_creator | boolean | No | Whether this channel will be hidden for the user who created the channel or not |
| members | PaginationParams | No | - |
| messages | MessagePaginationParams | No | - |
| state | boolean | No | Refresh channel state |
| thread_unread_counts | boolean | No | - |
| watchers | PaginationParams | No | - |
markRead
Mark messages in a channel as read to update the read status and notify other members. Use this to keep track of read messages and manage message notifications.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mark read
const response = await client.chat.markRead({
type: 'like',
id: 'activity-123',
user_id: 'john',
thread_id: 'value',
});
console.log(response);Example: with user and message_id
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mark read
const response = await client.chat.markRead({
type: 'like',
id: 'activity-123',
user: { id: 'activity-123', custom: {} },
message_id: 'value',
});
console.log(response);Response: MarkReadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| message_id | string | No | ID of the message that is considered last read by client |
| thread_id | string | No | Optional Thread ID to specifically mark a given thread as read |
| user | UserRequest | No | - |
| user_id | string | No | - |
showChannel
Display detailed information about a specific channel, including its settings and current members. Use this to gain insights into a channel's configuration and participant list.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Show channel
const response = await client.chat.showChannel({
type: 'like',
id: 'activity-123',
user_id: 'john',
user: { id: 'activity-123', custom: {} },
});
console.log(response);Response: ShowChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| user | UserRequest | No | - |
| user_id | string | No | - |
truncateChannel
Clear all messages from a channel while preserving its settings and members, effectively resetting the conversation. Use this to start anew without deleting the channel entirely.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Truncate channel
const response = await client.chat.truncateChannel({
type: 'like',
id: 'activity-123',
user_id: 'john',
hard_delete: false,
});
console.log(response);Example: with skip_push and member_ids
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Truncate channel
const response = await client.chat.truncateChannel({
type: 'like',
id: 'activity-123',
skip_push: false,
member_ids: [],
});
console.log(response);Example: with truncated_at and user
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Truncate channel
const response = await client.chat.truncateChannel({
type: 'like',
id: 'activity-123',
truncated_at: 10,
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with message
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Truncate channel
const response = await client.chat.truncateChannel({
type: 'like',
id: 'activity-123',
message: { attachments: [] },
});
console.log(response);Response: TruncateChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| hard_delete | boolean | No | Permanently delete channel data (messages, reactions, etc.) |
| member_ids | []string | No | List of member IDs to hide message history for. If empty, truncates the channel for all members |
| message | MessageRequest | No | - |
| skip_push | boolean | No | When message is set disables all push notifications for it |
| truncated_at | float | No | Truncate channel data up to truncated_at. The system message (if provided) creation time is alw... |
| user | UserRequest | No | - |
| user_id | string | No | - |
markUnread
Mark messages in a channel as unread, which can be useful for revisiting important conversations or managing notification settings. Use this to reset the read status of messages that need attention.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mark unread
const response = await client.chat.markUnread({
type: 'like',
id: 'activity-123',
user_id: 'john',
message_timestamp: 10,
});
console.log(response);Example: with thread_id and user
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mark unread
const response = await client.chat.markUnread({
type: 'like',
id: 'activity-123',
thread_id: 'value',
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with message_id
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mark unread
const response = await client.chat.markUnread({
type: 'like',
id: 'activity-123',
message_id: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| message_id | string | No | ID of the message from where the channel is marked unread |
| message_timestamp | float | No | Timestamp of the message from where the channel is marked unread |
| thread_id | string | No | Mark a thread unread, specify one of the thread, message timestamp, or message id |
| user | UserRequest | No | - |
| user_id | string | No | - |
listChannelTypes
Retrieve a list of available channel types, each defining specific settings and behaviors. Use this to explore or select from different channel configurations for your communication needs.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// List channel types
const response = await client.chat.listChannelTypes();
console.log(response);Response: ListChannelTypesResponse
createChannelType
Define and create a new channel type with specific settings and behaviors to suit your application's requirements. Use this to customize how channels operate and interact based on your unique use case.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Create channel type
const response = await client.chat.createChannelType({
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
name: 'My Feed',
blocklist: 'value',
blocklist_behavior: 'value',
});
console.log(response);Example: with blocklists and chat_preferences
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Create channel type
const response = await client.chat.createChannelType({
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
name: 'My Feed',
blocklists: [],
chat_preferences: { channel_mentions: 'value' },
});
console.log(response);Example: with commands and connect_events
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Create channel type
const response = await client.chat.createChannelType({
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
name: 'My Feed',
commands: [],
connect_events: false,
});
console.log(response);Example: with count_messages and custom_events
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Create channel type
const response = await client.chat.createChannelType({
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
name: 'My Feed',
count_messages: false,
custom_events: false,
});
console.log(response);Response: CreateChannelTypeResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| automod | string | Yes | Automod. One of: disabled, simple, AI |
| automod_behavior | string | Yes | Automod behavior. One of: flag, block |
| max_message_length | number | Yes | Max message length |
| name | string | Yes | Channel type name |
| blocklist | string | No | Blocklist |
| blocklist_behavior | string | No | Blocklist behavior. One of: flag, block, shadow_block |
| blocklists | []BlockListOptions | No | Blocklists |
| chat_preferences | ChatPreferences | No | - |
| commands | []string | No | List of commands that channel supports |
| connect_events | boolean | No | Connect events |
| count_messages | boolean | No | Count messages in channel. |
| custom_events | boolean | No | Custom events |
| delivery_events | boolean | No | - |
| grants | Record<string, any> | No | List of grants for the channel type |
| mark_messages_pending | boolean | No | Mark messages pending |
| message_retention | string | No | Message retention. One of: infinite, numeric |
| mutes | boolean | No | Mutes |
| partition_size | number | No | Partition size |
| partition_ttl | string | No | Partition TTL |
| permissions | []PolicyRequest | No | List of permissions for the channel type |
| polls | boolean | No | Polls |
| push_level | string | No | Default push notification level for the channel type. One of: all, all_mentions, mentions, direct... |
| push_notifications | boolean | No | Push notifications |
| reactions | boolean | No | Reactions |
| read_events | boolean | No | Read events |
| replies | boolean | No | Replies |
| search | boolean | No | Search |
| shared_locations | boolean | No | Enables shared location messages |
| skip_last_msg_update_for_system_msgs | boolean | No | - |
| typing_events | boolean | No | Typing events |
| uploads | boolean | No | Uploads |
| url_enrichment | boolean | No | URL enrichment |
| user_message_reminders | boolean | No | - |
getChannelType
Retrieve information about a specific channel type to understand its configuration and settings, useful for reviewing or managing channel functionalities.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get channel type
const response = await client.chat.getChannelType({
name: 'My Feed',
});
console.log(response);Response: GetChannelTypeResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
updateChannelType
Modify the properties of an existing channel type to customize or enhance channel behavior according to specific requirements.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel type
const response = await client.chat.updateChannelType({
name: 'My Feed',
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
allowed_flag_reasons: [],
automod_thresholds: { explicit: { block: 10 } },
});
console.log(response);Example: with blocklist and blocklist_behavior
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel type
const response = await client.chat.updateChannelType({
name: 'My Feed',
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
blocklist: 'value',
blocklist_behavior: 'value',
});
console.log(response);Example: with blocklists and chat_preferences
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel type
const response = await client.chat.updateChannelType({
name: 'My Feed',
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
blocklists: [],
chat_preferences: { channel_mentions: 'value' },
});
console.log(response);Example: with commands and connect_events
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update channel type
const response = await client.chat.updateChannelType({
name: 'My Feed',
automod: 'value',
automod_behavior: 'value',
max_message_length: 10,
commands: [],
connect_events: false,
});
console.log(response);Response: UpdateChannelTypeResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
| automod | string | Yes | - |
| automod_behavior | string | Yes | - |
| max_message_length | number | Yes | - |
| allowed_flag_reasons | []string | No | - |
| automod_thresholds | Thresholds | No | - |
| blocklist | string | No | - |
| blocklist_behavior | string | No | - |
| blocklists | []BlockListOptions | No | - |
| chat_preferences | ChatPreferences | No | - |
| commands | []string | No | List of commands that channel supports |
| connect_events | boolean | No | - |
| count_messages | boolean | No | - |
| custom_events | boolean | No | - |
| delivery_events | boolean | No | - |
| grants | Record<string, any> | No | - |
| mark_messages_pending | boolean | No | - |
| mutes | boolean | No | - |
| partition_size | number | No | - |
| partition_ttl | string | No | - |
| permissions | []PolicyRequest | No | - |
| polls | boolean | No | - |
| push_level | string | No | - |
| push_notifications | boolean | No | - |
| quotes | boolean | No | - |
| reactions | boolean | No | - |
| read_events | boolean | No | - |
| reminders | boolean | No | - |
| replies | boolean | No | - |
| search | boolean | No | - |
| shared_locations | boolean | No | - |
| skip_last_msg_update_for_system_msgs | boolean | No | - |
| typing_events | boolean | No | - |
| uploads | boolean | No | - |
| url_enrichment | boolean | No | - |
| user_message_reminders | boolean | No | - |
deleteChannelType
Remove a channel type from your application to streamline channel categories or eliminate unused configurations.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete channel type
const response = await client.chat.deleteChannelType({
name: 'My Feed',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
listCommands
Obtain a list of all available commands, providing a quick reference to the commands that can be used within the chat environment.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// List commands
const response = await client.chat.listCommands();
console.log(response);Response: ListCommandsResponse
createCommand
Create a new command to extend chat functionalities, enabling custom actions or automations based on user input.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Create command
const response = await client.chat.createCommand({
description: 'A description',
name: 'My Feed',
args: 'value',
set: 'value',
});
console.log(response);Response: CreateCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| description | string | Yes | Description, shown in commands auto-completion |
| name | string | Yes | Unique command name |
| args | string | No | Arguments help text, shown in commands auto-completion |
| set | string | No | Set name used for grouping commands |
getCommand
Access details about a specific command to review its configuration or ensure it performs as expected within the chat.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get command
const response = await client.chat.getCommand({
name: 'My Feed',
});
console.log(response);Response: GetCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
updateCommand
Alter the properties of an existing command to refine its behavior or adapt to changing requirements in the chat application.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update command
const response = await client.chat.updateCommand({
name: 'My Feed',
description: 'A description',
args: 'value',
set: 'value',
});
console.log(response);Response: UpdateCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
| description | string | Yes | Description, shown in commands auto-completion |
| args | string | No | Arguments help text, shown in commands auto-completion |
| set | string | No | Set name used for grouping commands |
deleteCommand
Eliminate a command from your chat environment to simplify command options or remove outdated functionalities.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete command
const response = await client.chat.deleteCommand({
name: 'My Feed',
});
console.log(response);Response: DeleteCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
queryDrafts
Search for draft messages to review or manage incomplete communications before they are sent within the chat.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query draft messages
const response = await client.chat.queryDrafts({
user_id: 'john',
limit: 25,
filter: {},
});
console.log(response);Example: with sort and next
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query draft messages
const response = await client.chat.queryDrafts({
sort: [],
next: null,
});
console.log(response);Example: with user and prev
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query draft messages
const response = await client.chat.queryDrafts({
user: { id: 'activity-123', custom: {} },
prev: null,
});
console.log(response);Response: QueryDraftsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | No | Filter to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
| user | UserRequest | No | - |
| user_id | string | No | - |
exportChannels
Export channel data to preserve chat history, analyze communication patterns, or integrate with external systems for broader data use.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Export channels
const response = await client.chat.exportChannels({
channels: [],
clear_deleted_message_text: false,
export_users: false,
});
console.log(response);Example: with include_soft_deleted_channels and include_truncated_messages
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Export channels
const response = await client.chat.exportChannels({
channels: [],
include_soft_deleted_channels: false,
include_truncated_messages: false,
});
console.log(response);Example: with version
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Export channels
const response = await client.chat.exportChannels({
channels: [],
version: 'value',
});
console.log(response);Response: ExportChannelsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| channels | []ChannelExport | Yes | Export options for channels |
| clear_deleted_message_text | boolean | No | Set if deleted message text should be cleared |
| export_users | boolean | No | - |
| include_soft_deleted_channels | boolean | No | Set if you want to include deleted channels |
| include_truncated_messages | boolean | No | Set if you want to include truncated messages |
| version | string | No | Export version |
queryMembers
Retrieve a list of members within a chat, perfect for when you need to understand the participants in a conversation or manage member-related actions.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query members
const response = await client.chat.queryMembers({
payload: 'value',
});
console.log(response);Response: MembersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
queryMessageHistory
Access past messages in a chat to review previous interactions, useful for catching up on conversations or retrieving historical data.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query message history
const response = await client.chat.queryMessageHistory({
filter: {},
limit: 25,
sort: [],
});
console.log(response);Example: with prev and next
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query message history
const response = await client.chat.queryMessageHistory({
filter: {},
prev: null,
next: null,
});
console.log(response);Response: QueryMessageHistoryResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | Yes | Filter to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
getMessage
Fetch a specific message by its identifier, ideal for when you need detailed information about a particular message.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get message
const response = await client.chat.getMessage({
id: 'activity-123',
show_deleted_message: false,
});
console.log(response);Response: GetMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| show_deleted_message | boolean | No | - |
updateMessage
Modify the content of an existing message, useful for correcting errors or updating information within a conversation.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Update message
const response = await client.chat.updateMessage({
id: 'activity-123',
message: { attachments: [] },
skip_push: false,
skip_enrich_url: false,
});
console.log(response);Response: UpdateMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| message | MessageRequest | Yes | Message |
| skip_enrich_url | boolean | No | Skip enrich URL |
| skip_push | boolean | No | - |
updateMessagePartial
Make selective changes to parts of a message without altering the entire content, perfect for minor edits or updates.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially message update
const response = await client.chat.updateMessagePartial({
id: 'activity-123',
user_id: 'john',
skip_push: false,
});
console.log(response);Example: with set and unset
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially message update
const response = await client.chat.updateMessagePartial({
id: 'activity-123',
set: {},
unset: [],
});
console.log(response);Example: with user and skip_enrich_url
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially message update
const response = await client.chat.updateMessagePartial({
id: 'activity-123',
user: { id: 'activity-123', custom: {} },
skip_enrich_url: false,
});
console.log(response);Response: UpdateMessagePartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| set | Record<string, any> | No | Sets new field values |
| skip_enrich_url | boolean | No | Skip enriching the URL in the message |
| skip_push | boolean | No | - |
| unset | []string | No | Array of field names to unset |
| user | UserRequest | No | - |
| user_id | string | No | - |
deleteMessage
Remove a message from the chat, useful for managing content or when you need to eliminate outdated or inappropriate information.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete message
const response = await client.chat.deleteMessage({
id: 'activity-123',
hard: false,
deleted_by: 'value',
});
console.log(response);Example: with delete_for_me
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete message
const response = await client.chat.deleteMessage({
id: 'activity-123',
delete_for_me: false,
});
console.log(response);Response: DeleteMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| hard | boolean | No | - |
| deleted_by | string | No | - |
| delete_for_me | boolean | No | - |
runMessageAction
Execute a predefined action on a message, ideal for triggering automated responses or workflows based on message content.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Run message command action
const response = await client.chat.runMessageAction({
id: 'activity-123',
form_data: {},
user_id: 'john',
user: { id: 'activity-123', custom: {} },
});
console.log(response);Response: MessageActionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| form_data | Record<string, any> | Yes | ReadOnlyData to execute command with |
| user | UserRequest | No | - |
| user_id | string | No | - |
commitMessage
Finalize and save changes made to a message, ensuring that all updates are applied and visible to chat participants.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Commit message
const response = await client.chat.commitMessage({
id: 'activity-123',
});
console.log(response);Response: MessageActionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
ephemeralMessageUpdate
Update an ephemeral message, which is temporary and may disappear after a set time, useful for time-sensitive or transient information.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Ephemeral message update
const response = await client.chat.ephemeralMessageUpdate({
id: 'activity-123',
user_id: 'john',
skip_push: false,
});
console.log(response);Example: with set and unset
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Ephemeral message update
const response = await client.chat.ephemeralMessageUpdate({
id: 'activity-123',
set: {},
unset: [],
});
console.log(response);Example: with user and skip_enrich_url
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Ephemeral message update
const response = await client.chat.ephemeralMessageUpdate({
id: 'activity-123',
user: { id: 'activity-123', custom: {} },
skip_enrich_url: false,
});
console.log(response);Response: UpdateMessagePartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| set | Record<string, any> | No | Sets new field values |
| skip_enrich_url | boolean | No | Skip enriching the URL in the message |
| skip_push | boolean | No | - |
| unset | []string | No | Array of field names to unset |
| user | UserRequest | No | - |
| user_id | string | No | - |
sendReaction
Express your response or feedback to a message by sending an emoji reaction, enhancing interaction and engagement within the chat.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Send reaction
const response = await client.chat.sendReaction({
id: 'activity-123',
reaction: { type: 'like', created_at: 10 },
skip_push: false,
enforce_unique: true,
});
console.log(response);Response: SendReactionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| reaction | ReactionRequest | Yes | - |
| enforce_unique | boolean | No | Whether to replace all existing user reactions |
| skip_push | boolean | No | Skips any mobile push notifications |
deleteReaction
Removes a user's reaction from a message, useful for managing or correcting reactions in a conversation.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete reaction
const response = await client.chat.deleteReaction({
id: 'activity-123',
type: 'like',
user_id: 'john',
});
console.log(response);Response: DeleteReactionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| type | string | Yes | - |
| user_id | string | No | - |
getReactions
Retrieves all reactions associated with a specific message, allowing users to view collective feedback or expressions from the chat participants.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get reactions
const response = await client.chat.getReactions({
id: 'activity-123',
limit: 25,
offset: 0,
});
console.log(response);Response: GetReactionsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| limit | number | No | - |
| offset | number | No | - |
queryReactions
Fetches specific reactions based on given criteria, enabling users to filter and analyze reactions for insights or moderation.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
//
const response = await client.chat.queryReactions({
id: 'activity-123',
user_id: 'john',
limit: 25,
});
console.log(response);Example: with filter and sort
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
//
const response = await client.chat.queryReactions({
id: 'activity-123',
filter: {},
sort: [],
});
console.log(response);Example: with next and user
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
//
const response = await client.chat.queryReactions({
id: 'activity-123',
next: null,
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with prev
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
//
const response = await client.chat.queryReactions({
id: 'activity-123',
prev: null,
});
console.log(response);Response: QueryReactionsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| filter | Record<string, any> | No | Filter to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
| user | UserRequest | No | - |
| user_id | string | No | - |
translateMessage
Converts a message into a different language, facilitating communication between users who speak different languages.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Translate message
const response = await client.chat.translateMessage({
id: 'activity-123',
language: 'value',
});
console.log(response);Response: MessageActionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| language | string | Yes | Language to translate message to |
undeleteMessage
Restores a previously deleted message, useful for recovering important information or correcting accidental deletions.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Undelete message
const response = await client.chat.undeleteMessage({
id: 'activity-123',
undeleted_by: 'value',
});
console.log(response);Response: UndeleteMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| undeleted_by | string | Yes | ID of the user who is undeleting the message |
castPollVote
Allows a user to submit their vote in a poll, enabling participation and engagement in decision-making processes.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Cast vote
const response = await client.chat.castPollVote({
message_id: 'value',
poll_id: 'poll-123',
user_id: 'john',
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with vote
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Cast vote
const response = await client.chat.castPollVote({
message_id: 'value',
poll_id: 'poll-123',
vote: { answer_text: 'value' },
});
console.log(response);Response: PollVoteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| poll_id | string | Yes | - |
| user | UserRequest | No | - |
| user_id | string | No | - |
| vote | VoteData | No | Vote data |
deletePollVote
Removes a user's vote from a poll, providing flexibility to change decisions or correct voting errors.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete vote
const response = await client.chat.deletePollVote({
message_id: 'value',
poll_id: 'poll-123',
vote_id: 'vote-123',
user_id: 'john',
});
console.log(response);Response: PollVoteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| poll_id | string | Yes | - |
| vote_id | string | Yes | - |
| user_id | string | No | - |
createReminder
Sets up a reminder for a specific event or task, helping users stay organized and remember important dates or activities.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Create reminder
const response = await client.chat.createReminder({
message_id: 'value',
user_id: 'john',
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with remind_at
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Create reminder
const response = await client.chat.createReminder({
message_id: 'value',
remind_at: 10,
});
console.log(response);Response: ReminderResponseData
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| remind_at | float | No | - |
| user | UserRequest | No | - |
| user_id | string | No | - |
updateReminder
Modifies an existing reminder, allowing users to adjust details or schedules to accommodate changes in plans.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Updates Reminder
const response = await client.chat.updateReminder({
message_id: 'value',
user_id: 'john',
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with remind_at
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Updates Reminder
const response = await client.chat.updateReminder({
message_id: 'value',
remind_at: 10,
});
console.log(response);Response: UpdateReminderResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| remind_at | float | No | - |
| user | UserRequest | No | - |
| user_id | string | No | - |
deleteReminder
Removes an existing reminder, useful for clearing completed tasks or canceling unnecessary notifications.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete reminder
const response = await client.chat.deleteReminder({
message_id: 'value',
user_id: 'john',
});
console.log(response);Response: DeleteReminderResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| user_id | string | No | - |
getReplies
Retrieve all replies to a specific message, useful for following a conversation thread within a chat.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get replies
const response = await client.chat.getReplies({
parent_id: 'parent-123',
limit: 25,
sort: [],
});
console.log(response);Example: with id_gte and id_gt
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get replies
const response = await client.chat.getReplies({
parent_id: 'parent-123',
id_gte: 'value',
id_gt: 'value',
});
console.log(response);Example: with id_lte and id_lt
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get replies
const response = await client.chat.getReplies({
parent_id: 'parent-123',
id_lte: 'value',
id_lt: 'value',
});
console.log(response);Example: with id_around
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get replies
const response = await client.chat.getReplies({
parent_id: 'parent-123',
id_around: 'value',
});
console.log(response);Response: GetRepliesResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| parent_id | string | Yes | - |
| sort | []SortParamRequest | No | - |
| limit | number | No | - |
| id_gte | string | No | - |
| id_gt | string | No | - |
| id_lte | string | No | - |
| id_lt | string | No | - |
| id_around | string | No | - |
queryMessageFlags
Check the flags associated with messages, helping to identify and manage content that requires moderation or attention.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Message Flags
const response = await client.chat.queryMessageFlags({
payload: 'value',
});
console.log(response);Response: QueryMessageFlagsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
muteChannel
Temporarily silence notifications from a specific channel, ideal for minimizing distractions without leaving the conversation.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mute channel
const response = await client.chat.muteChannel({
user_id: 'john',
expiration: 10,
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with channel_cids
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Mute channel
const response = await client.chat.muteChannel({
channel_cids: [],
});
console.log(response);Response: MuteChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| channel_cids | []string | No | Channel CIDs to mute (if multiple channels) |
| expiration | number | No | Duration of mute in milliseconds |
| user | UserRequest | No | - |
| user_id | string | No | - |
unmuteChannel
Re-enable notifications for a previously muted channel, allowing you to stay updated on new messages.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Unmute channel
const response = await client.chat.unmuteChannel({
user_id: 'john',
expiration: 10,
user: { id: 'activity-123', custom: {} },
});
console.log(response);Example: with channel_cids
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Unmute channel
const response = await client.chat.unmuteChannel({
channel_cids: [],
});
console.log(response);Response: UnmuteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| channel_cids | []string | No | Channel CIDs to mute (if multiple channels) |
| expiration | number | No | Duration of mute in milliseconds |
| user | UserRequest | No | - |
| user_id | string | No | - |
queryBannedUsers
List the users who have been banned from a chat, useful for managing community access and enforcing rules.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Banned Users
const response = await client.chat.queryBannedUsers({
payload: 'value',
});
console.log(response);Response: QueryBannedUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
queryFutureChannelBans
View scheduled bans for a channel, helping you anticipate and manage upcoming restrictions on user access.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Future Channel Bans
const response = await client.chat.queryFutureChannelBans({
payload: 'value',
});
console.log(response);Response: QueryFutureChannelBansResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
queryReminders
Access a list of reminders set within the chat, ensuring you don't miss important events or tasks.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query reminders
const response = await client.chat.queryReminders({
user_id: 'john',
limit: 25,
filter: {},
});
console.log(response);Example: with sort and next
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query reminders
const response = await client.chat.queryReminders({
sort: [],
next: null,
});
console.log(response);Example: with user and prev
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query reminders
const response = await client.chat.queryReminders({
user: { id: 'activity-123', custom: {} },
prev: null,
});
console.log(response);Response: QueryRemindersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | No | Filter to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
| user | UserRequest | No | - |
| user_id | string | No | - |
getRetentionPolicy
Retrieve the current data retention policy to understand how long data is stored and managed, ensuring compliance with organizational or regulatory requirements.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get retention policy
const response = await client.chat.getRetentionPolicy();
console.log(response);Response: GetRetentionPolicyResponse
setRetentionPolicy
Define or modify the data retention policy to control how long data is retained, helping maintain data governance and compliance.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Set retention policy
const response = await client.chat.setRetentionPolicy({
max_age_hours: 10,
policy: 'value',
});
console.log(response);Response: SetRetentionPolicyResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| max_age_hours | number | Yes | - |
| policy | string | Yes | - |
deleteRetentionPolicy
Remove an existing data retention policy when it is no longer needed, helping streamline data management practices.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete retention policy
const response = await client.chat.deleteRetentionPolicy({
policy: 'value',
});
console.log(response);Response: DeleteRetentionPolicyResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| policy | string | Yes | - |
getRetentionPolicyRuns
Access historical records of retention policy executions to monitor compliance and review data management activities over time.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get retention policy runs
const response = await client.chat.getRetentionPolicyRuns({
limit: 25,
sort: [],
filter_conditions: {},
});
console.log(response);Example: with prev and next
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get retention policy runs
const response = await client.chat.getRetentionPolicyRuns({
prev: null,
next: null,
});
console.log(response);Response: GetRetentionPolicyRunsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter_conditions | Record<string, any> | No | Filter conditions to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
search
Look for specific messages across channels using keywords, enabling you to quickly find relevant information or past conversations.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Search messages
const response = await client.chat.search({
payload: 'value',
});
console.log(response);Response: SearchResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
querySegments
Retrieve a list of user segments based on specified criteria, useful for targeted communication and analysis.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query segments
const response = await client.chat.querySegments({
filter: {},
limit: 25,
sort: [],
});
console.log(response);Example: with prev and next
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query segments
const response = await client.chat.querySegments({
filter: {},
prev: null,
next: null,
});
console.log(response);Response: QuerySegmentsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | Yes | Filter to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
getSegment
Obtain detailed information about a specific user segment, aiding in personalized engagement and insights.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get segment
const response = await client.chat.getSegment({
id: 'activity-123',
});
console.log(response);Response: GetSegmentResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
deleteSegment
Remove a specific segment from your chat application, useful for managing and organizing user groups or data collections.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete segment
const response = await client.chat.deleteSegment({
id: 'activity-123',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
deleteSegmentTargets
Remove specified targets from a segment, helpful for updating or refining the members or elements within a segment.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Delete targets from a segment
const response = await client.chat.deleteSegmentTargets({
id: 'activity-123',
target_ids: [],
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| target_ids | []string | Yes | Target IDs |
segmentTargetExists
Verify if a particular target is part of a segment, useful for ensuring data accuracy or confirming membership before performing operations.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Check whether a target exists in a segment
const response = await client.chat.segmentTargetExists({
id: 'activity-123',
target_id: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| target_id | string | Yes | - |
querySegmentTargets
Retrieve a list of targets within a segment, ideal for gaining insights or performing actions on specific segment members.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query segment targets
const response = await client.chat.querySegmentTargets({
id: 'activity-123',
limit: 25,
Sort: [],
});
console.log(response);Example: with Filter and next
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query segment targets
const response = await client.chat.querySegmentTargets({
id: 'activity-123',
Filter: {},
next: null,
});
console.log(response);Example: with prev
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query segment targets
const response = await client.chat.querySegmentTargets({
id: 'activity-123',
prev: null,
});
console.log(response);Response: QuerySegmentTargetsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| Filter | Record<string, any> | No | - |
| Sort | []SortParamRequest | No | - |
| limit | number | No | Limit |
| next | string | No | Next |
| prev | string | No | Prev |
queryTeamUsageStats
Obtain detailed statistics on team usage to evaluate engagement levels, optimize resource allocation, and improve team performance.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Team Usage Statistics
const response = await client.chat.queryTeamUsageStats({
limit: 25,
end_date: 'value',
month: 'value',
});
console.log(response);Example: with next and start_date
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Team Usage Statistics
const response = await client.chat.queryTeamUsageStats({
next: null,
start_date: 'value',
});
console.log(response);Response: QueryTeamUsageStatsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| end_date | string | No | End date in YYYY-MM-DD format. Used with start_date for custom date range. Returns daily breakdown. |
| limit | number | No | Maximum number of teams to return per page (default: 30, max: 30) |
| month | string | No | Month in YYYY-MM format (e.g., '2026-01'). Mutually exclusive with start_date/end_date. Returns a... |
| next | string | No | Cursor for pagination to fetch next page of teams |
| start_date | string | No | Start date in YYYY-MM-DD format. Used with end_date for custom date range. Returns daily breakdown. |
queryThreads
Search and filter chat threads based on specific criteria, enabling efficient navigation and management of conversation histories.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Threads
const response = await client.chat.queryThreads({
user_id: 'john',
limit: 25,
filter: {},
});
console.log(response);Example: with sort and participant_limit
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Threads
const response = await client.chat.queryThreads({
sort: [],
participant_limit: 10,
});
console.log(response);Example: with prev and reply_limit
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Threads
const response = await client.chat.queryThreads({
prev: null,
reply_limit: 10,
});
console.log(response);Example: with member_limit and user
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Query Threads
const response = await client.chat.queryThreads({
member_limit: 10,
user: { id: 'activity-123', custom: {} },
});
console.log(response);Response: QueryThreadsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | No | Filter to apply to the query |
| limit | number | No | - |
| member_limit | number | No | - |
| next | string | No | - |
| participant_limit | number | No | Limit the number of participants returned per each thread |
| prev | string | No | - |
| reply_limit | number | No | Limit the number of replies returned per each thread |
| sort | []SortParamRequest | No | Array of sort parameters |
| user | UserRequest | No | - |
| user_id | string | No | - |
getThread
Retrieve detailed information about a specific chat thread, useful for reviewing conversation content or metadata.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get Thread
const response = await client.chat.getThread({
message_id: 'value',
reply_limit: 10,
participant_limit: 10,
});
console.log(response);Example: with member_limit
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Get Thread
const response = await client.chat.getThread({
message_id: 'value',
member_limit: 10,
});
console.log(response);Response: GetThreadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| reply_limit | number | No | - |
| participant_limit | number | No | - |
| member_limit | number | No | - |
updateThreadPartial
Make selective updates to a chat thread without altering its entire content, useful for modifying specific details or attributes.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially update thread
const response = await client.chat.updateThreadPartial({
message_id: 'value',
user_id: 'john',
unset: [],
});
console.log(response);Example: with user and set
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Partially update thread
const response = await client.chat.updateThreadPartial({
message_id: 'value',
user: { id: 'activity-123', custom: {} },
set: {},
});
console.log(response);Response: UpdateThreadPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| set | Record<string, any> | No | Sets new field values |
| unset | []string | No | Array of field names to unset |
| user | UserRequest | No | - |
| user_id | string | No | - |
unreadCounts
Check the number of unread messages in chat threads, helping users stay informed about new activity and prioritize responses.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Unread counts
const response = await client.chat.unreadCounts({
user_id: 'john',
});
console.log(response);Response: WrappedUnreadCountsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | No | - |
unreadCountsBatch
Obtain unread message counts for multiple chat threads simultaneously, providing a comprehensive overview of pending messages.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Batch unread counts
const response = await client.chat.unreadCountsBatch({
user_ids: ['user-1', 'user-2'],
});
console.log(response);Response: UnreadCountsBatchResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_ids | []string | Yes | - |
sendUserCustomEvent
Trigger a custom event associated with a user, useful for tracking user interactions or implementing personalized features.
Example
// Using @stream-io/node-sdk
import { StreamClient } from '@stream-io/node-sdk';
const client = new StreamClient(apiKey, apiSecret);
// Send user event
const response = await client.chat.sendUserCustomEvent({
user_id: 'john',
event: { type: 'like', custom: {} },
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | - |
| event | UserCustomEventRequest | Yes | - |
Types Reference
This section documents the types/interfaces used in this API. These types are extracted from the OpenAPI specification.
Attachment
An attachment is a message object that represents a file uploaded by a user.
interface Attachment {
actions?: Action[];
asset_url?: string;
author_icon?: string;
author_link?: string;
author_name?: string;
color?: string;
custom: Record<string, any>;
fallback?: string;
fields?: Field[];
footer?: string;
footer_icon?: string;
giphy?: Images;
image_url?: string;
og_scrape_url?: string;
original_height?: number;
original_width?: number;
pretext?: string;
text?: string;
thumb_url?: string;
title?: string;
title_link?: string;
type?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Record<string, any> | Yes | |
| actions | Action[] | No | |
| asset_url | string | No | |
| author_icon | string | No | |
| author_link | string | No | |
| author_name | string | No | |
| color | string | No | |
| fallback | string | No | |
| fields | Field[] | No | |
| footer | string | No | |
| footer_icon | string | No | |
| giphy | Images | No | |
| image_url | string | No | |
| og_scrape_url | string | No | |
| original_height | number | No | |
| original_width | number | No | |
| pretext | string | No | |
| text | string | No | |
| thumb_url | string | No | |
| title | string | No | |
| title_link | string | No | |
| type | string | No | Attachment type (e.g. image, video, url) |
BanResponse
interface BanResponse {
banned_by?: UserResponse;
channel?: ChannelResponse;
created_at: number;
expires?: number;
reason?: string;
shadow?: boolean;
user?: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| banned_by | UserResponse | No | |
| channel | ChannelResponse | No | |
| expires | number | No | |
| reason | string | No | |
| shadow | boolean | No | |
| user | UserResponse | No |
BlockListOptions
interface BlockListOptions {
behavior: 'flag' | 'block' | 'shadow_block';
blocklist: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| behavior | 'flag' | 'block' | 'shadow_block' |
| blocklist | string | Yes | Blocklist name |
CampaignChannelTemplate
interface CampaignChannelTemplate {
custom: Record<string, any>;
id?: string;
members?: string[];
members_template?: CampaignChannelMember[];
team?: string;
type: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Record<string, any> | Yes | |
| type | string | Yes | |
| id | string | No | |
| members | string[] | No | |
| members_template | CampaignChannelMember[] | No | |
| team | string | No |
CampaignMessageTemplate
interface CampaignMessageTemplate {
attachments: Attachment[];
custom: Record<string, any>;
poll_id: string;
searchable: boolean;
text: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | Attachment[] | Yes | |
| custom | Record<string, any> | Yes | |
| poll_id | string | Yes | |
| searchable | boolean | Yes | |
| text | string | Yes |
CampaignResponse
interface CampaignResponse {
channel_template?: CampaignChannelTemplate;
create_channels: boolean;
created_at: number;
description: string;
id: string;
message_template?: CampaignMessageTemplate;
name: string;
scheduled_for?: number;
segment_ids: string[];
segments: Segment[];
sender?: UserResponse;
sender_id: string;
sender_mode: string;
sender_visibility: string;
show_channels: boolean;
skip_push: boolean;
skip_webhook: boolean;
stats: CampaignStatsResponse;
status: string;
stop_at?: number;
updated_at: number;
user_ids: string[];
users: UserResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| create_channels | boolean | Yes | |
| created_at | number | Yes | |
| description | string | Yes | |
| id | string | Yes | |
| name | string | Yes | |
| segment_ids | string[] | Yes | |
| segments | Segment[] | Yes | |
| sender_id | string | Yes | |
| sender_mode | string | Yes | |
| sender_visibility | string | Yes | |
| show_channels | boolean | Yes | |
| skip_push | boolean | Yes | |
| skip_webhook | boolean | Yes | |
| stats | CampaignStatsResponse | Yes | |
| status | string | Yes | |
| updated_at | number | Yes | |
| user_ids | string[] | Yes | |
| users | UserResponse[] | Yes | |
| channel_template | CampaignChannelTemplate | No | |
| message_template | CampaignMessageTemplate | No | |
| scheduled_for | number | No | |
| sender | UserResponse | No | |
| stop_at | number | No |
CampaignStatsResponse
interface CampaignStatsResponse {
progress: number;
stats_channels_created: number;
stats_completed_at: number;
stats_messages_sent: number;
stats_started_at: number;
stats_users_read: number;
stats_users_sent: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| progress | number | Yes | |
| stats_channels_created | number | Yes | |
| stats_completed_at | number | Yes | |
| stats_messages_sent | number | Yes | |
| stats_started_at | number | Yes | |
| stats_users_read | number | Yes | |
| stats_users_sent | number | Yes |
ChannelBatchMemberRequest
interface ChannelBatchMemberRequest {
channel_role?: string;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | |
| channel_role | string | No |
ChannelBatchUpdateResponse
Basic response information
interface ChannelBatchUpdateResponse {
duration: string;
task_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| task_id | string | No |
ChannelConfig
interface ChannelConfig {
allowed_flag_reasons?: string[];
automod: 'disabled' | 'simple' | 'AI';
automod_behavior: 'flag' | 'block' | 'shadow_block';
automod_thresholds?: Thresholds;
blocklist?: string;
blocklist_behavior?: 'flag' | 'block' | 'shadow_block';
blocklists?: BlockListOptions[];
chat_preferences?: ChatPreferences;
commands: string[];
connect_events: boolean;
count_messages: boolean;
created_at: number;
custom_events: boolean;
delivery_events: boolean;
mark_messages_pending: boolean;
max_message_length: number;
mutes: boolean;
name: string;
partition_size?: number;
partition_ttl?: string;
polls: boolean;
push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none';
push_notifications: boolean;
quotes: boolean;
reactions: boolean;
read_events: boolean;
reminders: boolean;
replies: boolean;
search: boolean;
shared_locations: boolean;
skip_last_msg_update_for_system_msgs: boolean;
typing_events: boolean;
updated_at: number;
uploads: boolean;
url_enrichment: boolean;
user_message_reminders: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | 'disabled' | 'simple' | 'AI' |
| automod_behavior | 'flag' | 'block' | 'shadow_block' |
| commands | string[] | Yes | List of commands that channel supports |
| connect_events | boolean | Yes | |
| count_messages | boolean | Yes | |
| created_at | number | Yes | |
| custom_events | boolean | Yes | |
| delivery_events | boolean | Yes | |
| mark_messages_pending | boolean | Yes | |
| max_message_length | number | Yes | |
| mutes | boolean | Yes | |
| name | string | Yes | |
| polls | boolean | Yes | |
| push_notifications | boolean | Yes | |
| quotes | boolean | Yes | |
| reactions | boolean | Yes | |
| read_events | boolean | Yes | |
| reminders | boolean | Yes | |
| replies | boolean | Yes | |
| search | boolean | Yes | |
| shared_locations | boolean | Yes | |
| skip_last_msg_update_for_system_msgs | boolean | Yes | |
| typing_events | boolean | Yes | |
| updated_at | number | Yes | |
| uploads | boolean | Yes | |
| url_enrichment | boolean | Yes | |
| user_message_reminders | boolean | Yes | |
| allowed_flag_reasons | string[] | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | 'flag' | 'block' | 'shadow_block' |
| blocklists | BlockListOptions[] | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | number | No | |
| partition_ttl | string | No | |
| push_level | 'all' | 'all_mentions' | 'mentions' |
ChannelDataUpdate
interface ChannelDataUpdate {
auto_translation_enabled?: boolean;
auto_translation_language?: string;
config_overrides?: ChannelConfig;
custom?: Record<string, any>;
disabled?: boolean;
frozen?: boolean;
team?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | boolean | No | |
| auto_translation_language | string | No | |
| config_overrides | ChannelConfig | No | |
| custom | Record<string, any> | No | |
| disabled | boolean | No | |
| frozen | boolean | No | |
| team | string | No |
ChannelExport
interface ChannelExport {
cid?: string;
id?: string;
messages_since?: number;
messages_until?: number;
type?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | No | |
| id | string | No | Channel ID |
| messages_since | number | No | Date to export messages since |
| messages_until | number | No | Date to export messages until |
| type | string | No | Channel type |
ChannelInput
interface ChannelInput {
auto_translation_enabled?: boolean;
auto_translation_language?: string;
config_overrides?: ChannelConfig;
created_by?: UserRequest;
created_by_id?: string;
custom?: Record<string, any>;
disabled?: boolean;
filter_tags?: string[];
frozen?: boolean;
invites?: ChannelMemberRequest[];
members?: ChannelMemberRequest[];
team?: string;
truncated_by_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | boolean | No | Enable or disable auto translation |
| auto_translation_language | string | No | Switch auto translation language |
| config_overrides | ChannelConfig | No | |
| created_by | UserRequest | No | |
| created_by_id | string | No | |
| custom | Record<string, any> | No | |
| disabled | boolean | No | |
| filter_tags | string[] | No | |
| frozen | boolean | No | Freeze or unfreeze the channel |
| invites | ChannelMemberRequest[] | No | |
| members | ChannelMemberRequest[] | No | |
| team | string | No | Team the channel belongs to (if multi-tenant mode is enabled) |
| truncated_by_id | string | No |
ChannelInputRequest
interface ChannelInputRequest {
auto_translation_enabled?: boolean;
auto_translation_language?: string;
config_overrides?: ConfigOverridesRequest;
created_by?: UserRequest;
custom?: Record<string, any>;
disabled?: boolean;
frozen?: boolean;
invites?: ChannelMemberRequest[];
members?: ChannelMemberRequest[];
team?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | boolean | No | |
| auto_translation_language | string | No | |
| config_overrides | ConfigOverridesRequest | No | |
| created_by | UserRequest | No | |
| custom | Record<string, any> | No | |
| disabled | boolean | No | |
| frozen | boolean | No | |
| invites | ChannelMemberRequest[] | No | |
| members | ChannelMemberRequest[] | No | |
| team | string | No |
ChannelMemberRequest
interface ChannelMemberRequest {
channel_role?: string;
custom?: Record<string, any>;
user?: UserResponse;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | |
| channel_role | string | No | Role of the member in the channel |
| custom | Record<string, any> | No | |
| user | UserResponse | No |
ChannelMemberResponse
interface ChannelMemberResponse {
archived_at?: number;
ban_expires?: number;
banned: boolean;
channel_role: string;
created_at: number;
custom: Record<string, any>;
deleted_at?: number;
deleted_messages?: string[];
invite_accepted_at?: number;
invite_rejected_at?: number;
invited?: boolean;
is_moderator?: boolean;
notifications_muted: boolean;
pinned_at?: number;
role?: string;
shadow_banned: boolean;
status?: string;
updated_at: number;
user?: UserResponse;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | boolean | Yes | Whether member is banned this channel or not |
| channel_role | string | Yes | Role of the member in the channel |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | |
| notifications_muted | boolean | Yes | |
| shadow_banned | boolean | Yes | Whether member is shadow banned in this channel or not |
| updated_at | number | Yes | Date/time of the last update |
| archived_at | number | No | |
| ban_expires | number | No | Expiration date of the ban |
| deleted_at | number | No | |
| deleted_messages | string[] | No | |
| invite_accepted_at | number | No | Date when invite was accepted |
| invite_rejected_at | number | No | Date when invite was rejected |
| invited | boolean | No | Whether member was invited or not |
| is_moderator | boolean | No | Whether member is channel moderator or not |
| pinned_at | number | No | |
| role | string | No | Permission level of the member in the channel (DEPRECATED: use channel_role i... |
| status | string | No | |
| user | UserResponse | No | |
| user_id | string | No |
ChannelMute
interface ChannelMute {
channel?: ChannelResponse;
created_at: number;
expires?: number;
updated_at: number;
user?: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | Date/time of creation |
| updated_at | number | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel that is muted |
| expires | number | No | Date/time of mute expiration |
| user | UserResponse | No | Owner of channel mute |
ChannelPushPreferencesResponse
interface ChannelPushPreferencesResponse {
chat_level?: string;
chat_preferences?: ChatPreferencesResponse;
disabled_until?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| chat_level | string | No | |
| chat_preferences | ChatPreferencesResponse | No | |
| disabled_until | number | No |
ChannelResponse
Represents channel in chat
interface ChannelResponse {
auto_translation_enabled?: boolean;
auto_translation_language?: string;
blocked?: boolean;
cid: string;
config?: ChannelConfigWithInfo;
cooldown?: number;
created_at: number;
created_by?: UserResponse;
custom: Record<string, any>;
deleted_at?: number;
disabled: boolean;
filter_tags?: string[];
frozen: boolean;
hidden?: boolean;
hide_messages_before?: number;
id: string;
last_message_at?: number;
member_count?: number;
members?: ChannelMemberResponse[];
message_count?: number;
mute_expires_at?: number;
muted?: boolean;
own_capabilities?: ChannelOwnCapability[];
team?: string;
truncated_at?: number;
truncated_by?: UserResponse;
type: string;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | Yes | Channel CID (<type>:<id>) |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | Custom data for this object |
| disabled | boolean | Yes | |
| frozen | boolean | Yes | Whether channel is frozen or not |
| id | string | Yes | Channel unique ID |
| type | string | Yes | Type of the channel |
| updated_at | number | Yes | Date/time of the last update |
| auto_translation_enabled | boolean | No | Whether auto translation is enabled or not |
| auto_translation_language | string | No | Language to translate to when auto translation is active |
| blocked | boolean | No | Whether this channel is blocked by current user or not |
| config | ChannelConfigWithInfo | No | Channel configuration |
| cooldown | number | No | Cooldown period after sending each message |
| created_by | UserResponse | No | Creator of the channel |
| deleted_at | number | No | Date/time of deletion |
| filter_tags | string[] | No | List of filter tags associated with the channel |
| hidden | boolean | No | Whether this channel is hidden by current user or not |
| hide_messages_before | number | No | Date since when the message history is accessible |
| last_message_at | number | No | Date of the last message sent |
| member_count | number | No | Number of members in the channel |
| members | ChannelMemberResponse[] | No | List of channel members (max 100) |
| message_count | number | No | Number of messages in the channel |
| mute_expires_at | number | No | Date of mute expiration |
| muted | boolean | No | Whether this channel is muted or not |
| own_capabilities | ChannelOwnCapability[] | No | List of channel capabilities of authenticated user |
| team | string | No | Team the channel belongs to (multi-tenant only) |
| truncated_at | number | No | Date of the latest truncation of the channel |
| truncated_by | UserResponse | No |
ChannelStateResponse
interface ChannelStateResponse {
active_live_locations?: SharedLocationResponseData[];
channel?: ChannelResponse;
draft?: DraftResponse;
duration: string;
hidden?: boolean;
hide_messages_before?: number;
members: ChannelMemberResponse[];
membership?: ChannelMemberResponse;
messages: MessageResponse[];
pending_messages?: PendingMessageResponse[];
pinned_messages: MessageResponse[];
push_preferences?: ChannelPushPreferencesResponse;
read?: ReadStateResponse[];
threads: ThreadStateResponse[];
watcher_count?: number;
watchers?: UserResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| members | ChannelMemberResponse[] | Yes | |
| messages | MessageResponse[] | Yes | |
| pinned_messages | MessageResponse[] | Yes | |
| threads | ThreadStateResponse[] | Yes | |
| active_live_locations | SharedLocationResponseData[] | No | |
| channel | ChannelResponse | No | |
| draft | DraftResponse | No | |
| hidden | boolean | No | |
| hide_messages_before | number | No | |
| membership | ChannelMemberResponse | No | |
| pending_messages | PendingMessageResponse[] | No | |
| push_preferences | ChannelPushPreferencesResponse | No | |
| read | ReadStateResponse[] | No | |
| watcher_count | number | No | |
| watchers | UserResponse[] | No |
ChannelStateResponseFields
interface ChannelStateResponseFields {
active_live_locations?: SharedLocationResponseData[];
channel?: ChannelResponse;
draft?: DraftResponse;
hidden?: boolean;
hide_messages_before?: number;
members: ChannelMemberResponse[];
membership?: ChannelMemberResponse;
messages: MessageResponse[];
pending_messages?: PendingMessageResponse[];
pinned_messages: MessageResponse[];
push_preferences?: ChannelPushPreferencesResponse;
read?: ReadStateResponse[];
threads: ThreadStateResponse[];
watcher_count?: number;
watchers?: UserResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| members | ChannelMemberResponse[] | Yes | List of channel members |
| messages | MessageResponse[] | Yes | List of channel messages |
| pinned_messages | MessageResponse[] | Yes | List of pinned messages in the channel |
| threads | ThreadStateResponse[] | Yes | |
| active_live_locations | SharedLocationResponseData[] | No | Active live locations in the channel |
| channel | ChannelResponse | No | |
| draft | DraftResponse | No | |
| hidden | boolean | No | Whether this channel is hidden or not |
| hide_messages_before | number | No | Messages before this date are hidden from the user |
| membership | ChannelMemberResponse | No | Current user membership object |
| pending_messages | PendingMessageResponse[] | No | Pending messages that this user has sent |
| push_preferences | ChannelPushPreferencesResponse | No | |
| read | ReadStateResponse[] | No | List of read states |
| watcher_count | number | No | Number of channel watchers |
| watchers | UserResponse[] | No | List of user who is watching the channel |
ChatPreferences
interface ChatPreferences {
channel_mentions?: string;
default_preference?: string;
direct_mentions?: string;
distinct_channel_messages?: string;
group_mentions?: string;
here_mentions?: string;
role_mentions?: string;
thread_replies?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_mentions | string | No | |
| default_preference | string | No | |
| direct_mentions | string | No | |
| distinct_channel_messages | string | No | |
| group_mentions | string | No | |
| here_mentions | string | No | |
| role_mentions | string | No | |
| thread_replies | string | No |
Command
Represents custom chat command
interface Command {
args: string;
created_at?: number;
description: string;
name: string;
set: string;
updated_at?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| args | string | Yes | Arguments help text, shown in commands auto-completion |
| description | string | Yes | Description, shown in commands auto-completion |
| name | string | Yes | Unique command name |
| set | string | Yes | Set name used for grouping commands |
| created_at | number | No | Date/time of creation |
| updated_at | number | No | Date/time of the last update |
ConfigOverridesRequest
Channel configuration overrides
interface ConfigOverridesRequest {
blocklist?: string;
blocklist_behavior?: 'flag' | 'block';
chat_preferences?: ChatPreferences;
commands?: string[];
count_messages?: boolean;
grants?: Record<string, any>;
max_message_length?: number;
push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none';
quotes?: boolean;
reactions?: boolean;
replies?: boolean;
shared_locations?: boolean;
typing_events?: boolean;
uploads?: boolean;
url_enrichment?: boolean;
user_message_reminders?: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklist | string | No | Blocklist name |
| blocklist_behavior | 'flag' | 'block' | No |
| chat_preferences | ChatPreferences | No | |
| commands | string[] | No | List of available commands |
| count_messages | boolean | No | Enable/disable message counting |
| grants | Record<string, any> | No | Permission grants modifiers |
| max_message_length | number | No | Maximum message length |
| push_level | 'all' | 'all_mentions' | 'mentions' |
| quotes | boolean | No | Enable/disable quotes |
| reactions | boolean | No | Enable/disable reactions |
| replies | boolean | No | Enable/disable replies |
| shared_locations | boolean | No | Enable/disable shared locations |
| typing_events | boolean | No | Enable/disable typing events |
| uploads | boolean | No | Enable/disable uploads |
| url_enrichment | boolean | No | Enable/disable URL enrichment |
| user_message_reminders | boolean | No | Enable/disable user message reminders |
CreateChannelTypeResponse
interface CreateChannelTypeResponse {
allowed_flag_reasons?: string[];
automod: 'disabled' | 'simple' | 'AI';
automod_behavior: 'flag' | 'block' | 'shadow_block';
automod_thresholds?: Thresholds;
blocklist?: string;
blocklist_behavior?: 'flag' | 'block' | 'shadow_block';
blocklists?: BlockListOptions[];
chat_preferences?: ChatPreferences;
commands: string[];
connect_events: boolean;
count_messages: boolean;
created_at: number;
custom_events: boolean;
delivery_events: boolean;
duration: string;
grants: Record<string, any>;
mark_messages_pending: boolean;
max_message_length: number;
mutes: boolean;
name: string;
partition_size?: number;
partition_ttl?: string;
permissions: PolicyRequest[];
polls: boolean;
push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none';
push_notifications: boolean;
quotes: boolean;
reactions: boolean;
read_events: boolean;
reminders: boolean;
replies: boolean;
search: boolean;
shared_locations: boolean;
skip_last_msg_update_for_system_msgs: boolean;
typing_events: boolean;
updated_at: number;
uploads: boolean;
url_enrichment: boolean;
user_message_reminders: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | 'disabled' | 'simple' | 'AI' |
| automod_behavior | 'flag' | 'block' | 'shadow_block' |
| commands | string[] | Yes | |
| connect_events | boolean | Yes | |
| count_messages | boolean | Yes | |
| created_at | number | Yes | |
| custom_events | boolean | Yes | |
| delivery_events | boolean | Yes | |
| duration | string | Yes | |
| grants | Record<string, any> | Yes | |
| mark_messages_pending | boolean | Yes | |
| max_message_length | number | Yes | |
| mutes | boolean | Yes | |
| name | string | Yes | |
| permissions | PolicyRequest[] | Yes | |
| polls | boolean | Yes | |
| push_notifications | boolean | Yes | |
| quotes | boolean | Yes | |
| reactions | boolean | Yes | |
| read_events | boolean | Yes | |
| reminders | boolean | Yes | |
| replies | boolean | Yes | |
| search | boolean | Yes | |
| shared_locations | boolean | Yes | |
| skip_last_msg_update_for_system_msgs | boolean | Yes | |
| typing_events | boolean | Yes | |
| updated_at | number | Yes | |
| uploads | boolean | Yes | |
| url_enrichment | boolean | Yes | |
| user_message_reminders | boolean | Yes | |
| allowed_flag_reasons | string[] | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | 'flag' | 'block' | 'shadow_block' |
| blocklists | BlockListOptions[] | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | number | No | |
| partition_ttl | string | No | |
| push_level | 'all' | 'all_mentions' | 'mentions' |
CreateCommandResponse
interface CreateCommandResponse {
command?: Command;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| command | Command | No | Command object |
CustomEvent
interface CustomEvent {
created_at: number;
custom: Record<string, any>;
received_at?: number;
type: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| custom | Record<string, any> | Yes | |
| type | string | Yes | |
| received_at | number | No |
Data
interface Data {
id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes |
DeleteChannelResponse
Basic response information
interface DeleteChannelResponse {
channel?: ChannelResponse;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| channel | ChannelResponse | No |
DeleteChannelsResponse
interface DeleteChannelsResponse {
duration: string;
result?: Record<string, any>;
task_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| result | Record<string, any> | No | Map of channel IDs and their deletion results |
| task_id | string | No |
DeleteCommandResponse
interface DeleteCommandResponse {
duration: string;
name: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| name | string | Yes | Command name |
DeleteMessageResponse
Basic response information
interface DeleteMessageResponse {
duration: string;
message: MessageResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes |
DeleteReactionResponse
Basic response information
interface DeleteReactionResponse {
duration: string;
message: MessageResponse;
reaction: ReactionResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| reaction | ReactionResponse | Yes |
DeleteReminderResponse
Basic response information
interface DeleteReminderResponse {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
DeleteRetentionPolicyResponse
Basic response information
interface DeleteRetentionPolicyResponse {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
DeliveredMessagePayload
interface DeliveredMessagePayload {
cid?: string;
id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | No | |
| id | string | No |
DraftResponse
interface DraftResponse {
channel?: ChannelResponse;
channel_cid: string;
created_at: number;
message: DraftPayloadResponse;
parent_id?: string;
parent_message?: MessageResponse;
quoted_message?: MessageResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | number | Yes | |
| message | DraftPayloadResponse | Yes | |
| channel | ChannelResponse | No | |
| parent_id | string | No | |
| parent_message | MessageResponse | No | |
| quoted_message | MessageResponse | No |
EventRequest
interface EventRequest {
custom?: Record<string, any>;
parent_id?: string;
type: string;
user?: UserRequest;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | |
| custom | Record<string, any> | No | |
| parent_id | string | No | |
| user | UserRequest | No | |
| user_id | string | No |
EventResponse
Basic response information
interface EventResponse {
duration: string;
event: WSEvent;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| event | WSEvent | Yes |
ExportChannelsResponse
interface ExportChannelsResponse {
duration: string;
task_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| task_id | string | Yes | ID of the task to export channels |
FutureChannelBanResponse
interface FutureChannelBanResponse {
banned_by?: UserResponse;
created_at: number;
expires?: number;
reason?: string;
shadow?: boolean;
user?: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| banned_by | UserResponse | No | |
| expires | number | No | |
| reason | string | No | |
| shadow | boolean | No | |
| user | UserResponse | No |
GetCampaignResponse
Basic response information
interface GetCampaignResponse {
campaign?: CampaignResponse;
duration: string;
users?: PagerResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| campaign | CampaignResponse | No | |
| users | PagerResponse | No |
GetChannelTypeResponse
Basic response information
interface GetChannelTypeResponse {
allowed_flag_reasons?: string[];
automod: 'disabled' | 'simple' | 'AI';
automod_behavior: 'flag' | 'block' | 'shadow_block';
automod_thresholds?: Thresholds;
blocklist?: string;
blocklist_behavior?: 'flag' | 'block' | 'shadow_block';
blocklists?: BlockListOptions[];
chat_preferences?: ChatPreferences;
commands: Command[];
connect_events: boolean;
count_messages: boolean;
created_at: number;
custom_events: boolean;
delivery_events: boolean;
duration: string;
grants: Record<string, any>;
mark_messages_pending: boolean;
max_message_length: number;
mutes: boolean;
name: string;
partition_size?: number;
partition_ttl?: string;
permissions: PolicyRequest[];
polls: boolean;
push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none';
push_notifications: boolean;
quotes: boolean;
reactions: boolean;
read_events: boolean;
reminders: boolean;
replies: boolean;
search: boolean;
shared_locations: boolean;
skip_last_msg_update_for_system_msgs: boolean;
typing_events: boolean;
updated_at: number;
uploads: boolean;
url_enrichment: boolean;
user_message_reminders: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | 'disabled' | 'simple' | 'AI' |
| automod_behavior | 'flag' | 'block' | 'shadow_block' |
| commands | Command[] | Yes | |
| connect_events | boolean | Yes | |
| count_messages | boolean | Yes | |
| created_at | number | Yes | |
| custom_events | boolean | Yes | |
| delivery_events | boolean | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
| grants | Record<string, any> | Yes | |
| mark_messages_pending | boolean | Yes | |
| max_message_length | number | Yes | |
| mutes | boolean | Yes | |
| name | string | Yes | |
| permissions | PolicyRequest[] | Yes | |
| polls | boolean | Yes | |
| push_notifications | boolean | Yes | |
| quotes | boolean | Yes | |
| reactions | boolean | Yes | |
| read_events | boolean | Yes | |
| reminders | boolean | Yes | |
| replies | boolean | Yes | |
| search | boolean | Yes | |
| shared_locations | boolean | Yes | |
| skip_last_msg_update_for_system_msgs | boolean | Yes | |
| typing_events | boolean | Yes | |
| updated_at | number | Yes | |
| uploads | boolean | Yes | |
| url_enrichment | boolean | Yes | |
| user_message_reminders | boolean | Yes | |
| allowed_flag_reasons | string[] | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | 'flag' | 'block' | 'shadow_block' |
| blocklists | BlockListOptions[] | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | number | No | |
| partition_ttl | string | No | |
| push_level | 'all' | 'all_mentions' | 'mentions' |
GetCommandResponse
interface GetCommandResponse {
args: string;
created_at?: number;
description: string;
duration: string;
name: string;
set: string;
updated_at?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| args | string | Yes | |
| description | string | Yes | |
| duration | string | Yes | |
| name | string | Yes | |
| set | string | Yes | |
| created_at | number | No | |
| updated_at | number | No |
GetDraftResponse
Basic response information
interface GetDraftResponse {
draft: DraftResponse;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| draft | DraftResponse | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
GetManyMessagesResponse
interface GetManyMessagesResponse {
duration: string;
messages: MessageResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| messages | MessageResponse[] | Yes | List of messages |
GetMessageResponse
Basic response information
interface GetMessageResponse {
duration: string;
message: MessageWithChannelResponse;
pending_message_metadata?: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageWithChannelResponse | Yes | |
| pending_message_metadata | Record<string, any> | No |
GetReactionsResponse
interface GetReactionsResponse {
duration: string;
reactions: ReactionResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| reactions | ReactionResponse[] | Yes | List of reactions |
GetRepliesResponse
Basic response information
interface GetRepliesResponse {
duration: string;
messages: MessageResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| messages | MessageResponse[] | Yes |
GetRetentionPolicyResponse
Basic response information
interface GetRetentionPolicyResponse {
duration: string;
policies: RetentionPolicy[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| policies | RetentionPolicy[] | Yes |
GetRetentionPolicyRunsResponse
Basic response information
interface GetRetentionPolicyRunsResponse {
duration: string;
next?: string;
prev?: string;
runs: RetentionRunResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| runs | RetentionRunResponse[] | Yes | |
| next | string | No | |
| prev | string | No |
GetSegmentResponse
interface GetSegmentResponse {
duration: string;
segment?: SegmentResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| segment | SegmentResponse | No | Segment |
GetThreadResponse
interface GetThreadResponse {
duration: string;
thread: ThreadStateResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| thread | ThreadStateResponse | Yes | Enriched thread state |
HideChannelResponse
Basic response information
interface HideChannelResponse {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
ImageSize
interface ImageSize {
crop?: string;
height?: number;
resize?: string;
width?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| crop | string | No | Crop mode. One of: top, bottom, left, right, center |
| height | number | No | Target image height |
| resize | string | No | Resize method. One of: clip, crop, scale, fill |
| width | number | No | Target image width |
LabelThresholds
interface LabelThresholds {
block?: number;
flag?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| block | number | No | Threshold for automatic message block |
| flag | number | No | Threshold for automatic message flag |
ListChannelTypesResponse
interface ListChannelTypesResponse {
channel_types: Record<string, any>;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_types | Record<string, any> | Yes | Object with all channel types |
| duration | string | Yes |
ListCommandsResponse
interface ListCommandsResponse {
commands: Command[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| commands | Command[] | Yes | List of commands |
| duration | string | Yes |
MarkDeliveredResponse
Basic response information
interface MarkDeliveredResponse {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
MarkReadResponse
interface MarkReadResponse {
duration: string;
event?: MarkReadResponseEvent;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| event | MarkReadResponseEvent | No | Mark read event |
MarkReadResponseEvent
interface MarkReadResponseEvent {
channel?: ChannelResponse;
channel_id: string;
channel_last_message_at?: number;
channel_type: string;
cid: string;
created_at: number;
last_read_message_id?: string;
team?: string;
thread?: ThreadResponse;
type: string;
user?: UserResponseCommonFields;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_id | string | Yes | |
| channel_type | string | Yes | |
| cid | string | Yes | |
| created_at | number | Yes | |
| type | string | Yes | |
| channel | ChannelResponse | No | |
| channel_last_message_at | number | No | |
| last_read_message_id | string | No | |
| team | string | No | |
| thread | ThreadResponse | No | |
| user | UserResponseCommonFields | No |
MembersResponse
interface MembersResponse {
duration: string;
members: ChannelMemberResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| members | ChannelMemberResponse[] | Yes | List of found members |
MessageActionResponse
Basic response information
interface MessageActionResponse {
duration: string;
message?: MessageResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | No |
MessageFlagResponse
interface MessageFlagResponse {
approved_at?: number;
created_at: number;
created_by_automod: boolean;
custom?: Record<string, any>;
details?: FlagDetailsResponse;
message?: MessageResponse;
moderation_feedback?: FlagFeedbackResponse;
moderation_result?: MessageModerationResult;
reason?: string;
rejected_at?: number;
reviewed_at?: number;
reviewed_by?: UserResponse;
updated_at: number;
user?: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| created_by_automod | boolean | Yes | |
| updated_at | number | Yes | |
| approved_at | number | No | |
| custom | Record<string, any> | No | |
| details | FlagDetailsResponse | No | |
| message | MessageResponse | No | |
| moderation_feedback | FlagFeedbackResponse | No | |
| moderation_result | MessageModerationResult | No | |
| reason | string | No | |
| rejected_at | number | No | |
| reviewed_at | number | No | |
| reviewed_by | UserResponse | No | |
| user | UserResponse | No |
MessageHistoryEntryResponse
interface MessageHistoryEntryResponse {
Custom: Record<string, any>;
attachments: Attachment[];
is_deleted: boolean;
message_id: string;
message_updated_at: number;
message_updated_by_id: string;
text: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| Custom | Record<string, any> | Yes | |
| attachments | Attachment[] | Yes | |
| is_deleted | boolean | Yes | |
| message_id | string | Yes | |
| message_updated_at | number | Yes | |
| message_updated_by_id | string | Yes | |
| text | string | Yes |
MessagePaginationParams
interface MessagePaginationParams {
created_at_after?: number;
created_at_after_or_equal?: number;
created_at_around?: number;
created_at_before?: number;
created_at_before_or_equal?: number;
id_around?: string;
id_gt?: string;
id_gte?: string;
id_lt?: string;
id_lte?: string;
limit?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at_after | number | No | The timestamp to get messages with a created_at timestamp greater than |
| created_at_after_or_equal | number | No | The timestamp to get messages with a created_at timestamp greater than or equ... |
| created_at_around | number | No | The result will be a set of messages, that are both older and newer than the ... |
| created_at_before | number | No | The timestamp to get messages with a created_at timestamp smaller than |
| created_at_before_or_equal | number | No | The timestamp to get messages with a created_at timestamp smaller than or equ... |
| id_around | string | No | The result will be a set of messages, that are both older and newer than the ... |
| id_gt | string | No | The ID of the message to get messages with a timestamp greater than |
| id_gte | string | No | The ID of the message to get messages with a timestamp greater than or equal to |
| id_lt | string | No | The ID of the message to get messages with a timestamp smaller than |
| id_lte | string | No | The ID of the message to get messages with a timestamp smaller than or equal to |
| limit | number | No | The maximum number of messages to return (max limit |
MessageRequest
Message data for creating or updating a message
interface MessageRequest {
attachments?: Attachment[];
custom?: Record<string, any>;
html?: string;
id?: string;
mentioned_channel?: boolean;
mentioned_group_ids?: string[];
mentioned_here?: boolean;
mentioned_roles?: string[];
mentioned_users?: string[];
mml?: string;
parent_id?: string;
pin_expires?: number;
pinned?: boolean;
pinned_at?: string;
poll_id?: string;
quoted_message_id?: string;
restricted_visibility?: string[];
shared_location?: SharedLocation;
show_in_channel?: boolean;
silent?: boolean;
text?: string;
type?: '''' | 'regular' | 'system';
user?: UserRequest;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | Attachment[] | No | Array of message attachments |
| custom | Record<string, any> | No | |
| html | string | No | Contains HTML markup of the message. Can only be set when using server-side API |
| id | string | No | Message ID is unique string identifier of the message |
| mentioned_channel | boolean | No | |
| mentioned_group_ids | string[] | No | List of user group IDs to mention. Group members who are also channel members... |
| mentioned_here | boolean | No | |
| mentioned_roles | string[] | No | |
| mentioned_users | string[] | No | Array of user IDs to mention |
| mml | string | No | Should be empty if text is provided. Can only be set when using server-side... |
| parent_id | string | No | ID of parent message (thread) |
| pin_expires | number | No | Date when pinned message expires |
| pinned | boolean | No | Whether message is pinned or not |
| pinned_at | string | No | Date when message got pinned |
| poll_id | string | No | Identifier of the poll to include in the message |
| quoted_message_id | string | No | |
| restricted_visibility | string[] | No | A list of user ids that have restricted visibility to the message |
| shared_location | SharedLocation | No | Contains shared location data |
| show_in_channel | boolean | No | Whether thread reply should be shown in the channel as well |
| silent | boolean | No | Whether message is silent or not |
| text | string | No | Text of the message. Should be empty if mml is provided |
| type | '''' | 'regular' | 'system' |
| user | UserRequest | No | |
| user_id | string | No |
MessageResponse
Represents any chat message
interface MessageResponse {
attachments: Attachment[];
cid: string;
command?: string;
created_at: number;
custom: Record<string, any>;
deleted_at?: number;
deleted_for_me?: boolean;
deleted_reply_count: number;
draft?: DraftResponse;
html: string;
i18n?: Record<string, any>;
id: string;
image_labels?: Record<string, any>;
latest_reactions: ReactionResponse[];
member?: ChannelMemberResponse;
mentioned_channel: boolean;
mentioned_group_ids?: string[];
mentioned_here: boolean;
mentioned_roles?: string[];
mentioned_users: UserResponse[];
message_text_updated_at?: number;
mml?: string;
moderation?: ModerationV2Response;
own_reactions: ReactionResponse[];
parent_id?: string;
pin_expires?: number;
pinned: boolean;
pinned_at?: number;
pinned_by?: UserResponse;
poll?: PollResponseData;
poll_id?: string;
quoted_message?: MessageResponse;
quoted_message_id?: string;
reaction_counts: Record<string, any>;
reaction_groups?: Record<string, any>;
reaction_scores: Record<string, any>;
reminder?: ReminderResponseData;
reply_count: number;
restricted_visibility: string[];
shadowed: boolean;
shared_location?: SharedLocationResponseData;
show_in_channel?: boolean;
silent: boolean;
text: string;
thread_participants?: UserResponse[];
type: string;
updated_at: number;
user: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | Attachment[] | Yes | Array of message attachments |
| cid | string | Yes | Channel unique identifier in <type>:<id> format |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | |
| deleted_reply_count | number | Yes | |
| html | string | Yes | Contains HTML markup of the message. Can only be set when using server-side API |
| id | string | Yes | Message ID is unique string identifier of the message |
| latest_reactions | ReactionResponse[] | Yes | List of 10 latest reactions to this message |
| mentioned_channel | boolean | Yes | Whether the message mentioned the channel tag |
| mentioned_here | boolean | Yes | Whether the message mentioned online users with @here tag |
| mentioned_users | UserResponse[] | Yes | List of mentioned users |
| own_reactions | ReactionResponse[] | Yes | List of 10 latest reactions of authenticated user to this message |
| pinned | boolean | Yes | Whether message is pinned or not |
| reaction_counts | Record<string, any> | Yes | An object containing number of reactions of each type. Key: reaction type (st... |
| reaction_scores | Record<string, any> | Yes | An object containing scores of reactions of each type. Key: reaction type (st... |
| reply_count | number | Yes | Number of replies to this message |
| restricted_visibility | string[] | Yes | A list of user ids that have restricted visibility to the message, if the lis... |
| shadowed | boolean | Yes | Whether the message was shadowed or not |
| silent | boolean | Yes | Whether message is silent or not |
| text | string | Yes | Text of the message. Should be empty if mml is provided |
| type | string | Yes | Contains type of the message. One of: regular, ephemeral, error, reply, syste... |
| updated_at | number | Yes | Date/time of the last update |
| user | UserResponse | Yes | Sender of the message. Required when using server-side API |
| command | string | No | Contains provided slash command |
| deleted_at | number | No | Date/time of deletion |
| deleted_for_me | boolean | No | |
| draft | DraftResponse | No | |
| i18n | Record<string, any> | No | Object with translations. Key language contains the original language key. ... |
| image_labels | Record<string, any> | No | Contains image moderation information |
| member | ChannelMemberResponse | No | Channel member data for the message sender including only the channel_role |
| mentioned_group_ids | string[] | No | List of user group IDs mentioned in the message. Group members who are also c... |
| mentioned_roles | string[] | No | List of roles mentioned in the message (e.g. admin, channel_moderator, custom... |
| message_text_updated_at | number | No | |
| mml | string | No | Should be empty if text is provided. Can only be set when using server-side... |
| moderation | ModerationV2Response | No | |
| parent_id | string | No | ID of parent message (thread) |
| pin_expires | number | No | Date when pinned message expires |
| pinned_at | number | No | Date when message got pinned |
| pinned_by | UserResponse | No | Contains user who pinned the message |
| poll | PollResponseData | No | |
| poll_id | string | No | Identifier of the poll to include in the message |
| quoted_message | MessageResponse | No | Contains quoted message |
| quoted_message_id | string | No | |
| reaction_groups | Record<string, any> | No | |
| reminder | ReminderResponseData | No | |
| shared_location | SharedLocationResponseData | No | Contains shared location data |
| show_in_channel | boolean | No | Whether thread reply should be shown in the channel as well |
| thread_participants | UserResponse[] | No | List of users who participate in thread |
MessageWithChannelResponse
Represents any chat message
interface MessageWithChannelResponse {
attachments: Attachment[];
channel: ChannelResponse;
cid: string;
command?: string;
created_at: number;
custom: Record<string, any>;
deleted_at?: number;
deleted_for_me?: boolean;
deleted_reply_count: number;
draft?: DraftResponse;
html: string;
i18n?: Record<string, any>;
id: string;
image_labels?: Record<string, any>;
latest_reactions: ReactionResponse[];
member?: ChannelMemberResponse;
mentioned_channel: boolean;
mentioned_group_ids?: string[];
mentioned_here: boolean;
mentioned_roles?: string[];
mentioned_users: UserResponse[];
message_text_updated_at?: number;
mml?: string;
moderation?: ModerationV2Response;
own_reactions: ReactionResponse[];
parent_id?: string;
pin_expires?: number;
pinned: boolean;
pinned_at?: number;
pinned_by?: UserResponse;
poll?: PollResponseData;
poll_id?: string;
quoted_message?: MessageResponse;
quoted_message_id?: string;
reaction_counts: Record<string, any>;
reaction_groups?: Record<string, any>;
reaction_scores: Record<string, any>;
reminder?: ReminderResponseData;
reply_count: number;
restricted_visibility: string[];
shadowed: boolean;
shared_location?: SharedLocationResponseData;
show_in_channel?: boolean;
silent: boolean;
text: string;
thread_participants?: UserResponse[];
type: string;
updated_at: number;
user: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | Attachment[] | Yes | Array of message attachments |
| channel | ChannelResponse | Yes | Channel object |
| cid | string | Yes | Channel unique identifier in <type>:<id> format |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | |
| deleted_reply_count | number | Yes | |
| html | string | Yes | Contains HTML markup of the message. Can only be set when using server-side API |
| id | string | Yes | Message ID is unique string identifier of the message |
| latest_reactions | ReactionResponse[] | Yes | List of 10 latest reactions to this message |
| mentioned_channel | boolean | Yes | Whether the message mentioned the channel tag |
| mentioned_here | boolean | Yes | Whether the message mentioned online users with @here tag |
| mentioned_users | UserResponse[] | Yes | List of mentioned users |
| own_reactions | ReactionResponse[] | Yes | List of 10 latest reactions of authenticated user to this message |
| pinned | boolean | Yes | Whether message is pinned or not |
| reaction_counts | Record<string, any> | Yes | An object containing number of reactions of each type. Key: reaction type (st... |
| reaction_scores | Record<string, any> | Yes | An object containing scores of reactions of each type. Key: reaction type (st... |
| reply_count | number | Yes | Number of replies to this message |
| restricted_visibility | string[] | Yes | A list of user ids that have restricted visibility to the message, if the lis... |
| shadowed | boolean | Yes | Whether the message was shadowed or not |
| silent | boolean | Yes | Whether message is silent or not |
| text | string | Yes | Text of the message. Should be empty if mml is provided |
| type | string | Yes | Contains type of the message. One of: regular, ephemeral, error, reply, syste... |
| updated_at | number | Yes | Date/time of the last update |
| user | UserResponse | Yes | Sender of the message. Required when using server-side API |
| command | string | No | Contains provided slash command |
| deleted_at | number | No | Date/time of deletion |
| deleted_for_me | boolean | No | |
| draft | DraftResponse | No | |
| i18n | Record<string, any> | No | Object with translations. Key language contains the original language key. ... |
| image_labels | Record<string, any> | No | Contains image moderation information |
| member | ChannelMemberResponse | No | Channel member data for the message sender including only the channel_role |
| mentioned_group_ids | string[] | No | List of user group IDs mentioned in the message. Group members who are also c... |
| mentioned_roles | string[] | No | List of roles mentioned in the message (e.g. admin, channel_moderator, custom... |
| message_text_updated_at | number | No | |
| mml | string | No | Should be empty if text is provided. Can only be set when using server-side... |
| moderation | ModerationV2Response | No | |
| parent_id | string | No | ID of parent message (thread) |
| pin_expires | number | No | Date when pinned message expires |
| pinned_at | number | No | Date when message got pinned |
| pinned_by | UserResponse | No | Contains user who pinned the message |
| poll | PollResponseData | No | |
| poll_id | string | No | Identifier of the poll to include in the message |
| quoted_message | MessageResponse | No | Contains quoted message |
| quoted_message_id | string | No | |
| reaction_groups | Record<string, any> | No | |
| reminder | ReminderResponseData | No | |
| shared_location | SharedLocationResponseData | No | Contains shared location data |
| show_in_channel | boolean | No | Whether thread reply should be shown in the channel as well |
| thread_participants | UserResponse[] | No | List of users who participate in thread |
MuteChannelResponse
interface MuteChannelResponse {
channel_mute?: ChannelMute;
channel_mutes?: ChannelMute[];
duration: string;
own_user?: OwnUserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| channel_mute | ChannelMute | No | Object with channel mute (if one channel was muted) |
| channel_mutes | ChannelMute[] | No | Object with mutes (if multiple channels were muted) |
| own_user | OwnUserResponse | No | Authorized user object with fresh mutes information |
OnlyUserID
interface OnlyUserID {
id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes |
OwnUserResponse
interface OwnUserResponse {
avg_response_time?: number;
banned: boolean;
blocked_user_ids?: string[];
channel_mutes: ChannelMute[];
created_at: number;
custom: Record<string, any>;
deactivated_at?: number;
deleted_at?: number;
devices: DeviceResponse[];
id: string;
image?: string;
invisible: boolean;
language: string;
last_active?: number;
latest_hidden_channels?: string[];
mutes: UserMuteResponse[];
name?: string;
online: boolean;
privacy_settings?: PrivacySettingsResponse;
push_preferences?: PushPreferencesResponse;
revoke_tokens_issued_before?: number;
role: string;
teams: string[];
teams_role?: Record<string, any>;
total_unread_count: number;
total_unread_count_by_team?: Record<string, any>;
unread_channels: number;
unread_count: number;
unread_threads: number;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | boolean | Yes | |
| channel_mutes | ChannelMute[] | Yes | |
| created_at | number | Yes | |
| custom | Record<string, any> | Yes | |
| devices | DeviceResponse[] | Yes | |
| id | string | Yes | |
| invisible | boolean | Yes | |
| language | string | Yes | |
| mutes | UserMuteResponse[] | Yes | |
| online | boolean | Yes | |
| role | string | Yes | |
| teams | string[] | Yes | |
| total_unread_count | number | Yes | |
| unread_channels | number | Yes | |
| unread_count | number | Yes | |
| unread_threads | number | Yes | |
| updated_at | number | Yes | |
| avg_response_time | number | No | |
| blocked_user_ids | string[] | No | |
| deactivated_at | number | No | |
| deleted_at | number | No | |
| image | string | No | |
| last_active | number | No | |
| latest_hidden_channels | string[] | No | |
| name | string | No | |
| privacy_settings | PrivacySettingsResponse | No | |
| push_preferences | PushPreferencesResponse | No | |
| revoke_tokens_issued_before | number | No | |
| teams_role | Record<string, any> | No | |
| total_unread_count_by_team | Record<string, any> | No |
PagerResponse
interface PagerResponse {
next?: string;
prev?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| next | string | No | |
| prev | string | No |
PaginationParams
interface PaginationParams {
limit?: number;
offset?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| limit | number | No | |
| offset | number | No |
ParsedPredefinedFilterResponse
interface ParsedPredefinedFilterResponse {
filter: Record<string, any>;
name: string;
sort?: SortParamRequest[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| filter | Record<string, any> | Yes | |
| name | string | Yes | |
| sort | SortParamRequest[] | No |
PendingMessageResponse
interface PendingMessageResponse {
channel?: ChannelResponse;
message?: MessageResponse;
metadata?: Record<string, any>;
user?: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel | ChannelResponse | No | |
| message | MessageResponse | No | |
| metadata | Record<string, any> | No | |
| user | UserResponse | No |
Policy
interface Policy {
action: number;
created_at: number;
name: string;
owner: boolean;
priority: number;
resources: string[];
roles: string[];
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | number | Yes | |
| created_at | number | Yes | |
| name | string | Yes | |
| owner | boolean | Yes | |
| priority | number | Yes | |
| resources | string[] | Yes | |
| roles | string[] | Yes | |
| updated_at | number | Yes |
PolicyRequest
Policy request
interface PolicyRequest {
action: 'Deny' | 'Allow';
name: string;
owner: boolean;
priority: number;
resources: string[];
roles: string[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | 'Deny' | 'Allow' | Yes |
| name | string | Yes | User-friendly policy name |
| owner | boolean | Yes | Whether policy applies to resource owner or not |
| priority | number | Yes | Policy priority |
| resources | string[] | Yes | List of resources to apply policy to |
| roles | string[] | Yes | List of roles to apply policy to |
PollResponseData
interface PollResponseData {
allow_answers: boolean;
allow_user_suggested_options: boolean;
answers_count: number;
created_at: number;
created_by?: UserResponse;
created_by_id: string;
custom: Record<string, any>;
description: string;
enforce_unique_vote: boolean;
id: string;
is_closed?: boolean;
latest_answers: PollVoteResponseData[];
latest_votes_by_option: Record<string, any>;
max_votes_allowed?: number;
name: string;
options: PollOptionResponseData[];
own_votes: PollVoteResponseData[];
updated_at: number;
vote_count: number;
vote_counts_by_option: Record<string, any>;
voting_visibility: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| allow_answers | boolean | Yes | |
| allow_user_suggested_options | boolean | Yes | |
| answers_count | number | Yes | |
| created_at | number | Yes | |
| created_by_id | string | Yes | |
| custom | Record<string, any> | Yes | |
| description | string | Yes | |
| enforce_unique_vote | boolean | Yes | |
| id | string | Yes | |
| latest_answers | PollVoteResponseData[] | Yes | |
| latest_votes_by_option | Record<string, any> | Yes | |
| name | string | Yes | |
| options | PollOptionResponseData[] | Yes | |
| own_votes | PollVoteResponseData[] | Yes | |
| updated_at | number | Yes | |
| vote_count | number | Yes | |
| vote_counts_by_option | Record<string, any> | Yes | |
| voting_visibility | string | Yes | |
| created_by | UserResponse | No | |
| is_closed | boolean | No | |
| max_votes_allowed | number | No |
PollVoteResponse
interface PollVoteResponse {
duration: string;
poll?: PollResponseData;
vote?: PollVoteResponseData;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| poll | PollResponseData | No | Poll |
| vote | PollVoteResponseData | No | Poll vote |
PollVoteResponseData
interface PollVoteResponseData {
answer_text?: string;
created_at: number;
id: string;
is_answer?: boolean;
option_id: string;
poll_id: string;
updated_at: number;
user?: UserResponse;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| id | string | Yes | |
| option_id | string | Yes | |
| poll_id | string | Yes | |
| updated_at | number | Yes | |
| answer_text | string | No | |
| is_answer | boolean | No | |
| user | UserResponse | No | |
| user_id | string | No |
PrivacySettingsResponse
interface PrivacySettingsResponse {
delivery_receipts?: DeliveryReceiptsResponse;
read_receipts?: ReadReceiptsResponse;
typing_indicators?: TypingIndicatorsResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| delivery_receipts | DeliveryReceiptsResponse | No | |
| read_receipts | ReadReceiptsResponse | No | |
| typing_indicators | TypingIndicatorsResponse | No |
QueryBannedUsersResponse
interface QueryBannedUsersResponse {
bans: BanResponse[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| bans | BanResponse[] | Yes | List of found bans |
| duration | string | Yes | Duration of the request in milliseconds |
QueryCampaignsResponse
Basic response information
interface QueryCampaignsResponse {
campaigns: CampaignResponse[];
duration: string;
next?: string;
prev?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| campaigns | CampaignResponse[] | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
| next | string | No | |
| prev | string | No |
QueryChannelsResponse
interface QueryChannelsResponse {
channels: ChannelStateResponseFields[];
duration: string;
predefined_filter?: ParsedPredefinedFilterResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channels | ChannelStateResponseFields[] | Yes | List of channels |
| duration | string | Yes | Duration of the request in milliseconds |
| predefined_filter | ParsedPredefinedFilterResponse | No | The parsed predefined filter with interpolated values, only present when usin... |
QueryDraftsResponse
interface QueryDraftsResponse {
drafts: DraftResponse[];
duration: string;
next?: string;
prev?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| drafts | DraftResponse[] | Yes | Drafts |
| duration | string | Yes | Duration of the request in milliseconds |
| next | string | No | |
| prev | string | No |
QueryFutureChannelBansResponse
interface QueryFutureChannelBansResponse {
bans: FutureChannelBanResponse[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| bans | FutureChannelBanResponse[] | Yes | List of found future channel bans |
| duration | string | Yes | Duration of the request in milliseconds |
QueryMessageFlagsResponse
Query message flags response
interface QueryMessageFlagsResponse {
duration: string;
flags: MessageFlagResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| flags | MessageFlagResponse[] | Yes | The flags that match the query |
QueryMessageHistoryResponse
interface QueryMessageHistoryResponse {
duration: string;
message_history: MessageHistoryEntryResponse[];
next?: string;
prev?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message_history | MessageHistoryEntryResponse[] | Yes | Message history entries |
| next | string | No | |
| prev | string | No |
QueryReactionsResponse
Basic response information
interface QueryReactionsResponse {
duration: string;
next?: string;
prev?: string;
reactions: ReactionResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| reactions | ReactionResponse[] | Yes | |
| next | string | No | |
| prev | string | No |
QueryRemindersResponse
interface QueryRemindersResponse {
duration: string;
next?: string;
prev?: string;
reminders: ReminderResponseData[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| reminders | ReminderResponseData[] | Yes | MessageReminders data returned by the query |
| next | string | No | |
| prev | string | No |
QuerySegmentTargetsResponse
interface QuerySegmentTargetsResponse {
duration: string;
next?: string;
prev?: string;
targets: SegmentTargetResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| targets | SegmentTargetResponse[] | Yes | Targets |
| next | string | No | |
| prev | string | No |
QuerySegmentsResponse
interface QuerySegmentsResponse {
duration: string;
next?: string;
prev?: string;
segments: SegmentResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| segments | SegmentResponse[] | Yes | Segments |
| next | string | No | |
| prev | string | No |
QueryTeamUsageStatsResponse
Response containing team-level usage statistics
interface QueryTeamUsageStatsResponse {
duration: string;
next?: string;
teams: TeamUsageStats[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| teams | TeamUsageStats[] | Yes | Array of team usage statistics |
| next | string | No | Cursor for pagination to fetch next page |
QueryThreadsResponse
interface QueryThreadsResponse {
duration: string;
next?: string;
prev?: string;
threads: ThreadStateResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| threads | ThreadStateResponse[] | Yes | List of enriched thread states |
| next | string | No | |
| prev | string | No |
Reaction
interface Reaction {
activity_id: string;
children_counts?: Record<string, any>;
created_at: number;
data?: Record<string, any>;
deleted_at?: number;
id?: string;
kind: string;
latest_children?: Record<string, any>;
moderation?: Record<string, any>;
own_children?: Record<string, any>;
parent?: string;
score?: number;
target_feeds?: string[];
target_feeds_extra_data?: Record<string, any>;
updated_at: number;
user?: User;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| activity_id | string | Yes | |
| created_at | number | Yes | |
| kind | string | Yes | |
| updated_at | number | Yes | |
| user_id | string | Yes | |
| children_counts | Record<string, any> | No | |
| data | Record<string, any> | No | |
| deleted_at | number | No | |
| id | string | No | |
| latest_children | Record<string, any> | No | |
| moderation | Record<string, any> | No | |
| own_children | Record<string, any> | No | |
| parent | string | No | |
| score | number | No | |
| target_feeds | string[] | No | |
| target_feeds_extra_data | Record<string, any> | No | |
| user | User | No |
ReactionRequest
Represents user reaction to a message
interface ReactionRequest {
created_at?: number;
custom?: Record<string, any>;
score?: number;
type: string;
updated_at?: number;
user?: UserRequest;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | The type of reaction (e.g. 'like', 'laugh', 'wow') |
| created_at | number | No | Date/time of creation |
| custom | Record<string, any> | No | |
| score | number | No | Reaction score. If not specified reaction has score of 1 |
| updated_at | number | No | Date/time of the last update |
| user | UserRequest | No | |
| user_id | string | No |
ReactionResponse
interface ReactionResponse {
created_at: number;
custom: Record<string, any>;
message_id: string;
score: number;
type: string;
updated_at: number;
user: UserResponse;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | Custom data for this object |
| message_id | string | Yes | Message ID |
| score | number | Yes | Score of the reaction |
| type | string | Yes | Type of reaction |
| updated_at | number | Yes | Date/time of the last update |
| user | UserResponse | Yes | User |
| user_id | string | Yes | User ID |
ReadStateResponse
interface ReadStateResponse {
last_delivered_at?: number;
last_delivered_message_id?: string;
last_read: number;
last_read_message_id?: string;
unread_messages: number;
user: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| last_read | number | Yes | |
| unread_messages | number | Yes | |
| user | UserResponse | Yes | |
| last_delivered_at | number | No | |
| last_delivered_message_id | string | No | |
| last_read_message_id | string | No |
ReminderResponseData
interface ReminderResponseData {
channel?: ChannelResponse;
channel_cid: string;
created_at: number;
message?: MessageResponse;
message_id: string;
remind_at?: number;
updated_at: number;
user?: UserResponse;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | number | Yes | |
| message_id | string | Yes | |
| updated_at | number | Yes | |
| user_id | string | Yes | |
| channel | ChannelResponse | No | |
| message | MessageResponse | No | |
| remind_at | number | No | |
| user | UserResponse | No |
Response
Basic response information
interface Response {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
RetentionPolicy
interface RetentionPolicy {
app_pk: number;
config: PolicyConfig;
enabled_at: number;
policy: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app_pk | number | Yes | |
| config | PolicyConfig | Yes | |
| enabled_at | number | Yes | |
| policy | string | Yes |
RetentionRunResponse
interface RetentionRunResponse {
app_pk: number;
date: string;
policy: string;
stats: RunStats;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app_pk | number | Yes | |
| date | string | Yes | |
| policy | string | Yes | |
| stats | RunStats | Yes |
SearchResponse
interface SearchResponse {
duration: string;
next?: string;
previous?: string;
results: SearchResult[];
results_warning?: SearchWarning;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| results | SearchResult[] | Yes | Search results |
| next | string | No | Value to pass to the next search query in order to paginate |
| previous | string | No | Value that points to the previous page. Pass as the next value in a search qu... |
| results_warning | SearchWarning | No | Warning about the search results |
SearchResult
interface SearchResult {
message?: SearchResultMessage;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| message | SearchResultMessage | No | Found message |
SearchWarning
interface SearchWarning {
channel_search_cids?: string[];
channel_search_count?: number;
warning_code: number;
warning_description: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| warning_code | number | Yes | Code corresponding to the warning |
| warning_description | string | Yes | Description of the warning |
| channel_search_cids | string[] | No | Channel CIDs for the searched channels |
| channel_search_count | number | No | Number of channels searched |
Segment
interface Segment {
all_sender_channels: boolean;
all_users: boolean;
created_at: number;
deleted_at?: number;
description?: string;
filter?: Record<string, any>;
id: string;
name: string;
size: number;
task_id?: string;
type: string;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| all_sender_channels | boolean | Yes | |
| all_users | boolean | Yes | |
| created_at | number | Yes | |
| id | string | Yes | |
| name | string | Yes | |
| size | number | Yes | |
| type | string | Yes | |
| updated_at | number | Yes | |
| deleted_at | number | No | |
| description | string | No | |
| filter | Record<string, any> | No | |
| task_id | string | No |
SegmentResponse
interface SegmentResponse {
all_sender_channels: boolean;
all_users: boolean;
created_at: number;
deleted_at: number;
description: string;
filter: Record<string, any>;
id: string;
name: string;
size: number;
type: string;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| all_sender_channels | boolean | Yes | |
| all_users | boolean | Yes | |
| created_at | number | Yes | |
| deleted_at | number | Yes | |
| description | string | Yes | |
| filter | Record<string, any> | Yes | |
| id | string | Yes | |
| name | string | Yes | |
| size | number | Yes | |
| type | string | Yes | |
| updated_at | number | Yes |
SegmentTargetResponse
interface SegmentTargetResponse {
app_pk: number;
created_at: number;
segment_id: string;
target_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app_pk | number | Yes | |
| created_at | number | Yes | |
| segment_id | string | Yes | |
| target_id | string | Yes |
SendMessageResponse
interface SendMessageResponse {
duration: string;
message: MessageResponse;
pending_message_metadata?: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | Message response |
| pending_message_metadata | Record<string, any> | No | Pending message metadata |
SendReactionResponse
Basic response information
interface SendReactionResponse {
duration: string;
message: MessageResponse;
reaction: ReactionResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| reaction | ReactionResponse | Yes |
SetRetentionPolicyResponse
Basic response information
interface SetRetentionPolicyResponse {
duration: string;
policy: RetentionPolicy;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| policy | RetentionPolicy | Yes |
SharedLocation
interface SharedLocation {
created_by_device_id?: string;
end_at?: number;
latitude: number;
longitude: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| latitude | number | Yes | |
| longitude | number | Yes | |
| created_by_device_id | string | No | |
| end_at | number | No |
SharedLocationResponseData
interface SharedLocationResponseData {
channel?: ChannelResponse;
channel_cid: string;
created_at: number;
created_by_device_id: string;
end_at?: number;
latitude: number;
longitude: number;
message?: MessageResponse;
message_id: string;
updated_at: number;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | number | Yes | |
| created_by_device_id | string | Yes | |
| latitude | number | Yes | |
| longitude | number | Yes | |
| message_id | string | Yes | |
| updated_at | number | Yes | |
| user_id | string | Yes | |
| channel | ChannelResponse | No | |
| end_at | number | No | |
| message | MessageResponse | No |
ShowChannelResponse
Basic response information
interface ShowChannelResponse {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
SortParamRequest
interface SortParamRequest {
direction?: number;
field?: string;
type?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| direction | number | No | Direction of sorting, 1 for Ascending, -1 for Descending, default is 1. One o... |
| field | string | No | Name of field to sort by |
| type | string | No | Type of field to sort by. Empty string or omitted means string type (default)... |
StartCampaignResponse
Basic response information
interface StartCampaignResponse {
campaign?: CampaignResponse;
duration: string;
users?: PagerResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| campaign | CampaignResponse | No | |
| users | PagerResponse | No |
TeamUsageStats
Usage statistics for a single team containing all 16 metrics
interface TeamUsageStats {
concurrent_connections: MetricStats;
concurrent_users: MetricStats;
image_moderations_daily: MetricStats;
messages_daily: MetricStats;
messages_last_24_hours: MetricStats;
messages_last_30_days: MetricStats;
messages_month_to_date: MetricStats;
messages_total: MetricStats;
team: string;
translations_daily: MetricStats;
users_daily: MetricStats;
users_engaged_last_30_days: MetricStats;
users_engaged_month_to_date: MetricStats;
users_last_24_hours: MetricStats;
users_last_30_days: MetricStats;
users_month_to_date: MetricStats;
users_total: MetricStats;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| concurrent_connections | MetricStats | Yes | Peak concurrent connections (total = MAX) |
| concurrent_users | MetricStats | Yes | Peak concurrent users (total = MAX) |
| image_moderations_daily | MetricStats | Yes | Daily image moderations (total = SUM) |
| messages_daily | MetricStats | Yes | Daily messages sent (total = SUM) |
| messages_last_24_hours | MetricStats | Yes | Messages in last 24 hours (total = LATEST) |
| messages_last_30_days | MetricStats | Yes | Messages in last 30 days (total = LATEST) |
| messages_month_to_date | MetricStats | Yes | Messages this month (total = LATEST) |
| messages_total | MetricStats | Yes | Total messages (total = LATEST) |
| team | string | Yes | Team identifier (empty string for users not assigned to any team) |
| translations_daily | MetricStats | Yes | Daily translations (total = SUM) |
| users_daily | MetricStats | Yes | Daily active users (total = SUM) |
| users_engaged_last_30_days | MetricStats | Yes | Engaged MAU (total = LATEST) |
| users_engaged_month_to_date | MetricStats | Yes | Engaged users this month (total = LATEST) |
| users_last_24_hours | MetricStats | Yes | Users active in last 24 hours (total = LATEST) |
| users_last_30_days | MetricStats | Yes | MAU - users active in last 30 days (total = LATEST) |
| users_month_to_date | MetricStats | Yes | Users active this month (total = LATEST) |
| users_total | MetricStats | Yes | Total users (total = LATEST) |
ThreadResponse
interface ThreadResponse {
active_participant_count: number;
channel?: ChannelResponse;
channel_cid: string;
created_at: number;
created_by?: UserResponse;
created_by_user_id: string;
custom: Record<string, any>;
deleted_at?: number;
last_message_at?: number;
parent_message?: MessageResponse;
parent_message_id: string;
participant_count: number;
reply_count?: number;
thread_participants?: ThreadParticipant[];
title: string;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_participant_count | number | Yes | Active Participant Count |
| channel_cid | string | Yes | Channel CID |
| created_at | number | Yes | Date/time of creation |
| created_by_user_id | string | Yes | Created By User ID |
| custom | Record<string, any> | Yes | Custom data for this object |
| parent_message_id | string | Yes | Parent Message ID |
| participant_count | number | Yes | Participant Count |
| title | string | Yes | Title |
| updated_at | number | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel |
| created_by | UserResponse | No | Created By User |
| deleted_at | number | No | Deleted At |
| last_message_at | number | No | Last Message At |
| parent_message | MessageResponse | No | Parent Message |
| reply_count | number | No | Reply Count |
| thread_participants | ThreadParticipant[] | No | Thread Participants |
ThreadStateResponse
interface ThreadStateResponse {
active_participant_count: number;
channel?: ChannelResponse;
channel_cid: string;
created_at: number;
created_by?: UserResponse;
created_by_user_id: string;
custom: Record<string, any>;
deleted_at?: number;
draft?: DraftResponse;
last_message_at?: number;
latest_replies: MessageResponse[];
parent_message?: MessageResponse;
parent_message_id: string;
participant_count: number;
read?: ReadStateResponse[];
reply_count?: number;
thread_participants?: ThreadParticipant[];
title: string;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_participant_count | number | Yes | Active Participant Count |
| channel_cid | string | Yes | Channel CID |
| created_at | number | Yes | Date/time of creation |
| created_by_user_id | string | Yes | Created By User ID |
| custom | Record<string, any> | Yes | Custom data for this object |
| latest_replies | MessageResponse[] | Yes | |
| parent_message_id | string | Yes | Parent Message ID |
| participant_count | number | Yes | Participant Count |
| title | string | Yes | Title |
| updated_at | number | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel |
| created_by | UserResponse | No | Created By User |
| deleted_at | number | No | Deleted At |
| draft | DraftResponse | No | |
| last_message_at | number | No | Last Message At |
| parent_message | MessageResponse | No | Parent Message |
| read | ReadStateResponse[] | No | |
| reply_count | number | No | Reply Count |
| thread_participants | ThreadParticipant[] | No | Thread Participants |
Thresholds
Sets thresholds for AI moderation
interface Thresholds {
explicit?: LabelThresholds;
spam?: LabelThresholds;
toxic?: LabelThresholds;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| explicit | LabelThresholds | No | Thresholds for explicit messages |
| spam | LabelThresholds | No | Thresholds for spam |
| toxic | LabelThresholds | No | Thresholds for toxic messages |
Time
interface Time {
}Timestamp
interface Timestamp {
Time?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| Time | number | No |
TruncateChannelResponse
interface TruncateChannelResponse {
channel?: ChannelResponse;
duration: string;
message?: MessageResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| channel | ChannelResponse | No | Truncated channel object |
| message | MessageResponse | No | Truncated message object |
UndeleteMessageResponse
Basic response information
interface UndeleteMessageResponse {
duration: string;
message: MessageResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes |
UnmuteResponse
interface UnmuteResponse {
duration: string;
non_existing_users?: string[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| non_existing_users | string[] | No | A list of users that can't be found. Common cause for this is deleted users |
UnreadCountsBatchResponse
Basic response information
interface UnreadCountsBatchResponse {
counts_by_user: Record<string, any>;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| counts_by_user | Record<string, any> | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
UnreadCountsChannel
interface UnreadCountsChannel {
channel_id: string;
last_read: number;
unread_count: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_id | string | Yes | |
| last_read | number | Yes | |
| unread_count | number | Yes |
UnreadCountsChannelType
interface UnreadCountsChannelType {
channel_count: number;
channel_type: string;
unread_count: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_count | number | Yes | |
| channel_type | string | Yes | |
| unread_count | number | Yes |
UnreadCountsThread
interface UnreadCountsThread {
last_read: number;
last_read_message_id: string;
parent_message_id: string;
unread_count: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| last_read | number | Yes | |
| last_read_message_id | string | Yes | |
| parent_message_id | string | Yes | |
| unread_count | number | Yes |
UpdateChannelPartialResponse
interface UpdateChannelPartialResponse {
channel?: ChannelResponse;
duration: string;
members: ChannelMemberResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| members | ChannelMemberResponse[] | Yes | List of updated members |
| channel | ChannelResponse | No | Updated channel object |
UpdateChannelResponse
interface UpdateChannelResponse {
channel?: ChannelResponse;
duration: string;
members: ChannelMemberResponse[];
message?: MessageResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| members | ChannelMemberResponse[] | Yes | List of channel members |
| channel | ChannelResponse | No | Updated channel |
| message | MessageResponse | No | Message sent to the chat |
UpdateChannelTypeResponse
interface UpdateChannelTypeResponse {
allowed_flag_reasons?: string[];
automod: 'disabled' | 'simple' | 'AI';
automod_behavior: 'flag' | 'block' | 'shadow_block';
automod_thresholds?: Thresholds;
blocklist?: string;
blocklist_behavior?: 'flag' | 'block' | 'shadow_block';
blocklists?: BlockListOptions[];
chat_preferences?: ChatPreferences;
commands: string[];
connect_events: boolean;
count_messages: boolean;
created_at: number;
custom_events: boolean;
delivery_events: boolean;
duration: string;
grants: Record<string, any>;
mark_messages_pending: boolean;
max_message_length: number;
mutes: boolean;
name: string;
partition_size?: number;
partition_ttl?: string;
permissions: PolicyRequest[];
polls: boolean;
push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none';
push_notifications: boolean;
quotes: boolean;
reactions: boolean;
read_events: boolean;
reminders: boolean;
replies: boolean;
search: boolean;
shared_locations: boolean;
skip_last_msg_update_for_system_msgs: boolean;
typing_events: boolean;
updated_at: number;
uploads: boolean;
url_enrichment: boolean;
user_message_reminders: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | 'disabled' | 'simple' | 'AI' |
| automod_behavior | 'flag' | 'block' | 'shadow_block' |
| commands | string[] | Yes | |
| connect_events | boolean | Yes | |
| count_messages | boolean | Yes | |
| created_at | number | Yes | |
| custom_events | boolean | Yes | |
| delivery_events | boolean | Yes | |
| duration | string | Yes | |
| grants | Record<string, any> | Yes | |
| mark_messages_pending | boolean | Yes | |
| max_message_length | number | Yes | |
| mutes | boolean | Yes | |
| name | string | Yes | |
| permissions | PolicyRequest[] | Yes | |
| polls | boolean | Yes | |
| push_notifications | boolean | Yes | |
| quotes | boolean | Yes | |
| reactions | boolean | Yes | |
| read_events | boolean | Yes | |
| reminders | boolean | Yes | |
| replies | boolean | Yes | |
| search | boolean | Yes | |
| shared_locations | boolean | Yes | |
| skip_last_msg_update_for_system_msgs | boolean | Yes | |
| typing_events | boolean | Yes | |
| updated_at | number | Yes | |
| uploads | boolean | Yes | |
| url_enrichment | boolean | Yes | |
| user_message_reminders | boolean | Yes | |
| allowed_flag_reasons | string[] | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | 'flag' | 'block' | 'shadow_block' |
| blocklists | BlockListOptions[] | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | number | No | |
| partition_ttl | string | No | |
| push_level | 'all' | 'all_mentions' | 'mentions' |
UpdateCommandResponse
interface UpdateCommandResponse {
command?: Command;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| command | Command | No | Command object |
UpdateMemberPartialResponse
interface UpdateMemberPartialResponse {
channel_member?: ChannelMemberResponse;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| channel_member | ChannelMemberResponse | No | Updated channel member |
UpdateMessagePartialResponse
interface UpdateMessagePartialResponse {
duration: string;
message?: MessageResponse;
pending_message_metadata?: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | No | Updated message |
| pending_message_metadata | Record<string, any> | No | Pending message metadata |
UpdateMessageResponse
Basic response information
interface UpdateMessageResponse {
duration: string;
message: MessageResponse;
pending_message_metadata?: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| pending_message_metadata | Record<string, any> | No |
UpdateReminderResponse
Basic response information
interface UpdateReminderResponse {
duration: string;
reminder: ReminderResponseData;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| reminder | ReminderResponseData | Yes |
UpdateThreadPartialResponse
interface UpdateThreadPartialResponse {
duration: string;
thread: ThreadResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| thread | ThreadResponse | Yes | Updated thread (not enriched) |
UploadChannelFileResponse
interface UploadChannelFileResponse {
duration: string;
file?: string;
moderation_action?: string;
thumb_url?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| file | string | No | URL to the uploaded asset. Should be used to put to asset_url attachment field |
| moderation_action | string | No | |
| thumb_url | string | No | URL of the file thumbnail for supported file formats. Should be put to `thumb... |
UploadChannelResponse
interface UploadChannelResponse {
duration: string;
file?: string;
moderation_action?: string;
thumb_url?: string;
upload_sizes?: ImageSize[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| file | string | No | |
| moderation_action | string | No | |
| thumb_url | string | No | |
| upload_sizes | ImageSize[] | No | Array of image size configurations |
User
interface User {
data?: Record<string, any>;
id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | |
| data | Record<string, any> | No |
UserCustomEventRequest
interface UserCustomEventRequest {
custom?: Record<string, any>;
type: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | |
| custom | Record<string, any> | No |
UserRequest
User request object
interface UserRequest {
custom?: Record<string, any>;
id: string;
image?: string;
invisible?: boolean;
language?: string;
name?: string;
privacy_settings?: PrivacySettingsResponse;
role?: string;
teams?: string[];
teams_role?: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | User ID |
| custom | Record<string, any> | No | Custom user data |
| image | string | No | User's profile image URL |
| invisible | boolean | No | |
| language | string | No | |
| name | string | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No | |
| role | string | No | User's global role |
| teams | string[] | No | List of teams the user belongs to |
| teams_role | Record<string, any> | No | Map of team-specific roles for the user |
UserResponse
User response object
interface UserResponse {
avg_response_time?: number;
ban_expires?: number;
banned: boolean;
blocked_user_ids: string[];
bypass_moderation?: boolean;
created_at: number;
custom: Record<string, any>;
deactivated_at?: number;
deleted_at?: number;
devices?: DeviceResponse[];
id: string;
image?: string;
invisible: boolean;
language: string;
last_active?: number;
name?: string;
online: boolean;
privacy_settings?: PrivacySettingsResponse;
push_notifications?: PushNotificationSettingsResponse;
revoke_tokens_issued_before?: number;
role: string;
shadow_banned: boolean;
teams: string[];
teams_role?: Record<string, any>;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | boolean | Yes | Whether a user is banned or not |
| blocked_user_ids | string[] | Yes | |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | Custom data for this object |
| id | string | Yes | Unique user identifier |
| invisible | boolean | Yes | |
| language | string | Yes | Preferred language of a user |
| online | boolean | Yes | Whether a user online or not |
| role | string | Yes | Determines the set of user permissions |
| shadow_banned | boolean | Yes | Whether a user is shadow banned |
| teams | string[] | Yes | List of teams user is a part of |
| updated_at | number | Yes | Date/time of the last update |
| avg_response_time | number | No | |
| ban_expires | number | No | Date when ban expires |
| bypass_moderation | boolean | No | |
| deactivated_at | number | No | Date of deactivation |
| deleted_at | number | No | Date/time of deletion |
| devices | DeviceResponse[] | No | List of devices user is using |
| image | string | No | |
| last_active | number | No | Date of last activity |
| name | string | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No | User privacy settings |
| push_notifications | PushNotificationSettingsResponse | No | User push notification settings |
| revoke_tokens_issued_before | number | No | Revocation date for tokens |
| teams_role | Record<string, any> | No |
VoteData
interface VoteData {
answer_text?: string;
option_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| answer_text | string | No | |
| option_id | string | No |
WSEvent
Represents an BaseEvent that happened in Stream Chat
interface WSEvent {
automoderation?: boolean;
automoderation_scores?: ModerationResponse;
channel?: ChannelResponse;
channel_id?: string;
channel_last_message_at?: number;
channel_type?: string;
cid?: string;
connection_id?: string;
created_at: number;
created_by?: UserResponse;
custom: Record<string, any>;
me?: OwnUserResponse;
member?: ChannelMemberResponse;
message?: MessageResponse;
message_update?: MessageUpdate;
parent_id?: string;
poll?: PollResponseData;
poll_vote?: PollVoteResponseData;
reaction?: ReactionResponse;
reason?: string;
team?: string;
thread?: ThreadResponse;
thread_id?: string;
type: string;
user?: UserResponse;
user_id?: string;
watcher_count?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| custom | Record<string, any> | Yes | |
| type | string | Yes | |
| automoderation | boolean | No | |
| automoderation_scores | ModerationResponse | No | |
| channel | ChannelResponse | No | |
| channel_id | string | No | |
| channel_last_message_at | number | No | |
| channel_type | string | No | |
| cid | string | No | |
| connection_id | string | No | |
| created_by | UserResponse | No | |
| me | OwnUserResponse | No | |
| member | ChannelMemberResponse | No | |
| message | MessageResponse | No | |
| message_update | MessageUpdate | No | |
| parent_id | string | No | |
| poll | PollResponseData | No | |
| poll_vote | PollVoteResponseData | No | |
| reaction | ReactionResponse | No | |
| reason | string | No | |
| team | string | No | |
| thread | ThreadResponse | No | |
| thread_id | string | No | |
| user | UserResponse | No | |
| user_id | string | No | |
| watcher_count | number | No |
WrappedUnreadCountsResponse
Basic response information
interface WrappedUnreadCountsResponse {
channel_type: UnreadCountsChannelType[];
channels: UnreadCountsChannel[];
duration: string;
threads: UnreadCountsThread[];
total_unread_count: number;
total_unread_count_by_team?: Record<string, any>;
total_unread_threads_count: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_type | UnreadCountsChannelType[] | Yes | |
| channels | UnreadCountsChannel[] | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
| threads | UnreadCountsThread[] | Yes | |
| total_unread_count | number | Yes | |
| total_unread_threads_count | number | Yes | |
| total_unread_count_by_team | Record<string, any> | No |