Appearance
Chat
About 11184 wordsAbout 37 min
Typescript SDK - Chat API
Table of Contents
- queryChannels
- deleteChannels
- markDelivered
- markChannelsRead
- getOrCreateDistinctChannel
- updateChannel
- updateChannelPartial
- deleteChannel
- getDraft
- createDraft
- deleteDraft
- sendEvent
- uploadChannelFile
- deleteChannelFile
- hideChannel
- uploadChannelImage
- deleteChannelImage
- updateMemberPartial
- sendMessage
- getManyMessages
- getOrCreateChannel
- markRead
- showChannel
- stopWatchingChannel
- truncateChannel
- markUnread
- queryDrafts
- queryMembers
- getMessage
- updateMessage
- updateMessagePartial
- deleteMessage
- runMessageAction
- sendReaction
- deleteReaction
- getReactions
- queryReactions
- translateMessage
- castPollVote
- deletePollVote
- createReminder
- updateReminder
- deleteReminder
- getReplies
- queryMessageFlags
- muteChannel
- unmuteChannel
- queryBannedUsers
- queryFutureChannelBans
- queryReminders
- search
- sync
- queryThreads
- getThread
- updateThreadPartial
- unreadCounts
- Types Reference
queryChannels
Query channels
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query channels
const response = await client.chat.queryChannels({
limit: 25,
sort: [],
filter_conditions: {},
});
console.log(response);Response: QueryChannelsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| connection_id | string | No | - |
| filter_conditions | Record<string, any> | No | - |
| 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 |
| presence | boolean | No | - |
| sort | []SortParamRequest | No | List of sort parameters |
| sort_values | Record<string, any> | No | - |
| state | boolean | No | Whether to update channel state or not |
| watch | boolean | No | Whether to start watching found channels or not |
deleteChannels
Deletes channels asynchronously
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Mark channel message delivery status
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Mark channel message delivery status
const response = await client.chat.markDelivered({
latest_delivered_messages: [],
});
console.log(response);Response: MarkDeliveredResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| latest_delivered_messages | []DeliveredMessagePayload | No | - |
markChannelsRead
Mark channels as read
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Mark channels as read
const response = await client.chat.markChannelsRead({
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 |
getOrCreateDistinctChannel
Get or create channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get or create channel
const response = await client.chat.getOrCreateDistinctChannel({
type: 'like',
connection_id: 'value',
data: 'value',
});
console.log(response);Response: ChannelStateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| connection_id | string | No | - |
| 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 | - |
| presence | boolean | No | Fetch user presence info |
| state | boolean | No | Refresh channel state |
| thread_unread_counts | boolean | No | - |
| watch | boolean | No | Start watching the channel |
| watchers | PaginationParams | No | - |
updateChannel
Update channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Update channel
const response = await client.chat.updateChannel({
type: 'like',
id: 'activity-123',
skip_push: false,
add_filter_tags: [],
});
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 |
updateChannelPartial
Partially update channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Partially update channel
const response = await client.chat.updateChannelPartial({
type: 'like',
id: 'activity-123',
set: {},
unset: [],
});
console.log(response);Response: UpdateChannelPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| set | Record<string, any> | No | - |
| unset | []string | No | - |
deleteChannel
Delete channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Get draft
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get draft
const response = await client.chat.getDraft({
type: 'like',
id: 'activity-123',
parent_id: 'parent-123',
});
console.log(response);Response: GetDraftResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| parent_id | string | No | - |
createDraft
Create a draft
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Create a draft
const response = await client.chat.createDraft({
type: 'like',
id: 'activity-123',
message: 'value',
});
console.log(response);Response: CreateDraftResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| message | MessageRequest | Yes | - |
deleteDraft
Delete draft
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete draft
const response = await client.chat.deleteDraft({
type: 'like',
id: 'activity-123',
parent_id: 'parent-123',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| parent_id | string | No | - |
sendEvent
Send event
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Send event
const response = await client.chat.sendEvent({
type: 'like',
id: 'activity-123',
event: 'value',
});
console.log(response);Response: EventResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| event | EventRequest | Yes | - |
uploadChannelFile
Upload file
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Upload file
const response = await client.chat.uploadChannelFile({
type: 'like',
id: 'activity-123',
file: 'value',
user: { id: "john" },
});
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
Delete file
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Hide channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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 |
uploadChannelImage
Upload image
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Upload image
const response = await client.chat.uploadChannelImage({
type: 'like',
id: 'activity-123',
file: 'value',
upload_sizes: [],
});
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
Delete image
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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 channel member update
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Partially channel member update
const response = await client.chat.updateMemberPartial({
type: 'like',
id: 'activity-123',
set: {},
unset: [],
});
console.log(response);Response: UpdateMemberPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| set | Record<string, any> | No | - |
| unset | []string | No | - |
sendMessage
Send new message
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Send new message
const response = await client.chat.sendMessage({
type: 'like',
id: 'activity-123',
message: 'value',
skip_push: false,
skip_enrich_url: false,
});
console.log(response);Response: SendMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| message | MessageRequest | Yes | - |
| keep_channel_hidden | boolean | No | - |
| skip_enrich_url | boolean | No | - |
| skip_push | boolean | No | - |
getManyMessages
Get many messages
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Get or create channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get or create channel
const response = await client.chat.getOrCreateChannel({
type: 'like',
id: 'activity-123',
connection_id: 'value',
data: 'value',
});
console.log(response);Response: ChannelStateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| connection_id | string | No | - |
| 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 | - |
| presence | boolean | No | Fetch user presence info |
| state | boolean | No | Refresh channel state |
| thread_unread_counts | boolean | No | - |
| watch | boolean | No | Start watching the channel |
| watchers | PaginationParams | No | - |
markRead
Mark read
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Mark read
const response = await client.chat.markRead({
type: 'like',
id: 'activity-123',
message_id: 'value',
thread_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 |
showChannel
Show channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Show channel
const response = await client.chat.showChannel({
type: 'like',
id: 'activity-123',
});
console.log(response);Response: ShowChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
stopWatchingChannel
Stop watching channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Stop watching channel
const response = await client.chat.stopWatchingChannel({
type: 'like',
id: 'activity-123',
connection_id: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | - |
| id | string | Yes | - |
| connection_id | string | No | - |
truncateChannel
Truncate channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Truncate channel
const response = await client.chat.truncateChannel({
type: 'like',
id: 'activity-123',
hard_delete: false,
skip_push: false,
});
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... |
markUnread
Mark unread
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Mark unread
const response = await client.chat.markUnread({
type: 'like',
id: 'activity-123',
message_id: 'value',
message_timestamp: 10,
});
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 |
queryDrafts
Query draft messages
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query draft messages
const response = await client.chat.queryDrafts({
limit: 25,
filter: {},
sort: [],
});
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 |
queryMembers
Query members
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query members
const response = await client.chat.queryMembers({
payload: 'value',
});
console.log(response);Response: MembersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
getMessage
Get message
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get message
const response = await client.chat.getMessage({
id: 'activity-123',
});
console.log(response);Response: GetMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
updateMessage
Update message
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Update message
const response = await client.chat.updateMessage({
id: 'activity-123',
message: 'value',
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
Partially message update
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Partially message update
const response = await client.chat.updateMessagePartial({
id: 'activity-123',
set: {},
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 |
| unset | []string | No | Array of field names to unset |
deleteMessage
Delete message
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete message
const response = await client.chat.deleteMessage({
id: 'activity-123',
hard: false,
deleted_by: 'value',
});
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
Run message command action
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Run message command action
const response = await client.chat.runMessageAction({
id: 'activity-123',
form_data: {},
});
console.log(response);Response: MessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| form_data | Record<string, any> | Yes | ReadOnlyData to execute command with |
sendReaction
Send reaction
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Send reaction
const response = await client.chat.sendReaction({
id: 'activity-123',
reaction: 'value',
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
Delete reaction
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Get reactions
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
//
const response = await client.chat.queryReactions({
id: 'activity-123',
limit: 25,
filter: {},
});
console.log(response);Response: QueryReactionsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| filter | Record<string, any> | No | - |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | - |
translateMessage
Translate message
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Translate message
const response = await client.chat.translateMessage({
id: 'activity-123',
language: 'value',
});
console.log(response);Response: MessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
| language | string | Yes | Language to translate message to |
castPollVote
Cast vote
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Cast vote
const response = await client.chat.castPollVote({
message_id: 'value',
poll_id: 'poll-123',
vote: 'value',
});
console.log(response);Response: PollVoteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| poll_id | string | Yes | - |
| vote | VoteData | No | Vote data |
deletePollVote
Delete vote
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Create reminder
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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 | - |
updateReminder
Updates Reminder
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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 | - |
deleteReminder
Delete reminder
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete reminder
const response = await client.chat.deleteReminder({
message_id: 'value',
});
console.log(response);Response: DeleteReminderResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
getReplies
Get replies
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get replies
const response = await client.chat.getReplies({
parent_id: 'parent-123',
limit: 25,
sort: [],
});
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
Query Message Flags
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query Message Flags
const response = await client.chat.queryMessageFlags({
payload: 'value',
});
console.log(response);Response: QueryMessageFlagsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
muteChannel
Mute channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Mute channel
const response = await client.chat.muteChannel({
channel_cids: [],
expiration: 10,
});
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 |
unmuteChannel
Unmute channel
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Unmute channel
const response = await client.chat.unmuteChannel({
channel_cids: [],
expiration: 10,
});
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 |
queryBannedUsers
Query Banned Users
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query Banned Users
const response = await client.chat.queryBannedUsers({
payload: 'value',
});
console.log(response);Response: QueryBannedUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
queryFutureChannelBans
Query Future Channel Bans
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// 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
Query reminders
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query reminders
const response = await client.chat.queryReminders({
limit: 25,
filter: {},
sort: [],
});
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 |
search
Search messages
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Search messages
const response = await client.chat.search({
payload: 'value',
});
console.log(response);Response: SearchResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
sync
Sync
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Sync
const response = await client.chat.sync({
channel_cids: [],
last_sync_at: 10,
with_inaccessible_cids: false,
watch: false,
});
console.log(response);Response: SyncResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| channel_cids | []string | Yes | List of channel CIDs to sync |
| last_sync_at | float | Yes | Date from which synchronization should happen |
| with_inaccessible_cids | boolean | No | - |
| watch | boolean | No | - |
| connection_id | string | No | - |
queryThreads
Query Threads
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query Threads
const response = await client.chat.queryThreads({
limit: 25,
filter: {},
sort: [],
});
console.log(response);Response: QueryThreadsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| connection_id | string | No | - |
| filter | Record<string, any> | No | Filter conditions to apply to threads |
| 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 | Sort conditions to apply to threads |
| watch | boolean | No | Start watching the channel this thread belongs to |
getThread
Get Thread
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get Thread
const response = await client.chat.getThread({
message_id: 'value',
watch: false,
connection_id: 'value',
});
console.log(response);Response: GetThreadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | - |
| watch | boolean | No | - |
| connection_id | string | No | - |
| reply_limit | number | No | - |
| participant_limit | number | No | - |
| member_limit | number | No | - |
updateThreadPartial
Partially update thread
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Partially update thread
const response = await client.chat.updateThreadPartial({
message_id: 'value',
set: {},
unset: [],
});
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 |
unreadCounts
Unread counts
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Unread counts
const response = await client.chat.unreadCounts();
console.log(response);Response: WrappedUnreadCountsResponse
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 |
Channel
interface Channel {
active_live_locations?: SharedLocation[];
auto_translation_enabled?: boolean;
auto_translation_language: string;
cid: string;
config?: ChannelConfig;
config_overrides?: ConfigOverrides;
cooldown?: number;
created_at: number;
created_by?: User;
custom: Record<string, any>;
deleted_at?: number;
disabled: boolean;
filter_tags?: string[];
frozen: boolean;
id: string;
invites?: ChannelMember[];
last_campaigns?: string;
last_message_at?: number;
member_count?: number;
members?: ChannelMember[];
members_lookup?: Record<string, any>;
message_count?: number;
message_count_updated_at?: number;
team?: string;
truncated_by?: User;
type: string;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_language | string | Yes | |
| cid | string | Yes | |
| created_at | number | Yes | |
| custom | Record<string, any> | Yes | |
| disabled | boolean | Yes | |
| frozen | boolean | Yes | |
| id | string | Yes | |
| type | string | Yes | |
| updated_at | number | Yes | |
| active_live_locations | SharedLocation[] | No | |
| auto_translation_enabled | boolean | No | |
| config | ChannelConfig | No | |
| config_overrides | ConfigOverrides | No | |
| cooldown | number | No | |
| created_by | User | No | |
| deleted_at | number | No | |
| filter_tags | string[] | No | |
| invites | ChannelMember[] | No | |
| last_campaigns | string | No | |
| last_message_at | number | No | |
| member_count | number | No | |
| members | ChannelMember[] | No | |
| members_lookup | Record<string, any> | No | |
| message_count | number | No | |
| message_count_updated_at | number | No | |
| team | string | No | |
| truncated_by | User | No |
ChannelConfig
Channel configuration overrides
interface ChannelConfig {
blocklist?: string;
blocklist_behavior?: 'flag' | 'block';
commands?: string[];
grants?: Record<string, any>;
max_message_length?: number;
quotes?: boolean;
reactions?: boolean;
replies?: boolean;
typing_events?: boolean;
uploads?: boolean;
url_enrichment?: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklist | string | No | |
| blocklist_behavior | 'flag' | 'block' | No |
| commands | string[] | No | List of commands that channel supports |
| grants | Record<string, any> | No | |
| max_message_length | number | No | Overrides max message length |
| quotes | boolean | No | Enables message quotes |
| reactions | boolean | No | Enables or disables reactions |
| replies | boolean | No | Enables message replies (threads) |
| typing_events | boolean | No | Enables or disables typing events |
| uploads | boolean | No | Enables or disables file uploads |
| url_enrichment | boolean | No | Enables or disables URL enrichment |
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?: ConfigOverrides;
created_by?: User;
custom?: Record<string, any>;
disabled?: boolean;
frozen?: boolean;
invites?: ChannelMember[];
members?: ChannelMember[];
team?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | boolean | No | |
| auto_translation_language | string | No | |
| config_overrides | ConfigOverrides | No | |
| created_by | User | No | |
| custom | Record<string, any> | No | |
| disabled | boolean | No | |
| frozen | boolean | No | |
| invites | ChannelMember[] | No | |
| members | ChannelMember[] | No | |
| team | string | No |
ChannelMember
interface ChannelMember {
archived_at?: number;
ban_expires?: number;
banned?: boolean;
blocked?: boolean;
channel?: DenormalizedChannelFields;
channel_role?: string;
created_at?: number;
custom?: Record<string, any>;
deleted_at?: number;
deleted_messages?: string[];
hidden?: boolean;
invite_accepted_at?: number;
invite_rejected_at?: number;
invited?: boolean;
is_global_banned?: boolean;
is_moderator?: boolean;
notifications_muted?: boolean;
pinned_at?: number;
shadow_banned?: boolean;
status?: string;
updated_at?: number;
user?: User;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| archived_at | number | No | |
| ban_expires | number | No | |
| banned | boolean | No | |
| blocked | boolean | No | |
| channel | DenormalizedChannelFields | No | |
| channel_role | string | No | |
| created_at | number | No | |
| custom | Record<string, any> | No | |
| deleted_at | number | No | |
| deleted_messages | string[] | No | |
| hidden | boolean | No | |
| invite_accepted_at | number | No | |
| invite_rejected_at | number | No | |
| invited | boolean | No | |
| is_global_banned | boolean | No | |
| is_moderator | boolean | No | |
| notifications_muted | boolean | No | |
| pinned_at | number | No | |
| shadow_banned | boolean | No | |
| status | string | No | |
| updated_at | number | No | |
| user | User | No | |
| user_id | 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?: 'member' | 'moderator' | 'admin' | 'owner';
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 | 'member' | 'moderator' | 'admin' |
| 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;
disabled_until?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| chat_level | string | 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 |
ConfigOverrides
interface ConfigOverrides {
blocklist?: string;
blocklist_behavior?: 'flag' | 'block';
commands?: string[];
count_messages?: boolean;
grants?: Record<string, any>;
max_message_length?: number;
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_behavior | 'flag' | 'block' | No |
| commands | string[] | No | |
| count_messages | boolean | No | |
| grants | Record<string, any> | No | |
| max_message_length | number | No | |
| quotes | boolean | No | |
| reactions | boolean | No | |
| replies | boolean | No | |
| shared_locations | boolean | No | |
| typing_events | boolean | No | |
| uploads | boolean | No | |
| url_enrichment | boolean | No | |
| user_message_reminders | boolean | No |
CreateDraftResponse
Basic response information
interface CreateDraftResponse {
draft: DraftResponse;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| draft | DraftResponse | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
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 |
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 |
DeliveredMessagePayload
interface DeliveredMessagePayload {
cid?: string;
id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | No | |
| id | string | No |
DenormalizedChannelFields
interface DenormalizedChannelFields {
created_at?: string;
created_by_id?: string;
custom?: Record<string, any>;
disabled?: boolean;
frozen?: boolean;
id?: string;
last_message_at?: string;
member_count?: number;
team?: string;
type?: string;
updated_at?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | string | No | |
| created_by_id | string | No | |
| custom | Record<string, any> | No | |
| disabled | boolean | No | |
| frozen | boolean | No | |
| id | string | No | |
| last_message_at | string | No | |
| member_count | number | No | |
| team | string | No | |
| type | string | No | |
| updated_at | 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;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | |
| custom | Record<string, any> | No | |
| parent_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 |
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 |
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 |
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?: 'top' | 'bottom' | 'left' | 'right' | 'center';
height?: number;
resize?: 'clip' | 'crop' | 'scale' | 'fill';
width?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| crop | 'top' | 'bottom' | 'left' |
| height | number | No | Target image height |
| resize | 'clip' | 'crop' | 'scale' |
| width | number | No | Target image width |
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?: MessageReadEvent;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| event | MessageReadEvent | No | Mark read event |
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 |
Message
interface Message {
attachments: Attachment[];
before_message_send_failed?: boolean;
cid: string;
command?: string;
created_at: number;
custom: Record<string, any>;
deleted_at?: number;
deleted_for_me?: boolean;
deleted_reply_count: number;
html: string;
i18n?: Record<string, any>;
id: string;
image_labels?: Record<string, any>;
latest_reactions: Reaction[];
member?: ChannelMember;
mentioned_users: User[];
message_text_updated_at?: number;
mml?: string;
moderation?: ModerationV2Response;
own_reactions: Reaction[];
parent_id?: string;
pin_expires?: number;
pinned: boolean;
pinned_at?: number;
pinned_by?: User;
poll?: Poll;
poll_id?: string;
quoted_message?: Message;
quoted_message_id?: string;
reaction_counts: Record<string, any>;
reaction_groups: Record<string, any>;
reaction_scores: Record<string, any>;
reminder?: MessageReminder;
reply_count: number;
restricted_visibility: string[];
shadowed: boolean;
shared_location?: SharedLocation;
show_in_channel?: boolean;
silent: boolean;
text: string;
thread_participants?: User[];
type: string;
updated_at: number;
user?: User;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | Attachment[] | Yes | |
| cid | string | Yes | |
| created_at | number | Yes | |
| custom | Record<string, any> | Yes | |
| deleted_reply_count | number | Yes | |
| html | string | Yes | |
| id | string | Yes | |
| latest_reactions | Reaction[] | Yes | |
| mentioned_users | User[] | Yes | |
| own_reactions | Reaction[] | Yes | |
| pinned | boolean | Yes | |
| reaction_counts | Record<string, any> | Yes | |
| reaction_groups | Record<string, any> | Yes | |
| reaction_scores | Record<string, any> | Yes | |
| reply_count | number | Yes | |
| restricted_visibility | string[] | Yes | |
| shadowed | boolean | Yes | |
| silent | boolean | Yes | |
| text | string | Yes | |
| type | string | Yes | |
| updated_at | number | Yes | |
| before_message_send_failed | boolean | No | |
| command | string | No | |
| deleted_at | number | No | |
| deleted_for_me | boolean | No | |
| i18n | Record<string, any> | No | |
| image_labels | Record<string, any> | No | |
| member | ChannelMember | No | |
| message_text_updated_at | number | No | |
| mml | string | No | |
| moderation | ModerationV2Response | No | |
| parent_id | string | No | |
| pin_expires | number | No | |
| pinned_at | number | No | |
| pinned_by | User | No | |
| poll | Poll | No | |
| poll_id | string | No | |
| quoted_message | Message | No | |
| quoted_message_id | string | No | |
| reminder | MessageReminder | No | |
| shared_location | SharedLocation | No | |
| show_in_channel | boolean | No | |
| thread_participants | User[] | No | |
| user | User | No |
MessageFlagResponse
interface MessageFlagResponse {
approved_at?: number;
created_at: number;
created_by_automod: boolean;
custom?: Record<string, any>;
details?: FlagDetails;
message?: Message;
moderation_feedback?: FlagFeedback;
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 | FlagDetails | No | |
| message | Message | No | |
| moderation_feedback | FlagFeedback | No | |
| moderation_result | MessageModerationResult | No | |
| reason | string | No | |
| rejected_at | number | No | |
| reviewed_at | number | No | |
| reviewed_by | UserResponse | No | |
| user | UserResponse | No |
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 |
MessageReadEvent
interface MessageReadEvent {
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 |
MessageReminder
interface MessageReminder {
channel?: Channel;
channel_cid: string;
created_at: number;
message?: Message;
message_id: string;
remind_at?: number;
task_id: string;
updated_at: number;
user?: User;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | number | Yes | |
| message_id | string | Yes | |
| task_id | string | Yes | |
| updated_at | number | Yes | |
| user_id | string | Yes | |
| channel | Channel | No | |
| message | Message | No | |
| remind_at | number | No | |
| user | User | No |
MessageRequest
interface MessageRequest {
attachments?: Attachment[];
custom?: Record<string, any>;
id?: 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';
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | Attachment[] | No | |
| custom | Record<string, any> | No | |
| id | string | No | |
| mentioned_users | string[] | No | |
| mml | string | No | |
| parent_id | string | No | |
| pin_expires | number | No | |
| pinned | boolean | No | |
| pinned_at | string | No | |
| poll_id | string | No | |
| quoted_message_id | string | No | |
| restricted_visibility | string[] | No | |
| shared_location | SharedLocation | No | |
| show_in_channel | boolean | No | |
| silent | boolean | No | |
| text | string | No | |
| type | '''' | 'regular' | 'system' |
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_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: 'regular' | 'ephemeral' | 'error' | 'reply' | 'system' | 'deleted';
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_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 | 'regular' | 'ephemeral' | 'error' |
| 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 |
| 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_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: 'regular' | 'ephemeral' | 'error' | 'reply' | 'system' | 'deleted';
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_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 | 'regular' | 'ephemeral' | 'error' |
| 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 |
| 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 |
ModerationV2Response
interface ModerationV2Response {
action: string;
blocklist_matched?: string;
image_harms?: string[];
original_text: string;
platform_circumvented?: boolean;
semantic_filter_matched?: string;
text_harms?: string[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | |
| original_text | string | Yes | |
| blocklist_matched | string | No | |
| image_harms | string[] | No | |
| platform_circumvented | boolean | No | |
| semantic_filter_matched | string | No | |
| text_harms | string[] | No |
MuteChannelResponse
interface MuteChannelResponse {
channel_mute?: ChannelMute;
channel_mutes?: ChannelMute[];
duration: string;
own_user?: OwnUser;
}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 | OwnUser | No | Authorized user object with fresh mutes information |
OnlyUserID
interface OnlyUserID {
id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes |
OwnUser
interface OwnUser {
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: Device[];
id: string;
invisible?: boolean;
language: string;
last_active?: number;
last_engaged_at?: number;
latest_hidden_channels?: string[];
mutes: UserMute[];
online: boolean;
privacy_settings?: PrivacySettings;
push_preferences?: PushPreferences;
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 | Device[] | Yes | |
| id | string | Yes | |
| language | string | Yes | |
| mutes | UserMute[] | Yes | |
| online | boolean | Yes | |
| role | string | Yes | |
| total_unread_count | number | Yes | |
| total_unread_count_by_team | Record<string, any> | 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 | |
| invisible | boolean | No | |
| last_active | number | No | |
| last_engaged_at | number | No | |
| latest_hidden_channels | string[] | No | |
| privacy_settings | PrivacySettings | No | |
| push_preferences | PushPreferences | No | |
| teams | string[] | No | |
| teams_role | Record<string, any> | No |
PaginationParams
interface PaginationParams {
limit?: number;
offset?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| limit | number | No | |
| offset | number | 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 |
Poll
interface Poll {
Custom: Record<string, any>;
allow_answers: boolean;
allow_user_suggested_options: boolean;
answers_count: number;
created_at: number;
created_by?: User;
created_by_id: string;
description: string;
enforce_unique_vote: boolean;
id: string;
is_closed?: boolean;
latest_answers: PollVote[];
latest_votes_by_option: Record<string, any>;
max_votes_allowed?: number;
name: string;
options: PollOption[];
own_votes: PollVote[];
updated_at: number;
vote_count: number;
vote_counts_by_option: Record<string, any>;
voting_visibility?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| Custom | Record<string, any> | Yes | |
| allow_answers | boolean | Yes | |
| allow_user_suggested_options | boolean | Yes | |
| answers_count | number | Yes | |
| created_at | number | Yes | |
| created_by_id | string | Yes | |
| description | string | Yes | |
| enforce_unique_vote | boolean | Yes | |
| id | string | Yes | |
| latest_answers | PollVote[] | Yes | |
| latest_votes_by_option | Record<string, any> | Yes | |
| name | string | Yes | |
| options | PollOption[] | Yes | |
| own_votes | PollVote[] | Yes | |
| updated_at | number | Yes | |
| vote_count | number | Yes | |
| vote_counts_by_option | Record<string, any> | Yes | |
| created_by | User | No | |
| is_closed | boolean | No | |
| max_votes_allowed | number | No | |
| voting_visibility | string | No |
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 |
PrivacySettings
interface PrivacySettings {
delivery_receipts?: DeliveryReceipts;
read_receipts?: ReadReceipts;
typing_indicators?: TypingIndicators;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| delivery_receipts | DeliveryReceipts | No | |
| read_receipts | ReadReceipts | No | |
| typing_indicators | TypingIndicators | 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 |
QueryChannelsResponse
interface QueryChannelsResponse {
channels: ChannelStateResponseFields[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channels | ChannelStateResponseFields[] | Yes | List of channels |
| duration | string | Yes | Duration of the request in milliseconds |
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 |
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 |
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 {
created_at: number;
custom: Record<string, any>;
message_id: string;
score: number;
type: string;
updated_at: number;
user?: User;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| custom | Record<string, any> | Yes | |
| message_id | string | Yes | |
| score | number | Yes | |
| type | string | Yes | |
| updated_at | number | Yes | |
| user | User | No | |
| user_id | string | No |
ReactionRequest
Represents user reaction to a message
interface ReactionRequest {
created_at?: number;
custom?: Record<string, any>;
score?: number;
type: string;
updated_at?: number;
}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 |
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 |
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 |
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 |
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?: '' | 'number' | 'boolean';
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| direction | number | No | Direction of sorting, 1 for Ascending, -1 for Descending, default is 1 |
| field | string | No | Name of field to sort by |
| type | '' | 'number' | 'boolean' |
SyncResponse
Sync response
interface SyncResponse {
duration: string;
events: WSEvent[];
inaccessible_cids?: string[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| events | WSEvent[] | Yes | List of events |
| inaccessible_cids | string[] | No | List of CIDs that user can't access |
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 |
Time
interface Time {
}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 |
UnmuteResponse
Basic response information
interface UnmuteResponse {
duration: string;
non_existing_users?: string[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| non_existing_users | string[] | No |
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 |
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 {
ban_expires?: number;
banned?: boolean;
custom?: Record<string, any>;
id: string;
invisible?: boolean;
language?: string;
privacy_settings?: PrivacySettings;
revoke_tokens_issued_before?: number;
role?: string;
teams?: string[];
teams_role?: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | |
| ban_expires | number | No | |
| banned | boolean | No | |
| custom | Record<string, any> | No | |
| invisible | boolean | No | |
| language | string | No | |
| privacy_settings | PrivacySettings | No | |
| revoke_tokens_issued_before | number | No | |
| role | string | No | |
| teams | string[] | No | |
| teams_role | 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;
}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 |
UserResponse
User response object
interface UserResponse {
avg_response_time?: number;
banned: boolean;
blocked_user_ids: string[];
created_at: number;
custom: Record<string, any>;
deactivated_at?: number;
deleted_at?: number;
id: string;
image?: string;
language: string;
last_active?: number;
name?: string;
online: boolean;
revoke_tokens_issued_before?: number;
role: string;
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 |
| 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 |
| 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 | |
| deactivated_at | number | No | Date of deactivation |
| deleted_at | number | No | Date/time of deletion |
| image | string | No | |
| last_active | number | No | Date of last activity |
| name | string | No | Optional name of user |
| 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
The discriminator object for all websocket events, it maps events' payload to the final type
interface WSEvent {
}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 |