Appearance
Chat
About 13139 wordsAbout 44 min
Swift 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
Access a list of communication channels available in your account, facilitating efficient management and selection for your campaigns.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryChannels(
request: .init(
filterConditions: [:],
filterValues: [:]
)
)
print(response)Response: QueryChannelsResponse
Parameters
Query Parameters:
connectionID(String)
Request Body:
filterConditions([String: Any]): Filter conditions to apply to the queryfilterValues([String: Any]): Values to interpolate into the predefined filter templatelimit(Int): Number of channels to limitmemberLimit(Int): Number of members to limitmessageLimit(Int): Number of messages to limitoffset(Int): Channel pagination offsetpredefinedFilter(String): ID of a predefined filter to use instead of filter_conditionspresence(Bool)sort([SortParamRequest]): List of sort parameterssortValues([String: Any])state(Bool): Whether to update channel state or notwatch(Bool): Whether to start watching found channels or not
deleteChannels
Asynchronously remove specific channels from your account, helping you maintain an organized and relevant channel list without immediate blocking.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.deleteChannels(
request: .init(
cids: ["id-1", "id-2"],
hardDelete: true
)
)
print(response)Response: DeleteChannelsResponse
Parameters
Request Body:
cids([String]) (required): All channels that should be deletedhardDelete(Bool): Specify if channels and all ressources should be hard deleted
markDelivered
Update the delivery status of messages sent through a channel, ensuring accurate tracking and reporting of message delivery outcomes.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.markDelivered(
request: .init(
latestDeliveredMessages: []
)
)
print(response)Response: MarkDeliveredResponse
Parameters
Request Body:
latestDeliveredMessages([DeliveredMessagePayload])
markChannelsRead
Mark all messages in selected channels as read, allowing you to streamline communication management and reduce notification clutter.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.markChannelsRead(
request: .init(
readByChannel: [:]
)
)
print(response)Response: MarkReadResponse
Parameters
Request Body:
readByChannel([String: Any]): Map of channel ID to last read message ID
getOrCreateDistinctChannel
Retrieve an existing channel or create a new one based on unique identifiers, simplifying the process of managing distinct communication threads.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.getOrCreateDistinctChannel(
request: .init(
data: [:],
hideForCreator: true
)
)
print(response)Response: ChannelStateResponse
Parameters
Path Parameters:
type(String) (required)
Query Parameters:
connectionID(String)
Request Body:
data(ChannelInput)hideForCreator(Bool): Whether this channel will be hidden for the user who created the channel or notmembers(PaginationParams)messages(MessagePaginationParams)presence(Bool): Fetch user presence infostate(Bool): Refresh channel statethreadUnreadCounts(Bool)watch(Bool): Start watching the channelwatchers(PaginationParams)
updateChannel
Modify the settings or attributes of an existing channel to keep your communication channels up-to-date and aligned with your needs.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.updateChannel(
request: .init(
acceptInvite: true,
addFilterTags: ["value1", "value2"]
)
)
print(response)Response: UpdateChannelResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
acceptInvite(Bool): Set totrueto accept the inviteaddFilterTags([String]): List of filter tags to add to the channeladdMembers([ChannelMemberRequest]): List of user IDs to add to the channeladdModerators([String]): List of user IDs to make channel moderatorsassignRoles([ChannelMemberRequest]): List of channel member role assignments. If any specified user is not part of the channel, the request will failcooldown(Int): Sets cool down period for the channel in secondsdata(ChannelInputRequest)demoteModerators([String]): List of user IDs to take away moderators status fromhideHistory(Bool): Set totrueto hide channel's history when adding new membershideHistoryBefore(Double): If set, hides channel's history before this time when adding new members. Takes precedence overhide_historywhen both are provided. Must be in RFC3339 format (e.g., "2024-01-01T10:00:00Z") and in the past.invites([ChannelMemberRequest]): List of user IDs to invite to the channelmessage(MessageRequest): Message to send to the chat when channel is successfully updatedrejectInvite(Bool): Set totrueto reject the inviteremoveFilterTags([String]): List of filter tags to remove from the channelremoveMembers([String]): List of user IDs to remove from the channelskipPush(Bool): Whenmessageis set disables all push notifications for it
updateChannelPartial
Update specific attributes of a channel without altering the entire channel configuration. Use this to make targeted changes, such as updating channel metadata or settings.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.updateChannelPartial(
request: .init(
set: [:],
unset: ["value1", "value2"]
)
)
print(response)Response: UpdateChannelPartialResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
set([String: Any])unset([String])
deleteChannel
Remove a channel from the system entirely. Use this when you want to permanently delete a channel and its associated data.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.deleteChannel()
print(response)Response: DeleteChannelResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
hardDelete(Bool)
getDraft
Retrieve a draft message for editing or review. Use this to access unsent messages saved as drafts before finalizing or sending them.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.getDraft()
print(response)Response: GetDraftResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
parentID(String)
createDraft
CreateDraft allows you to save a message as a draft before sending it, which is useful for composing messages over time or reviewing content before making it public.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.createDraft(
request: .init(
message: "Hello, World!"
)
)
print(response)Response: CreateDraftResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
message(MessageRequest) (required)
deleteDraft
Remove a draft message from the system. Use this when a draft is no longer needed and you want to declutter saved drafts.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.deleteDraft()
print(response)Response: Response
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
parentID(String)
sendEvent
Trigger an event within a channel to notify users of actions or updates. Use this to communicate important events, such as member joins or message reactions.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.sendEvent(
request: .init(
event: "example_value"
)
)
print(response)Response: EventResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
event(EventRequest) (required)
uploadChannelFile
Upload a file to a channel for sharing with other members. Use this to share documents, images, or any relevant files within the channel.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.uploadChannelFile(
request: .init(
file: "example_value",
user: "example_value"
)
)
print(response)Response: UploadChannelFileResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
file(String): file fielduser(OnlyUserID): user for the request server side only
deleteChannelFile
Remove a previously uploaded file from a channel. Use this to manage or clean up files that are no longer needed in the channel.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.deleteChannelFile()
print(response)Response: Response
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
url(String)
hideChannel
Temporarily hide a channel from the user's view without deleting it. Use this to reduce clutter while retaining access to the channel for future engagement.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.hideChannel(
request: .init(
clearHistory: true
)
)
print(response)Response: HideChannelResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
clearHistory(Bool): Whether to clear message history of the channel or not
uploadChannelImage
Upload an image to a channel, enhancing communication with visual content. Use this to share images relevant to the channel's discussions or activities.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.uploadChannelImage(
request: .init(
file: "example_value",
uploadSizes: []
)
)
print(response)Response: UploadChannelResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
file(String)uploadSizes([ImageSize]): field with JSON-encoded array of image size configurationsuser(OnlyUserID)
deleteChannelImage
Remove an uploaded image from a channel. Use this to manage the visual content and keep the channel's media relevant and up-to-date.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.deleteChannelImage()
print(response)Response: Response
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
url(String)
updateMemberPartial
Partially update the details of a channel member, such as their role or nickname, without altering their entire profile. Use this when you need to make specific updates to a member's attributes in a channel.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.updateMemberPartial(
request: .init(
set: [:],
unset: ["value1", "value2"]
)
)
print(response)Response: UpdateMemberPartialResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
set([String: Any])unset([String])
sendMessage
Send a new message to a specified channel, allowing you to initiate or continue a conversation. Use this to communicate with channel members through text, attachments, or other supported message types.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.sendMessage(
request: .init(
message: "Hello, World!",
keepChannelHidden: true,
skipEnrichURL: "https://example.com"
)
)
print(response)Response: SendMessageResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
keepChannelHidden(Bool)message(MessageRequest) (required)skipEnrichURL(Bool)skipPush(Bool)
getManyMessages
Retrieve a batch of messages from a channel, which can be useful for loading conversation history or displaying older messages. Use this to efficiently access multiple messages at once.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.getManyMessages(
ids: "example_value"
)
print(response)Response: GetManyMessagesResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
ids([String]) (required)
getOrCreateChannel
Retrieve an existing channel or create a new one if it doesn't exist, ensuring you have a channel to work with for communication. Use this when you need to set up or access a channel dynamically.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.getOrCreateChannel(
request: .init(
data: [:],
hideForCreator: true
)
)
print(response)Response: ChannelStateResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
connectionID(String)
Request Body:
data(ChannelInput)hideForCreator(Bool): Whether this channel will be hidden for the user who created the channel or notmembers(PaginationParams)messages(MessagePaginationParams)presence(Bool): Fetch user presence infostate(Bool): Refresh channel statethreadUnreadCounts(Bool)watch(Bool): Start watching the channelwatchers(PaginationParams)
markRead
Mark messages in a channel as read to update the read status and notify other members. Use this to keep track of read messages and manage message notifications.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.markRead(
request: .init(
messageID: "message-789",
threadID: "example_value"
)
)
print(response)Response: MarkReadResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
messageID(String): ID of the message that is considered last read by clientthreadID(String): Optional Thread ID to specifically mark a given thread as read
showChannel
Display detailed information about a specific channel, including its settings and current members. Use this to gain insights into a channel's configuration and participant list.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.showChannel()
print(response)Response: ShowChannelResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
stopWatchingChannel
StopWatchingChannel lets you stop receiving real-time updates from a specific channel, which can help reduce distractions or manage notifications more effectively when you no longer need immediate updates.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.stopWatchingChannel()
print(response)Response: Response
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Query Parameters:
connectionID(String)
truncateChannel
Clear all messages from a channel while preserving its settings and members, effectively resetting the conversation. Use this to start anew without deleting the channel entirely.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.truncateChannel(
request: .init(
hardDelete: true,
memberIds: ["id-1", "id-2"]
)
)
print(response)Response: TruncateChannelResponse
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
hardDelete(Bool): Permanently delete channel data (messages, reactions, etc.)memberIds([String]): List of member IDs to hide message history for. If empty, truncates the channel for all membersmessage(MessageRequest)skipPush(Bool): Whenmessageis set disables all push notifications for ittruncatedAt(Double): Truncate channel data up totruncated_at. The system message (if provided) creation time is always greater thantruncated_at
markUnread
Mark messages in a channel as unread, which can be useful for revisiting important conversations or managing notification settings. Use this to reset the read status of messages that need attention.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let channelId = ChannelId(type: .messaging, id: "channel-123")
let channel = client.channelController(for: channelId)
try await channel.synchronize()
let response = try await channel.markUnread(
request: .init(
messageID: "message-789",
messageTimestamp: 1.0
)
)
print(response)Response: Response
Parameters
Path Parameters:
type(String) (required)id(String) (required)
Request Body:
messageID(String): ID of the message from where the channel is marked unreadmessageTimestamp(Double): Timestamp of the message from where the channel is marked unreadthreadID(String): Mark a thread unread, specify one of the thread, message timestamp, or message id
queryDrafts
Search for draft messages to review or manage incomplete communications before they are sent within the chat.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryDrafts(
request: .init(
filter: [:],
limit: 1
)
)
print(response)Response: QueryDraftsResponse
Parameters
Request Body:
filter([String: Any]): Filter to apply to the querylimit(Int)next(String)prev(String)sort([SortParamRequest]): Array of sort parameters
queryMembers
Retrieve a list of members within a chat, perfect for when you need to understand the participants in a conversation or manage member-related actions.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryMembers()
print(response)Response: MembersResponse
Parameters
Query Parameters:
payload()
getMessage
Fetch a specific message by its identifier, ideal for when you need detailed information about a particular message.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.getMessage(
id: "example-id"
)
print(response)Response: GetMessageResponse
Parameters
Path Parameters:
id(String) (required)
updateMessage
Modify the content of an existing message, useful for correcting errors or updating information within a conversation.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.updateMessage(
request: .init(
message: "Hello, World!",
skipEnrichURL: "https://example.com",
skipPush: true
)
)
print(response)Response: UpdateMessageResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
message(MessageRequest) (required): MessageskipEnrichURL(Bool): Skip enrich URLskipPush(Bool)
updateMessagePartial
Make selective changes to parts of a message without altering the entire content, perfect for minor edits or updates.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.updateMessagePartial(
request: .init(
set: [:],
skipEnrichURL: "https://example.com"
)
)
print(response)Response: UpdateMessagePartialResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
set([String: Any]): Sets new field valuesskipEnrichURL(Bool): Skip enriching the URL in the messageskipPush(Bool)unset([String]): Array of field names to unset
deleteMessage
Remove a message from the chat, useful for managing content or when you need to eliminate outdated or inappropriate information.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.deleteMessage(
id: "example-id"
)
print(response)Response: DeleteMessageResponse
Parameters
Path Parameters:
id(String) (required)
Query Parameters:
hard(Bool)deletedBy(String)deleteForMe(Bool)
runMessageAction
Execute a predefined action on a message, ideal for triggering automated responses or workflows based on message content.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.runMessageAction(
request: .init(
formData: [:]
)
)
print(response)Response: MessageActionResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
formData([String: Any]) (required): ReadOnlyData to execute command with
sendReaction
Express your response or feedback to a message by sending an emoji reaction, enhancing interaction and engagement within the chat.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.sendReaction(
request: .init(
reaction: "example_value",
enforceUnique: true,
skipPush: true
)
)
print(response)Response: SendReactionResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
enforceUnique(Bool): Whether to replace all existing user reactionsreaction(ReactionRequest) (required)skipPush(Bool): Skips any mobile push notifications
deleteReaction
Removes a user's reaction from a message, useful for managing or correcting reactions in a conversation.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.deleteReaction(
id: "example-id",
type: "post"
)
print(response)Response: DeleteReactionResponse
Parameters
Path Parameters:
id(String) (required)type(String) (required)
Query Parameters:
userID(String)
getReactions
Retrieves all reactions associated with a specific message, allowing users to view collective feedback or expressions from the chat participants.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.getReactions(
id: "example-id"
)
print(response)Response: GetReactionsResponse
Parameters
Path Parameters:
id(String) (required)
Query Parameters:
limit(Int)offset(Int)
queryReactions
Fetches specific reactions based on given criteria, enabling users to filter and analyze reactions for insights or moderation.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryReactions(
request: .init(
filter: [:],
limit: 1
)
)
print(response)Response: QueryReactionsResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
filter([String: Any]): Filter to apply to the querylimit(Int)next(String)prev(String)sort([SortParamRequest]): Array of sort parameters
translateMessage
Converts a message into a different language, facilitating communication between users who speak different languages.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.translateMessage(
request: .init(
language: "example_value"
)
)
print(response)Response: MessageActionResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
language(String) (required): Language to translate message to
castPollVote
Allows a user to submit their vote in a poll, enabling participation and engagement in decision-making processes.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.castPollVote(
request: .init(
vote: "example_value"
)
)
print(response)Response: PollVoteResponse
Parameters
Path Parameters:
messageID(String) (required)pollID(String) (required)
Request Body:
vote(VoteData): Vote data
deletePollVote
Removes a user's vote from a poll, providing flexibility to change decisions or correct voting errors.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.deletePollVote(
messageID: "message-789",
pollID: "example_value",
voteID: "example_value"
)
print(response)Response: PollVoteResponse
Parameters
Path Parameters:
messageID(String) (required)pollID(String) (required)voteID(String) (required)
Query Parameters:
userID(String)
createReminder
Sets up a reminder for a specific event or task, helping users stay organized and remember important dates or activities.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.createReminder(
request: .init(
remindAt: 1.0
)
)
print(response)Response: ReminderResponseData
Parameters
Path Parameters:
messageID(String) (required)
Request Body:
remindAt(Double)
updateReminder
Modifies an existing reminder, allowing users to adjust details or schedules to accommodate changes in plans.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.updateReminder(
request: .init(
remindAt: 1.0
)
)
print(response)Response: UpdateReminderResponse
Parameters
Path Parameters:
messageID(String) (required)
Request Body:
remindAt(Double)
deleteReminder
Removes an existing reminder, useful for clearing completed tasks or canceling unnecessary notifications.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.deleteReminder(
messageID: "message-789"
)
print(response)Response: DeleteReminderResponse
Parameters
Path Parameters:
messageID(String) (required)
getReplies
Retrieve all replies to a specific message, useful for following a conversation thread within a chat.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.getReplies(
parentID: "example_value"
)
print(response)Response: GetRepliesResponse
Parameters
Path Parameters:
parentID(String) (required)
Query Parameters:
sort([SortParamRequest])limit(Int)idGte(String)idGt(String)idLte(String)idLt(String)idAround(String)
queryMessageFlags
Check the flags associated with messages, helping to identify and manage content that requires moderation or attention.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryMessageFlags()
print(response)Response: QueryMessageFlagsResponse
Parameters
Query Parameters:
payload()
muteChannel
Temporarily silence notifications from a specific channel, ideal for minimizing distractions without leaving the conversation.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.muteChannel(
request: .init(
channelCids: ["id-1", "id-2"],
expiration: 1
)
)
print(response)Response: MuteChannelResponse
Parameters
Request Body:
channelCids([String]): Channel CIDs to mute (if multiple channels)expiration(Int): Duration of mute in milliseconds
unmuteChannel
Re-enable notifications for a previously muted channel, allowing you to stay updated on new messages.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.unmuteChannel(
request: .init(
channelCids: ["id-1", "id-2"],
expiration: 1
)
)
print(response)Response: UnmuteResponse
Parameters
Request Body:
channelCids([String]): Channel CIDs to mute (if multiple channels)expiration(Int): Duration of mute in milliseconds
queryBannedUsers
List the users who have been banned from a chat, useful for managing community access and enforcing rules.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryBannedUsers()
print(response)Response: QueryBannedUsersResponse
Parameters
Query Parameters:
payload()
queryFutureChannelBans
View scheduled bans for a channel, helping you anticipate and manage upcoming restrictions on user access.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryFutureChannelBans()
print(response)Response: QueryFutureChannelBansResponse
Parameters
Query Parameters:
payload()
queryReminders
Access a list of reminders set within the chat, ensuring you don't miss important events or tasks.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryReminders(
request: .init(
filter: [:],
limit: 1
)
)
print(response)Response: QueryRemindersResponse
Parameters
Request Body:
filter([String: Any]): Filter to apply to the querylimit(Int)next(String)prev(String)sort([SortParamRequest]): Array of sort parameters
search
Look for specific messages across channels using keywords, enabling you to quickly find relevant information or past conversations.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.search()
print(response)Response: SearchResponse
Parameters
Query Parameters:
payload()
sync
Sync ensures that your local data is up-to-date with the server, providing you with the latest information and changes, which is essential for maintaining data accuracy across devices.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.sync(
request: .init(
channelCids: ["id-1", "id-2"],
lastSyncAt: 1.0
)
)
print(response)Response: SyncResponse
Parameters
Query Parameters:
withInaccessibleCids(Bool)watch(Bool)connectionID(String)
Request Body:
channelCids([String]) (required): List of channel CIDs to synclastSyncAt(Double) (required): Date from which synchronization should happen
queryThreads
Search and filter chat threads based on specific criteria, enabling efficient navigation and management of conversation histories.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.queryThreads(
request: .init(
filter: [:],
limit: 1
)
)
print(response)Response: QueryThreadsResponse
Parameters
Query Parameters:
connectionID(String)
Request Body:
filter([String: Any]): Filter to apply to the querylimit(Int)memberLimit(Int)next(String)participantLimit(Int): Limit the number of participants returned per each threadprev(String)replyLimit(Int): Limit the number of replies returned per each threadsort([SortParamRequest]): Array of sort parameterswatch(Bool): Start watching the channel this thread belongs to
getThread
Retrieve detailed information about a specific chat thread, useful for reviewing conversation content or metadata.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.getThread(
messageID: "message-789"
)
print(response)Response: GetThreadResponse
Parameters
Path Parameters:
messageID(String) (required)
Query Parameters:
watch(Bool)connectionID(String)replyLimit(Int)participantLimit(Int)memberLimit(Int)
updateThreadPartial
Make selective updates to a chat thread without altering its entire content, useful for modifying specific details or attributes.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.updateThreadPartial(
request: .init(
set: [:],
unset: ["value1", "value2"]
)
)
print(response)Response: UpdateThreadPartialResponse
Parameters
Path Parameters:
messageID(String) (required)
Request Body:
set([String: Any]): Sets new field valuesunset([String]): Array of field names to unset
unreadCounts
Check the number of unread messages in chat threads, helping users stay informed about new activity and prioritize responses.
Example
import StreamChat
let config = ChatClientConfig(apiKeyString: "<your_api_key>")
let client = ChatClient(config: config)
let userInfo = UserInfo(id: "john", name: "John")
try await client.connectUser(userInfo: userInfo, token: .development(userId: "john"))
let response = try await client.unreadCounts()
print(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.
struct Attachment {
var actions: [Action]?
var assetURL: String?
var authorIcon: String?
var authorLink: String?
var authorName: String?
var color: String?
var custom: [String: Any]
var fallback: String?
var fields: [Field]?
var footer: String?
var footerIcon: String?
var giphy: Images?
var imageURL: String?
var ogScrapeURL: String?
var originalHeight: Int?
var originalWidth: Int?
var pretext: String?
var text: String?
var thumbURL: String?
var title: String?
var titleLink: String?
var type: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | [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 | Int | No | |
| original_width | Int | 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
struct BanResponse {
var bannedBy: UserResponse?
var channel: ChannelResponse?
var createdAt: Double
var expires: Double?
var reason: String?
var shadow: Bool?
var user: UserResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | |
| banned_by | UserResponse | No | |
| channel | ChannelResponse | No | |
| expires | Double | No | |
| reason | String | No | |
| shadow | Bool | No | |
| user | UserResponse | No |
ChannelConfig
Channel configuration overrides
struct ChannelConfig {
var blocklist: String?
var blocklistBehavior: String /* flag | block */?
var chatPreferences: ChatPreferences?
var commands: [String]?
var grants: [String: Any]?
var maxMessageLength: Int?
var pushLevel: String /* all | all_mentions | mentions | direct_mentions | none */?
var quotes: Bool?
var reactions: Bool?
var replies: Bool?
var typingEvents: Bool?
var uploads: Bool?
var urlEnrichment: Bool?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklist | String | No | |
| blocklist_behavior | String /* flag | block */ | No |
| chat_preferences | ChatPreferences | No | |
| commands | [String] | No | List of commands that channel supports |
| grants | [String: Any] | No | |
| max_message_length | Int | No | Overrides max message length |
| push_level | String /* all | all_mentions | mentions |
| quotes | Bool | No | Enables message quotes |
| reactions | Bool | No | Enables or disables reactions |
| replies | Bool | No | Enables message replies (threads) |
| typing_events | Bool | No | Enables or disables typing events |
| uploads | Bool | No | Enables or disables file uploads |
| url_enrichment | Bool | No | Enables or disables URL enrichment |
ChannelInput
struct ChannelInput {
var autoTranslationEnabled: Bool?
var autoTranslationLanguage: String?
var configOverrides: ChannelConfig?
var createdBy: UserRequest?
var createdByID: String?
var custom: [String: Any]?
var disabled: Bool?
var filterTags: [String]?
var frozen: Bool?
var invites: [ChannelMemberRequest]?
var members: [ChannelMemberRequest]?
var team: String?
var truncatedByID: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | Bool | 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 | [String: Any] | No | |
| disabled | Bool | No | |
| filter_tags | [String] | No | |
| frozen | Bool | 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
struct ChannelInputRequest {
var autoTranslationEnabled: Bool?
var autoTranslationLanguage: String?
var configOverrides: ConfigOverridesRequest?
var createdBy: UserRequest?
var custom: [String: Any]?
var disabled: Bool?
var frozen: Bool?
var invites: [ChannelMemberRequest]?
var members: [ChannelMemberRequest]?
var team: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | Bool | No | |
| auto_translation_language | String | No | |
| config_overrides | ConfigOverridesRequest | No | |
| created_by | UserRequest | No | |
| custom | [String: Any] | No | |
| disabled | Bool | No | |
| frozen | Bool | No | |
| invites | [ChannelMemberRequest] | No | |
| members | [ChannelMemberRequest] | No | |
| team | String | No |
ChannelMemberRequest
struct ChannelMemberRequest {
var channelRole: String?
var custom: [String: Any]?
var user: UserResponse?
var userID: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| user_id | String | Yes | |
| channel_role | String | No | Role of the member in the channel |
| custom | [String: Any] | No | |
| user | UserResponse | No |
ChannelMemberResponse
struct ChannelMemberResponse {
var archivedAt: Double?
var banExpires: Double?
var banned: Bool
var channelRole: String
var createdAt: Double
var custom: [String: Any]
var deletedAt: Double?
var deletedMessages: [String]?
var inviteAcceptedAt: Double?
var inviteRejectedAt: Double?
var invited: Bool?
var isModerator: Bool?
var notificationsMuted: Bool
var pinnedAt: Double?
var role: String?
var shadowBanned: Bool
var status: String?
var updatedAt: Double
var user: UserResponse?
var userID: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | Bool | Yes | Whether member is banned this channel or not |
| channel_role | String | Yes | Role of the member in the channel |
| created_at | Double | Yes | Date/time of creation |
| custom | [String: Any] | Yes | |
| notifications_muted | Bool | Yes | |
| shadow_banned | Bool | Yes | Whether member is shadow banned in this channel or not |
| updated_at | Double | Yes | Date/time of the last update |
| archived_at | Double | No | |
| ban_expires | Double | No | Expiration date of the ban |
| deleted_at | Double | No | |
| deleted_messages | [String] | No | |
| invite_accepted_at | Double | No | Date when invite was accepted |
| invite_rejected_at | Double | No | Date when invite was rejected |
| invited | Bool | No | Whether member was invited or not |
| is_moderator | Bool | No | Whether member is channel moderator or not |
| pinned_at | Double | No | |
| role | String | No | Permission level of the member in the channel (DEPRECATED: use channel_role i... |
| status | String | No | |
| user | UserResponse | No | |
| user_id | String | No |
ChannelMute
struct ChannelMute {
var channel: ChannelResponse?
var createdAt: Double
var expires: Double?
var updatedAt: Double
var user: UserResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | Date/time of creation |
| updated_at | Double | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel that is muted |
| expires | Double | No | Date/time of mute expiration |
| user | UserResponse | No | Owner of channel mute |
ChannelPushPreferencesResponse
struct ChannelPushPreferencesResponse {
var chatLevel: String?
var chatPreferences: ChatPreferencesResponse?
var disabledUntil: Double?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| chat_level | String | No | |
| chat_preferences | ChatPreferencesResponse | No | |
| disabled_until | Double | No |
ChannelResponse
Represents channel in chat
struct ChannelResponse {
var autoTranslationEnabled: Bool?
var autoTranslationLanguage: String?
var blocked: Bool?
var cid: String
var config: ChannelConfigWithInfo?
var cooldown: Int?
var createdAt: Double
var createdBy: UserResponse?
var custom: [String: Any]
var deletedAt: Double?
var disabled: Bool
var filterTags: [String]?
var frozen: Bool
var hidden: Bool?
var hideMessagesBefore: Double?
var id: String
var lastMessageAt: Double?
var memberCount: Int?
var members: [ChannelMemberResponse]?
var messageCount: Int?
var muteExpiresAt: Double?
var muted: Bool?
var ownCapabilities: [ChannelOwnCapability]?
var team: String?
var truncatedAt: Double?
var truncatedBy: UserResponse?
var type: String
var updatedAt: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | String | Yes | Channel CID (<type>:<id>) |
| created_at | Double | Yes | Date/time of creation |
| custom | [String: Any] | Yes | Custom data for this object |
| disabled | Bool | Yes | |
| frozen | Bool | Yes | Whether channel is frozen or not |
| id | String | Yes | Channel unique ID |
| type | String | Yes | Type of the channel |
| updated_at | Double | Yes | Date/time of the last update |
| auto_translation_enabled | Bool | No | Whether auto translation is enabled or not |
| auto_translation_language | String | No | Language to translate to when auto translation is active |
| blocked | Bool | No | Whether this channel is blocked by current user or not |
| config | ChannelConfigWithInfo | No | Channel configuration |
| cooldown | Int | No | Cooldown period after sending each message |
| created_by | UserResponse | No | Creator of the channel |
| deleted_at | Double | No | Date/time of deletion |
| filter_tags | [String] | No | List of filter tags associated with the channel |
| hidden | Bool | No | Whether this channel is hidden by current user or not |
| hide_messages_before | Double | No | Date since when the message history is accessible |
| last_message_at | Double | No | Date of the last message sent |
| member_count | Int | No | Number of members in the channel |
| members | [ChannelMemberResponse] | No | List of channel members (max 100) |
| message_count | Int | No | Number of messages in the channel |
| mute_expires_at | Double | No | Date of mute expiration |
| muted | Bool | 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 | Double | No | Date of the latest truncation of the channel |
| truncated_by | UserResponse | No |
ChannelStateResponse
struct ChannelStateResponse {
var activeLiveLocations: [SharedLocationResponseData]?
var channel: ChannelResponse?
var draft: DraftResponse?
var duration: String
var hidden: Bool?
var hideMessagesBefore: Double?
var members: [ChannelMemberResponse]
var membership: ChannelMemberResponse?
var messages: [MessageResponse]
var pendingMessages: [PendingMessageResponse]?
var pinnedMessages: [MessageResponse]
var pushPreferences: ChannelPushPreferencesResponse?
var read: [ReadStateResponse]?
var threads: [ThreadStateResponse]
var watcherCount: Int?
var 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 | Bool | No | |
| hide_messages_before | Double | No | |
| membership | ChannelMemberResponse | No | |
| pending_messages | [PendingMessageResponse] | No | |
| push_preferences | ChannelPushPreferencesResponse | No | |
| read | [ReadStateResponse] | No | |
| watcher_count | Int | No | |
| watchers | [UserResponse] | No |
ChannelStateResponseFields
struct ChannelStateResponseFields {
var activeLiveLocations: [SharedLocationResponseData]?
var channel: ChannelResponse?
var draft: DraftResponse?
var hidden: Bool?
var hideMessagesBefore: Double?
var members: [ChannelMemberResponse]
var membership: ChannelMemberResponse?
var messages: [MessageResponse]
var pendingMessages: [PendingMessageResponse]?
var pinnedMessages: [MessageResponse]
var pushPreferences: ChannelPushPreferencesResponse?
var read: [ReadStateResponse]?
var threads: [ThreadStateResponse]
var watcherCount: Int?
var 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 | Bool | No | Whether this channel is hidden or not |
| hide_messages_before | Double | 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 | Int | No | Number of channel watchers |
| watchers | [UserResponse] | No | List of user who is watching the channel |
ConfigOverridesRequest
Channel configuration overrides
struct ConfigOverridesRequest {
var blocklist: String?
var blocklistBehavior: String /* flag | block */?
var chatPreferences: ChatPreferences?
var commands: [String]?
var countMessages: Bool?
var grants: [String: Any]?
var maxMessageLength: Int?
var pushLevel: String /* all | all_mentions | mentions | direct_mentions | none */?
var quotes: Bool?
var reactions: Bool?
var replies: Bool?
var sharedLocations: Bool?
var typingEvents: Bool?
var uploads: Bool?
var urlEnrichment: Bool?
var userMessageReminders: Bool?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklist | String | No | Blocklist name |
| blocklist_behavior | String /* flag | block */ | No |
| chat_preferences | ChatPreferences | No | |
| commands | [String] | No | List of available commands |
| count_messages | Bool | No | Enable/disable message counting |
| grants | [String: Any] | No | Permission grants modifiers |
| max_message_length | Int | No | Maximum message length |
| push_level | String /* all | all_mentions | mentions |
| quotes | Bool | No | Enable/disable quotes |
| reactions | Bool | No | Enable/disable reactions |
| replies | Bool | No | Enable/disable replies |
| shared_locations | Bool | No | Enable/disable shared locations |
| typing_events | Bool | No | Enable/disable typing events |
| uploads | Bool | No | Enable/disable uploads |
| url_enrichment | Bool | No | Enable/disable URL enrichment |
| user_message_reminders | Bool | No | Enable/disable user message reminders |
CreateDraftResponse
Basic response information
struct CreateDraftResponse {
var draft: DraftResponse
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| draft | DraftResponse | Yes | |
| duration | String | Yes | Duration of the request in milliseconds |
Data
struct Data {
var id: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes |
DeleteChannelResponse
Basic response information
struct DeleteChannelResponse {
var channel: ChannelResponse?
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| channel | ChannelResponse | No |
DeleteChannelsResponse
struct DeleteChannelsResponse {
var duration: String
var result: [String: Any]?
var taskID: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| result | [String: Any] | No | Map of channel IDs and their deletion results |
| task_id | String | No |
DeleteMessageResponse
Basic response information
struct DeleteMessageResponse {
var duration: String
var message: MessageResponse
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes |
DeleteReactionResponse
Basic response information
struct DeleteReactionResponse {
var duration: String
var message: MessageResponse
var 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
struct DeleteReminderResponse {
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
DeliveredMessagePayload
struct DeliveredMessagePayload {
var cid: String?
var id: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | String | No | |
| id | String | No |
DraftResponse
struct DraftResponse {
var channel: ChannelResponse?
var channelCid: String
var createdAt: Double
var message: DraftPayloadResponse
var parentID: String?
var parentMessage: MessageResponse?
var quotedMessage: MessageResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | String | Yes | |
| created_at | Double | Yes | |
| message | DraftPayloadResponse | Yes | |
| channel | ChannelResponse | No | |
| parent_id | String | No | |
| parent_message | MessageResponse | No | |
| quoted_message | MessageResponse | No |
EventRequest
struct EventRequest {
var custom: [String: Any]?
var parentID: String?
var type: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | String | Yes | |
| custom | [String: Any] | No | |
| parent_id | String | No |
EventResponse
Basic response information
struct EventResponse {
var duration: String
var event: WSEvent
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| event | WSEvent | Yes |
FutureChannelBanResponse
struct FutureChannelBanResponse {
var bannedBy: UserResponse?
var createdAt: Double
var expires: Double?
var reason: String?
var shadow: Bool?
var user: UserResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | |
| banned_by | UserResponse | No | |
| expires | Double | No | |
| reason | String | No | |
| shadow | Bool | No | |
| user | UserResponse | No |
GetDraftResponse
Basic response information
struct GetDraftResponse {
var draft: DraftResponse
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| draft | DraftResponse | Yes | |
| duration | String | Yes | Duration of the request in milliseconds |
GetManyMessagesResponse
struct GetManyMessagesResponse {
var duration: String
var messages: [MessageResponse]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| messages | [MessageResponse] | Yes | List of messages |
GetMessageResponse
Basic response information
struct GetMessageResponse {
var duration: String
var message: MessageWithChannelResponse
var pendingMessageMetadata: [String: Any]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| message | MessageWithChannelResponse | Yes | |
| pending_message_metadata | [String: Any] | No |
GetReactionsResponse
struct GetReactionsResponse {
var duration: String
var reactions: [ReactionResponse]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| reactions | [ReactionResponse] | Yes | List of reactions |
GetRepliesResponse
Basic response information
struct GetRepliesResponse {
var duration: String
var messages: [MessageResponse]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| messages | [MessageResponse] | Yes |
GetThreadResponse
struct GetThreadResponse {
var duration: String
var thread: ThreadStateResponse
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| thread | ThreadStateResponse | Yes | Enriched thread state |
HideChannelResponse
Basic response information
struct HideChannelResponse {
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
ImageSize
struct ImageSize {
var crop: String?
var height: Int?
var resize: String?
var width: Int?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| crop | String | No | Crop mode. One of: top, bottom, left, right, center |
| height | Int | No | Target image height |
| resize | String | No | Resize method. One of: clip, crop, scale, fill |
| width | Int | No | Target image width |
MarkDeliveredResponse
Basic response information
struct MarkDeliveredResponse {
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
MarkReadResponse
struct MarkReadResponse {
var duration: String
var event: MarkReadResponseEvent?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| event | MarkReadResponseEvent | No | Mark read event |
MarkReadResponseEvent
struct MarkReadResponseEvent {
var channel: ChannelResponse?
var channelID: String
var channelLastMessageAt: Double?
var channelType: String
var cid: String
var createdAt: Double
var lastReadMessageID: String?
var team: String?
var thread: ThreadResponse?
var type: String
var user: UserResponseCommonFields?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_id | String | Yes | |
| channel_type | String | Yes | |
| cid | String | Yes | |
| created_at | Double | Yes | |
| type | String | Yes | |
| channel | ChannelResponse | No | |
| channel_last_message_at | Double | No | |
| last_read_message_id | String | No | |
| team | String | No | |
| thread | ThreadResponse | No | |
| user | UserResponseCommonFields | No |
MembersResponse
struct MembersResponse {
var duration: String
var members: [ChannelMemberResponse]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| members | [ChannelMemberResponse] | Yes | List of found members |
MessageActionResponse
Basic response information
struct MessageActionResponse {
var duration: String
var message: MessageResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| message | MessageResponse | No |
MessageFlagResponse
struct MessageFlagResponse {
var approvedAt: Double?
var createdAt: Double
var createdByAutomod: Bool
var custom: [String: Any]?
var details: FlagDetailsResponse?
var message: MessageResponse?
var moderationFeedback: FlagFeedbackResponse?
var moderationResult: MessageModerationResult?
var reason: String?
var rejectedAt: Double?
var reviewedAt: Double?
var reviewedBy: UserResponse?
var updatedAt: Double
var user: UserResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | |
| created_by_automod | Bool | Yes | |
| updated_at | Double | Yes | |
| approved_at | Double | No | |
| custom | [String: Any] | No | |
| details | FlagDetailsResponse | No | |
| message | MessageResponse | No | |
| moderation_feedback | FlagFeedbackResponse | No | |
| moderation_result | MessageModerationResult | No | |
| reason | String | No | |
| rejected_at | Double | No | |
| reviewed_at | Double | No | |
| reviewed_by | UserResponse | No | |
| user | UserResponse | No |
MessagePaginationParams
struct MessagePaginationParams {
var createdAtAfter: Double?
var createdAtAfterOrEqual: Double?
var createdAtAround: Double?
var createdAtBefore: Double?
var createdAtBeforeOrEqual: Double?
var idAround: String?
var idGt: String?
var idGte: String?
var idLt: String?
var idLte: String?
var limit: Int?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at_after | Double | No | The timestamp to get messages with a created_at timestamp greater than |
| created_at_after_or_equal | Double | No | The timestamp to get messages with a created_at timestamp greater than or equ... |
| created_at_around | Double | No | The result will be a set of messages, that are both older and newer than the ... |
| created_at_before | Double | No | The timestamp to get messages with a created_at timestamp smaller than |
| created_at_before_or_equal | Double | 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 | Int | No | The maximum number of messages to return (max limit |
MessageRequest
Message data for creating or updating a message
struct MessageRequest {
var attachments: [Attachment]?
var custom: [String: Any]?
var id: String?
var mentionedChannel: Bool?
var mentionedGroupIds: [String]?
var mentionedHere: Bool?
var mentionedRoles: [String]?
var mentionedUsers: [String]?
var mml: String?
var parentID: String?
var pinExpires: Double?
var pinned: Bool?
var pinnedAt: String?
var pollID: String?
var quotedMessageID: String?
var restrictedVisibility: [String]?
var sharedLocation: SharedLocation?
var showInChannel: Bool?
var silent: Bool?
var text: String?
var type: String /* '' | regular | system */?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | [Attachment] | No | Array of message attachments |
| custom | [String: Any] | No | |
| id | String | No | Message ID is unique string identifier of the message |
| mentioned_channel | Bool | No | |
| mentioned_group_ids | [String] | No | List of user group IDs to mention. Group members who are also channel members... |
| mentioned_here | Bool | No | |
| mentioned_roles | [String] | No | |
| mentioned_users | [String] | No | Array of user IDs to mention |
| mml | String | No | Should be empty if text is provided. Can only be set when using server-side... |
| parent_id | String | No | ID of parent message (thread) |
| pin_expires | Double | No | Date when pinned message expires |
| pinned | Bool | No | Whether message is pinned or not |
| pinned_at | String | No | Date when message got pinned |
| poll_id | String | No | Identifier of the poll to include in the message |
| quoted_message_id | String | No | |
| restricted_visibility | [String] | No | A list of user ids that have restricted visibility to the message |
| shared_location | SharedLocation | No | Contains shared location data |
| show_in_channel | Bool | No | Whether thread reply should be shown in the channel as well |
| silent | Bool | No | Whether message is silent or not |
| text | String | No | Text of the message. Should be empty if mml is provided |
| type | String /* '' | regular | system */ |
MessageResponse
Represents any chat message
struct MessageResponse {
var attachments: [Attachment]
var cid: String
var command: String?
var createdAt: Double
var custom: [String: Any]
var deletedAt: Double?
var deletedForMe: Bool?
var deletedReplyCount: Int
var draft: DraftResponse?
var html: String
var i18n: [String: Any]?
var id: String
var imageLabels: [String: Any]?
var latestReactions: [ReactionResponse]
var member: ChannelMemberResponse?
var mentionedChannel: Bool
var mentionedGroupIds: [String]?
var mentionedHere: Bool
var mentionedRoles: [String]?
var mentionedUsers: [UserResponse]
var messageTextUpdatedAt: Double?
var mml: String?
var moderation: ModerationV2Response?
var ownReactions: [ReactionResponse]
var parentID: String?
var pinExpires: Double?
var pinned: Bool
var pinnedAt: Double?
var pinnedBy: UserResponse?
var poll: PollResponseData?
var pollID: String?
var quotedMessage: MessageResponse?
var quotedMessageID: String?
var reactionCounts: [String: Any]
var reactionGroups: [String: Any]?
var reactionScores: [String: Any]
var reminder: ReminderResponseData?
var replyCount: Int
var restrictedVisibility: [String]
var shadowed: Bool
var sharedLocation: SharedLocationResponseData?
var showInChannel: Bool?
var silent: Bool
var text: String
var threadParticipants: [UserResponse]?
var type: String
var updatedAt: Double
var 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 | Double | Yes | Date/time of creation |
| custom | [String: Any] | Yes | |
| deleted_reply_count | Int | Yes | |
| html | String | Yes | Contains HTML markup of the message. Can only be set when using server-side API |
| id | String | Yes | Message ID is unique string identifier of the message |
| latest_reactions | [ReactionResponse] | Yes | List of 10 latest reactions to this message |
| mentioned_channel | Bool | Yes | Whether the message mentioned the channel tag |
| mentioned_here | Bool | Yes | Whether the message mentioned online users with @here tag |
| mentioned_users | [UserResponse] | Yes | List of mentioned users |
| own_reactions | [ReactionResponse] | Yes | List of 10 latest reactions of authenticated user to this message |
| pinned | Bool | Yes | Whether message is pinned or not |
| reaction_counts | [String: Any] | Yes | An object containing number of reactions of each type. Key: reaction type (st... |
| reaction_scores | [String: Any] | Yes | An object containing scores of reactions of each type. Key: reaction type (st... |
| reply_count | Int | 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 | Bool | Yes | Whether the message was shadowed or not |
| silent | Bool | Yes | Whether message is silent or not |
| text | String | Yes | Text of the message. Should be empty if mml is provided |
| type | String | Yes | Contains type of the message. One of: regular, ephemeral, error, reply, syste... |
| updated_at | Double | 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 | Double | No | Date/time of deletion |
| deleted_for_me | Bool | No | |
| draft | DraftResponse | No | |
| i18n | [String: Any] | No | Object with translations. Key language contains the original language key. ... |
| image_labels | [String: Any] | No | Contains image moderation information |
| member | ChannelMemberResponse | No | Channel member data for the message sender including only the channel_role |
| mentioned_group_ids | [String] | No | List of user group IDs mentioned in the message. Group members who are also c... |
| mentioned_roles | [String] | No | List of roles mentioned in the message (e.g. admin, channel_moderator, custom... |
| message_text_updated_at | Double | 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 | Double | No | Date when pinned message expires |
| pinned_at | Double | 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 | [String: Any] | No | |
| reminder | ReminderResponseData | No | |
| shared_location | SharedLocationResponseData | No | Contains shared location data |
| show_in_channel | Bool | 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
struct MessageWithChannelResponse {
var attachments: [Attachment]
var channel: ChannelResponse
var cid: String
var command: String?
var createdAt: Double
var custom: [String: Any]
var deletedAt: Double?
var deletedForMe: Bool?
var deletedReplyCount: Int
var draft: DraftResponse?
var html: String
var i18n: [String: Any]?
var id: String
var imageLabels: [String: Any]?
var latestReactions: [ReactionResponse]
var member: ChannelMemberResponse?
var mentionedChannel: Bool
var mentionedGroupIds: [String]?
var mentionedHere: Bool
var mentionedRoles: [String]?
var mentionedUsers: [UserResponse]
var messageTextUpdatedAt: Double?
var mml: String?
var moderation: ModerationV2Response?
var ownReactions: [ReactionResponse]
var parentID: String?
var pinExpires: Double?
var pinned: Bool
var pinnedAt: Double?
var pinnedBy: UserResponse?
var poll: PollResponseData?
var pollID: String?
var quotedMessage: MessageResponse?
var quotedMessageID: String?
var reactionCounts: [String: Any]
var reactionGroups: [String: Any]?
var reactionScores: [String: Any]
var reminder: ReminderResponseData?
var replyCount: Int
var restrictedVisibility: [String]
var shadowed: Bool
var sharedLocation: SharedLocationResponseData?
var showInChannel: Bool?
var silent: Bool
var text: String
var threadParticipants: [UserResponse]?
var type: String
var updatedAt: Double
var 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 | Double | Yes | Date/time of creation |
| custom | [String: Any] | Yes | |
| deleted_reply_count | Int | Yes | |
| html | String | Yes | Contains HTML markup of the message. Can only be set when using server-side API |
| id | String | Yes | Message ID is unique string identifier of the message |
| latest_reactions | [ReactionResponse] | Yes | List of 10 latest reactions to this message |
| mentioned_channel | Bool | Yes | Whether the message mentioned the channel tag |
| mentioned_here | Bool | Yes | Whether the message mentioned online users with @here tag |
| mentioned_users | [UserResponse] | Yes | List of mentioned users |
| own_reactions | [ReactionResponse] | Yes | List of 10 latest reactions of authenticated user to this message |
| pinned | Bool | Yes | Whether message is pinned or not |
| reaction_counts | [String: Any] | Yes | An object containing number of reactions of each type. Key: reaction type (st... |
| reaction_scores | [String: Any] | Yes | An object containing scores of reactions of each type. Key: reaction type (st... |
| reply_count | Int | 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 | Bool | Yes | Whether the message was shadowed or not |
| silent | Bool | Yes | Whether message is silent or not |
| text | String | Yes | Text of the message. Should be empty if mml is provided |
| type | String | Yes | Contains type of the message. One of: regular, ephemeral, error, reply, syste... |
| updated_at | Double | 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 | Double | No | Date/time of deletion |
| deleted_for_me | Bool | No | |
| draft | DraftResponse | No | |
| i18n | [String: Any] | No | Object with translations. Key language contains the original language key. ... |
| image_labels | [String: Any] | No | Contains image moderation information |
| member | ChannelMemberResponse | No | Channel member data for the message sender including only the channel_role |
| mentioned_group_ids | [String] | No | List of user group IDs mentioned in the message. Group members who are also c... |
| mentioned_roles | [String] | No | List of roles mentioned in the message (e.g. admin, channel_moderator, custom... |
| message_text_updated_at | Double | 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 | Double | No | Date when pinned message expires |
| pinned_at | Double | 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 | [String: Any] | No | |
| reminder | ReminderResponseData | No | |
| shared_location | SharedLocationResponseData | No | Contains shared location data |
| show_in_channel | Bool | No | Whether thread reply should be shown in the channel as well |
| thread_participants | [UserResponse] | No | List of users who participate in thread |
MuteChannelResponse
struct MuteChannelResponse {
var channelMute: ChannelMute?
var channelMutes: [ChannelMute]?
var duration: String
var ownUser: OwnUserResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| channel_mute | ChannelMute | No | Object with channel mute (if one channel was muted) |
| channel_mutes | [ChannelMute] | No | Object with mutes (if multiple channels were muted) |
| own_user | OwnUserResponse | No | Authorized user object with fresh mutes information |
OnlyUserID
struct OnlyUserID {
var id: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes |
OwnUserResponse
struct OwnUserResponse {
var avgResponseTime: Int?
var banned: Bool
var blockedUserIds: [String]?
var channelMutes: [ChannelMute]
var createdAt: Double
var custom: [String: Any]
var deactivatedAt: Double?
var deletedAt: Double?
var devices: [DeviceResponse]
var id: String
var image: String?
var invisible: Bool
var language: String
var lastActive: Double?
var latestHiddenChannels: [String]?
var mutes: [UserMuteResponse]
var name: String?
var online: Bool
var privacySettings: PrivacySettingsResponse?
var pushPreferences: PushPreferencesResponse?
var revokeTokensIssuedBefore: Double?
var role: String
var teams: [String]
var teamsRole: [String: Any]?
var totalUnreadCount: Int
var totalUnreadCountByTeam: [String: Any]?
var unreadChannels: Int
var unreadCount: Int
var unreadThreads: Int
var updatedAt: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | Bool | Yes | |
| channel_mutes | [ChannelMute] | Yes | |
| created_at | Double | Yes | |
| custom | [String: Any] | Yes | |
| devices | [DeviceResponse] | Yes | |
| id | String | Yes | |
| invisible | Bool | Yes | |
| language | String | Yes | |
| mutes | [UserMuteResponse] | Yes | |
| online | Bool | Yes | |
| role | String | Yes | |
| teams | [String] | Yes | |
| total_unread_count | Int | Yes | |
| unread_channels | Int | Yes | |
| unread_count | Int | Yes | |
| unread_threads | Int | Yes | |
| updated_at | Double | Yes | |
| avg_response_time | Int | No | |
| blocked_user_ids | [String] | No | |
| deactivated_at | Double | No | |
| deleted_at | Double | No | |
| image | String | No | |
| last_active | Double | No | |
| latest_hidden_channels | [String] | No | |
| name | String | No | |
| privacy_settings | PrivacySettingsResponse | No | |
| push_preferences | PushPreferencesResponse | No | |
| revoke_tokens_issued_before | Double | No | |
| teams_role | [String: Any] | No | |
| total_unread_count_by_team | [String: Any] | No |
PaginationParams
struct PaginationParams {
var limit: Int?
var offset: Int?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| limit | Int | No | |
| offset | Int | No |
ParsedPredefinedFilterResponse
struct ParsedPredefinedFilterResponse {
var filter: [String: Any]
var name: String
var sort: [SortParamRequest]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| filter | [String: Any] | Yes | |
| name | String | Yes | |
| sort | [SortParamRequest] | No |
PendingMessageResponse
struct PendingMessageResponse {
var channel: ChannelResponse?
var message: MessageResponse?
var metadata: [String: Any]?
var user: UserResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel | ChannelResponse | No | |
| message | MessageResponse | No | |
| metadata | [String: Any] | No | |
| user | UserResponse | No |
PollResponseData
struct PollResponseData {
var allowAnswers: Bool
var allowUserSuggestedOptions: Bool
var answersCount: Int
var createdAt: Double
var createdBy: UserResponse?
var createdByID: String
var custom: [String: Any]
var description: String
var enforceUniqueVote: Bool
var id: String
var isClosed: Bool?
var latestAnswers: [PollVoteResponseData]
var latestVotesByOption: [String: Any]
var maxVotesAllowed: Int?
var name: String
var options: [PollOptionResponseData]
var ownVotes: [PollVoteResponseData]
var updatedAt: Double
var voteCount: Int
var voteCountsByOption: [String: Any]
var votingVisibility: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| allow_answers | Bool | Yes | |
| allow_user_suggested_options | Bool | Yes | |
| answers_count | Int | Yes | |
| created_at | Double | Yes | |
| created_by_id | String | Yes | |
| custom | [String: Any] | Yes | |
| description | String | Yes | |
| enforce_unique_vote | Bool | Yes | |
| id | String | Yes | |
| latest_answers | [PollVoteResponseData] | Yes | |
| latest_votes_by_option | [String: Any] | Yes | |
| name | String | Yes | |
| options | [PollOptionResponseData] | Yes | |
| own_votes | [PollVoteResponseData] | Yes | |
| updated_at | Double | Yes | |
| vote_count | Int | Yes | |
| vote_counts_by_option | [String: Any] | Yes | |
| voting_visibility | String | Yes | |
| created_by | UserResponse | No | |
| is_closed | Bool | No | |
| max_votes_allowed | Int | No |
PollVoteResponse
struct PollVoteResponse {
var duration: String
var poll: PollResponseData?
var 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
struct PollVoteResponseData {
var answerText: String?
var createdAt: Double
var id: String
var isAnswer: Bool?
var optionID: String
var pollID: String
var updatedAt: Double
var user: UserResponse?
var userID: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | |
| id | String | Yes | |
| option_id | String | Yes | |
| poll_id | String | Yes | |
| updated_at | Double | Yes | |
| answer_text | String | No | |
| is_answer | Bool | No | |
| user | UserResponse | No | |
| user_id | String | No |
QueryBannedUsersResponse
struct QueryBannedUsersResponse {
var bans: [BanResponse]
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| bans | [BanResponse] | Yes | List of found bans |
| duration | String | Yes | Duration of the request in milliseconds |
QueryChannelsResponse
struct QueryChannelsResponse {
var channels: [ChannelStateResponseFields]
var duration: String
var predefinedFilter: ParsedPredefinedFilterResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channels | [ChannelStateResponseFields] | Yes | List of channels |
| duration | String | Yes | Duration of the request in milliseconds |
| predefined_filter | ParsedPredefinedFilterResponse | No | The parsed predefined filter with interpolated values, only present when usin... |
QueryDraftsResponse
struct QueryDraftsResponse {
var drafts: [DraftResponse]
var duration: String
var next: String?
var 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
struct QueryFutureChannelBansResponse {
var bans: [FutureChannelBanResponse]
var 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
struct QueryMessageFlagsResponse {
var duration: String
var 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
struct QueryReactionsResponse {
var duration: String
var next: String?
var prev: String?
var 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
struct QueryRemindersResponse {
var duration: String
var next: String?
var prev: String?
var 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
struct QueryThreadsResponse {
var duration: String
var next: String?
var prev: String?
var 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
struct Reaction {
var activityID: String
var childrenCounts: [String: Any]?
var createdAt: Double
var data: [String: Any]?
var deletedAt: Double?
var id: String?
var kind: String
var latestChildren: [String: Any]?
var moderation: [String: Any]?
var ownChildren: [String: Any]?
var parent: String?
var score: Double?
var targetFeeds: [String]?
var targetFeedsExtraData: [String: Any]?
var updatedAt: Double
var user: User?
var userID: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| activity_id | String | Yes | |
| created_at | Double | Yes | |
| kind | String | Yes | |
| updated_at | Double | Yes | |
| user_id | String | Yes | |
| children_counts | [String: Any] | No | |
| data | [String: Any] | No | |
| deleted_at | Double | No | |
| id | String | No | |
| latest_children | [String: Any] | No | |
| moderation | [String: Any] | No | |
| own_children | [String: Any] | No | |
| parent | String | No | |
| score | Double | No | |
| target_feeds | [String] | No | |
| target_feeds_extra_data | [String: Any] | No | |
| user | User | No |
ReactionRequest
Represents user reaction to a message
struct ReactionRequest {
var createdAt: Double?
var custom: [String: Any]?
var score: Int?
var type: String
var updatedAt: Double?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | String | Yes | The type of reaction (e.g. 'like', 'laugh', 'wow') |
| created_at | Double | No | Date/time of creation |
| custom | [String: Any] | No | |
| score | Int | No | Reaction score. If not specified reaction has score of 1 |
| updated_at | Double | No | Date/time of the last update |
ReactionResponse
struct ReactionResponse {
var createdAt: Double
var custom: [String: Any]
var messageID: String
var score: Int
var type: String
var updatedAt: Double
var user: UserResponse
var userID: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | Date/time of creation |
| custom | [String: Any] | Yes | Custom data for this object |
| message_id | String | Yes | Message ID |
| score | Int | Yes | Score of the reaction |
| type | String | Yes | Type of reaction |
| updated_at | Double | Yes | Date/time of the last update |
| user | UserResponse | Yes | User |
| user_id | String | Yes | User ID |
ReadStateResponse
struct ReadStateResponse {
var lastDeliveredAt: Double?
var lastDeliveredMessageID: String?
var lastRead: Double
var lastReadMessageID: String?
var unreadMessages: Int
var user: UserResponse
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| last_read | Double | Yes | |
| unread_messages | Int | Yes | |
| user | UserResponse | Yes | |
| last_delivered_at | Double | No | |
| last_delivered_message_id | String | No | |
| last_read_message_id | String | No |
ReminderResponseData
struct ReminderResponseData {
var channel: ChannelResponse?
var channelCid: String
var createdAt: Double
var message: MessageResponse?
var messageID: String
var remindAt: Double?
var updatedAt: Double
var user: UserResponse?
var userID: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | String | Yes | |
| created_at | Double | Yes | |
| message_id | String | Yes | |
| updated_at | Double | Yes | |
| user_id | String | Yes | |
| channel | ChannelResponse | No | |
| message | MessageResponse | No | |
| remind_at | Double | No | |
| user | UserResponse | No |
Response
Basic response information
struct Response {
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
SearchResponse
struct SearchResponse {
var duration: String
var next: String?
var previous: String?
var results: [SearchResult]
var resultsWarning: 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
struct SearchResult {
var message: SearchResultMessage?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| message | SearchResultMessage | No | Found message |
SearchWarning
struct SearchWarning {
var channelSearchCids: [String]?
var channelSearchCount: Int?
var warningCode: Int
var warningDescription: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| warning_code | Int | 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 | Int | No | Number of channels searched |
SendMessageResponse
struct SendMessageResponse {
var duration: String
var message: MessageResponse
var pendingMessageMetadata: [String: Any]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | Message response |
| pending_message_metadata | [String: Any] | No | Pending message metadata |
SendReactionResponse
Basic response information
struct SendReactionResponse {
var duration: String
var message: MessageResponse
var reaction: ReactionResponse
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| reaction | ReactionResponse | Yes |
SharedLocation
struct SharedLocation {
var createdByDeviceID: String?
var endAt: Double?
var latitude: Double
var longitude: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| latitude | Double | Yes | |
| longitude | Double | Yes | |
| created_by_device_id | String | No | |
| end_at | Double | No |
SharedLocationResponseData
struct SharedLocationResponseData {
var channel: ChannelResponse?
var channelCid: String
var createdAt: Double
var createdByDeviceID: String
var endAt: Double?
var latitude: Double
var longitude: Double
var message: MessageResponse?
var messageID: String
var updatedAt: Double
var userID: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | String | Yes | |
| created_at | Double | Yes | |
| created_by_device_id | String | Yes | |
| latitude | Double | Yes | |
| longitude | Double | Yes | |
| message_id | String | Yes | |
| updated_at | Double | Yes | |
| user_id | String | Yes | |
| channel | ChannelResponse | No | |
| end_at | Double | No | |
| message | MessageResponse | No |
ShowChannelResponse
Basic response information
struct ShowChannelResponse {
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
SortParamRequest
struct SortParamRequest {
var direction: Int?
var field: String?
var type: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| direction | Int | No | Direction of sorting, 1 for Ascending, -1 for Descending, default is 1. One o... |
| field | String | No | Name of field to sort by |
| type | String | No | Type of field to sort by. Empty string or omitted means string type (default)... |
SyncResponse
Sync response
struct SyncResponse {
var duration: String
var events: [WSEvent]
var inaccessibleCids: [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
struct ThreadResponse {
var activeParticipantCount: Int
var channel: ChannelResponse?
var channelCid: String
var createdAt: Double
var createdBy: UserResponse?
var createdByUserID: String
var custom: [String: Any]
var deletedAt: Double?
var lastMessageAt: Double?
var parentMessage: MessageResponse?
var parentMessageID: String
var participantCount: Int
var replyCount: Int?
var threadParticipants: [ThreadParticipant]?
var title: String
var updatedAt: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_participant_count | Int | Yes | Active Participant Count |
| channel_cid | String | Yes | Channel CID |
| created_at | Double | Yes | Date/time of creation |
| created_by_user_id | String | Yes | Created By User ID |
| custom | [String: Any] | Yes | Custom data for this object |
| parent_message_id | String | Yes | Parent Message ID |
| participant_count | Int | Yes | Participant Count |
| title | String | Yes | Title |
| updated_at | Double | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel |
| created_by | UserResponse | No | Created By User |
| deleted_at | Double | No | Deleted At |
| last_message_at | Double | No | Last Message At |
| parent_message | MessageResponse | No | Parent Message |
| reply_count | Int | No | Reply Count |
| thread_participants | [ThreadParticipant] | No | Thread Participants |
ThreadStateResponse
struct ThreadStateResponse {
var activeParticipantCount: Int
var channel: ChannelResponse?
var channelCid: String
var createdAt: Double
var createdBy: UserResponse?
var createdByUserID: String
var custom: [String: Any]
var deletedAt: Double?
var draft: DraftResponse?
var lastMessageAt: Double?
var latestReplies: [MessageResponse]
var parentMessage: MessageResponse?
var parentMessageID: String
var participantCount: Int
var read: [ReadStateResponse]?
var replyCount: Int?
var threadParticipants: [ThreadParticipant]?
var title: String
var updatedAt: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_participant_count | Int | Yes | Active Participant Count |
| channel_cid | String | Yes | Channel CID |
| created_at | Double | Yes | Date/time of creation |
| created_by_user_id | String | Yes | Created By User ID |
| custom | [String: Any] | Yes | Custom data for this object |
| latest_replies | [MessageResponse] | Yes | |
| parent_message_id | String | Yes | Parent Message ID |
| participant_count | Int | Yes | Participant Count |
| title | String | Yes | Title |
| updated_at | Double | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel |
| created_by | UserResponse | No | Created By User |
| deleted_at | Double | No | Deleted At |
| draft | DraftResponse | No | |
| last_message_at | Double | No | Last Message At |
| parent_message | MessageResponse | No | Parent Message |
| read | [ReadStateResponse] | No | |
| reply_count | Int | No | Reply Count |
| thread_participants | [ThreadParticipant] | No | Thread Participants |
Time
struct Time {
}Timestamp
struct Timestamp {
var time: Double?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| Time | Double | No |
TruncateChannelResponse
struct TruncateChannelResponse {
var channel: ChannelResponse?
var duration: String
var 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
struct UnmuteResponse {
var duration: String
var nonExistingUsers: [String]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| non_existing_users | [String] | No | A list of users that can't be found. Common cause for this is deleted users |
UnreadCountsChannel
struct UnreadCountsChannel {
var channelID: String
var lastRead: Double
var unreadCount: Int
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_id | String | Yes | |
| last_read | Double | Yes | |
| unread_count | Int | Yes |
UnreadCountsChannelType
struct UnreadCountsChannelType {
var channelCount: Int
var channelType: String
var unreadCount: Int
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_count | Int | Yes | |
| channel_type | String | Yes | |
| unread_count | Int | Yes |
UnreadCountsThread
struct UnreadCountsThread {
var lastRead: Double
var lastReadMessageID: String
var parentMessageID: String
var unreadCount: Int
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| last_read | Double | Yes | |
| last_read_message_id | String | Yes | |
| parent_message_id | String | Yes | |
| unread_count | Int | Yes |
UpdateChannelPartialResponse
struct UpdateChannelPartialResponse {
var channel: ChannelResponse?
var duration: String
var 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
struct UpdateChannelResponse {
var channel: ChannelResponse?
var duration: String
var members: [ChannelMemberResponse]
var 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
struct UpdateMemberPartialResponse {
var channelMember: ChannelMemberResponse?
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| channel_member | ChannelMemberResponse | No | Updated channel member |
UpdateMessagePartialResponse
struct UpdateMessagePartialResponse {
var duration: String
var message: MessageResponse?
var pendingMessageMetadata: [String: Any]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| message | MessageResponse | No | Updated message |
| pending_message_metadata | [String: Any] | No | Pending message metadata |
UpdateMessageResponse
Basic response information
struct UpdateMessageResponse {
var duration: String
var message: MessageResponse
var pendingMessageMetadata: [String: Any]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| pending_message_metadata | [String: Any] | No |
UpdateReminderResponse
Basic response information
struct UpdateReminderResponse {
var duration: String
var reminder: ReminderResponseData
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| reminder | ReminderResponseData | Yes |
UpdateThreadPartialResponse
struct UpdateThreadPartialResponse {
var duration: String
var thread: ThreadResponse
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| thread | ThreadResponse | Yes | Updated thread (not enriched) |
UploadChannelFileResponse
struct UploadChannelFileResponse {
var duration: String
var file: String?
var moderationAction: String?
var thumbURL: 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
struct UploadChannelResponse {
var duration: String
var file: String?
var moderationAction: String?
var thumbURL: String?
var uploadSizes: [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
struct User {
var data: [String: Any]?
var id: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes | |
| data | [String: Any] | No |
UserRequest
User request object
struct UserRequest {
var custom: [String: Any]?
var id: String
var image: String?
var invisible: Bool?
var language: String?
var name: String?
var privacySettings: PrivacySettingsResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes | User ID |
| custom | [String: Any] | No | Custom user data |
| image | String | No | User's profile image URL |
| invisible | Bool | No | |
| language | String | No | |
| name | String | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No |
UserResponse
User response object
struct UserResponse {
var avgResponseTime: Int?
var banned: Bool
var blockedUserIds: [String]
var createdAt: Double
var custom: [String: Any]
var deactivatedAt: Double?
var deletedAt: Double?
var id: String
var image: String?
var language: String
var lastActive: Double?
var name: String?
var online: Bool
var revokeTokensIssuedBefore: Double?
var role: String
var teams: [String]
var teamsRole: [String: Any]?
var updatedAt: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | Bool | Yes | Whether a user is banned or not |
| blocked_user_ids | [String] | Yes | |
| created_at | Double | Yes | Date/time of creation |
| custom | [String: Any] | Yes | Custom data for this object |
| id | String | Yes | Unique user identifier |
| language | String | Yes | Preferred language of a user |
| online | Bool | 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 | Double | Yes | Date/time of the last update |
| avg_response_time | Int | No | |
| deactivated_at | Double | No | Date of deactivation |
| deleted_at | Double | No | Date/time of deletion |
| image | String | No | |
| last_active | Double | No | Date of last activity |
| name | String | No | Optional name of user |
| revoke_tokens_issued_before | Double | No | Revocation date for tokens |
| teams_role | [String: Any] | No |
VoteData
struct VoteData {
var answerText: String?
var optionID: 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
struct WSEvent {
}WrappedUnreadCountsResponse
Basic response information
struct WrappedUnreadCountsResponse {
var channelType: [UnreadCountsChannelType]
var channels: [UnreadCountsChannel]
var duration: String
var threads: [UnreadCountsThread]
var totalUnreadCount: Int
var totalUnreadCountByTeam: [String: Any]?
var totalUnreadThreadsCount: Int
}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 | Int | Yes | |
| total_unread_threads_count | Int | Yes | |
| total_unread_count_by_team | [String: Any] | No |