Appearance
Common
About 8114 wordsAbout 27 min
Swift SDK - Chat API
Table of Contents
- getApp
- listBlockLists
- createBlockList
- updateBlockList
- deleteBlockList
- listDevices
- createDevice
- deleteDevice
- createGuest
- longPoll
- getOG
- createPoll
- updatePoll
- queryPolls
- getPoll
- updatePollPartial
- deletePoll
- createPollOption
- updatePollOption
- getPollOption
- deletePollOption
- queryPollVotes
- updatePushNotificationPreferences
- uploadFile
- deleteFile
- uploadImage
- deleteImage
- listUserGroups
- createUserGroup
- searchUserGroups
- getUserGroup
- updateUserGroup
- deleteUserGroup
- addUserGroupMembers
- removeUserGroupMembers
- queryUsers
- updateUsers
- updateUsersPartial
- getBlockedUsers
- blockUsers
- getUserLiveLocations
- updateLiveLocation
- unblockUsers
- Types Reference
getApp
Retrieve the current application settings to understand or verify the configuration. Use this method when you need to view the existing app settings without making changes.
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.getApp()
print(response)Response: GetApplicationResponse
listBlockLists
Get a list of all existing block lists to review or manage them. Use this method when you need an overview of current block lists.
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.listBlockLists()
print(response)Response: ListBlockListResponse
Parameters
Query Parameters:
team(String)
createBlockList
Create a new block list to restrict certain content or users as per your criteria. Use this method when setting up a new block list for moderation or content control.
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.createBlockList(
request: .init(
name: "Example Name",
words: ["value1", "value2"],
isLeetCheckEnabled: true,
isPluralCheckEnabled: true
)
)
print(response)Response: CreateBlockListResponse
Parameters
Request Body:
isLeetCheckEnabled(Bool)isPluralCheckEnabled(Bool)name(String) (required): Block list nameteam(String)type(String): Block list type. One of: regex, domain, domain_allowlist, email, email_allowlist, wordwords([String]) (required): List of words to block
updateBlockList
Modify an existing block list to add or remove entries as needed. Use this method when updating the criteria or contents of a block 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 response = try await client.updateBlockList(
request: .init(
isLeetCheckEnabled: true,
isPluralCheckEnabled: true
)
)
print(response)Response: UpdateBlockListResponse
Parameters
Path Parameters:
name(String) (required)
Request Body:
isLeetCheckEnabled(Bool)isPluralCheckEnabled(Bool)team(String)words([String]): List of words to block
deleteBlockList
Remove a specific block list that is no longer needed. Use this method when you want to delete a block list to stop enforcing its restrictions.
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.deleteBlockList(
name: "example_value"
)
print(response)Response: Response
Parameters
Path Parameters:
name(String) (required)
Query Parameters:
team(String)
listDevices
Retrieve a list of all registered devices associated with your account, useful for managing and monitoring device activity.
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.listDevices()
print(response)Response: ListDevicesResponse
createDevice
Add a new device to your account, enabling it to participate in your chat ecosystem and access related features.
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.createDevice(
request: .init(
id: "example-id",
pushProvider: "example_value",
pushProviderName: "example_value",
voipToken: true
)
)
print(response)Response: Response
Parameters
Request Body:
id(String) (required): Device IDpushProvider(String) (required): Push providerpushProviderName(String): Push provider namevoipToken(Bool): When true the token is for Apple VoIP push notifications
deleteDevice
Remove a specified device from your account, which is helpful for maintaining security and managing active 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.deleteDevice(
id: "example-id"
)
print(response)Response: Response
Parameters
Query Parameters:
id(String) (required)
createGuest
Register a temporary guest user, allowing limited access to your chat system for short-term collaboration or testing.
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.createGuest(
request: .init(
user: "example_value"
)
)
print(response)Response: CreateGuestResponse
Parameters
Request Body:
user(UserRequest) (required): User object which server acts upon
longPoll
The LongPoll method initiates a long polling session to continuously listen for server events or messages, providing real-time updates to your application. Use this when you need to maintain an open connection with the server to receive immediate notifications without repeatedly sending requests.
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.longPoll()
print(response)Parameters
Query Parameters:
json()connectionID(String)
getOG
Retrieves Open Graph data, which is helpful for obtaining metadata about shared content such as links or media.
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.getOG(
url: "example_value"
)
print(response)Response: GetOGResponse
Parameters
Query Parameters:
url(String) (required)
createPoll
Create a new poll in the chat application to gather opinions or feedback from users. Use this method to initiate a poll with customizable options and parameters.
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.createPoll(
request: .init(
name: "Example Name",
custom: [:],
allowAnswers: true
)
)
print(response)Response: PollResponse
Parameters
Request Body:
custom([String: Any])allowAnswers(Bool): Indicates whether users can suggest user defined answersallowUserSuggestedOptions(Bool)description(String): A description of the pollenforceUniqueVote(Bool): Indicates whether users can cast multiple votesid(String)isClosed(Bool): Indicates whether the poll is open for votingmaxVotesAllowed(Int): Indicates the maximum amount of votes a user can castname(String) (required): The name of the polloptions([PollOptionInput])votingVisibility(String)
updatePoll
Modify an existing poll to change its details or options based on new requirements or feedback. Use this method when you need to update the poll's content or settings after creation.
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.updatePoll(
request: .init(
id: "example-id",
name: "Example Name",
custom: [:],
allowAnswers: true
)
)
print(response)Response: PollResponse
Parameters
Request Body:
custom([String: Any])allowAnswers(Bool): Allow answersallowUserSuggestedOptions(Bool): Allow user suggested optionsdescription(String): Poll descriptionenforceUniqueVote(Bool): Enforce unique voteid(String) (required): Poll IDisClosed(Bool): Is closedmaxVotesAllowed(Int): Max votes allowedname(String) (required): Poll nameoptions([PollOptionRequest]): Poll optionsvotingVisibility(String): Voting visibility
queryPolls
Retrieve a list of polls based on specific criteria or filters. Use this method to find and review polls that match certain conditions or properties.
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.queryPolls(
request: .init(
filter: [:],
limit: 1
)
)
print(response)Response: QueryPollsResponse
Parameters
Query Parameters:
userID(String)
Request Body:
filter([String: Any]): Filter to apply to the querylimit(Int)next(String)prev(String)sort([SortParamRequest]): Array of sort parameters
getPoll
Access detailed information about a specific poll, including its options and current status. Use this method when you need to view the complete details of a particular poll.
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.getPoll(
pollID: "example_value"
)
print(response)Response: PollResponse
Parameters
Path Parameters:
pollID(String) (required)
Query Parameters:
userID(String)
updatePollPartial
Make selective updates to certain fields of an existing poll without altering the entire poll. Use this method when you only need to change specific attributes rather than the whole poll structure.
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.updatePollPartial(
request: .init(
set: [:],
unset: ["value1", "value2"]
)
)
print(response)Response: PollResponse
Parameters
Path Parameters:
pollID(String) (required)
Request Body:
set([String: Any]): Sets new field valuesunset([String]): Array of field names to unset
deletePoll
Remove a poll from the chat application, permanently eliminating it from user access and records. Use this method to clean up outdated or irrelevant polls.
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.deletePoll(
pollID: "example_value"
)
print(response)Response: Response
Parameters
Path Parameters:
pollID(String) (required)
Query Parameters:
userID(String)
createPollOption
Add a new option to an existing poll to expand the choices available to users. Use this method when you need to introduce additional voting options in a poll.
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.createPollOption(
request: .init(
text: "Hello, World!",
custom: [:]
)
)
print(response)Response: PollOptionResponse
Parameters
Path Parameters:
pollID(String) (required)
Request Body:
custom([String: Any])text(String) (required): Option text
updatePollOption
Modify the details of an existing poll option to correct, enhance, or adjust its content. Use this method to refine or update the available choices in a poll.
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.updatePollOption(
request: .init(
id: "example-id",
text: "Hello, World!",
custom: [:]
)
)
print(response)Response: PollOptionResponse
Parameters
Path Parameters:
pollID(String) (required)
Request Body:
custom([String: Any])id(String) (required): Option IDtext(String) (required): Option text
getPollOption
Retrieve detailed information about a specific poll option to understand its current setup and status. Use this method to inspect the details of a particular choice within a poll.
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.getPollOption(
pollID: "example_value",
optionID: "example_value"
)
print(response)Response: PollOptionResponse
Parameters
Path Parameters:
pollID(String) (required)optionID(String) (required)
Query Parameters:
userID(String)
deletePollOption
Remove a specific option from an existing poll. Use this method when you need to update a poll by eliminating options that are no longer valid or necessary.
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.deletePollOption(
pollID: "example_value",
optionID: "example_value"
)
print(response)Response: Response
Parameters
Path Parameters:
pollID(String) (required)optionID(String) (required)
Query Parameters:
userID(String)
queryPollVotes
Retrieve the current vote counts for a specific poll. This method is useful for monitoring poll results and understanding user preferences in real-time.
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.queryPollVotes(
request: .init(
filter: [:],
limit: 1
)
)
print(response)Response: PollVotesResponse
Parameters
Path Parameters:
pollID(String) (required)
Query Parameters:
userID(String)
Request Body:
filter([String: Any]): Filter to apply to the querylimit(Int)next(String)prev(String)sort([SortParamRequest]): Array of sort parameters
updatePushNotificationPreferences
Modify the push notification settings for a user or application. Use this method to customize how and when notifications are delivered to enhance user 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 response = try await client.updatePushNotificationPreferences(
request: .init(
preferences: []
)
)
print(response)Response: UpsertPushPreferencesResponse
Parameters
Request Body:
preferences([PushPreferenceInput]) (required): A list of push preferences for channels, calls, or the user.
uploadFile
Upload a file to the chat application to share it with other users or for storage; use this to facilitate file sharing and management.
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.uploadFile(
request: .init(
file: "example_value",
user: "example_value"
)
)
print(response)Response: FileUploadResponse
Parameters
Request Body:
file(String): file fielduser(OnlyUserID): user for the request server side only
deleteFile
Remove a previously uploaded file from the chat application to free up space or maintain data privacy; use this to manage file storage.
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.deleteFile()
print(response)Response: Response
Parameters
Query Parameters:
url(String)
uploadImage
Upload an image to the chat application to share it with other users or for visual content storage; use this to enhance conversations with images.
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.uploadImage(
request: .init(
file: "example_value",
uploadSizes: []
)
)
print(response)Response: ImageUploadResponse
Parameters
Request Body:
file(String)uploadSizes([ImageSize]): field with JSON-encoded array of image size configurationsuser(OnlyUserID)
deleteImage
Remove a previously uploaded image from the chat application to manage storage or privacy; use this to control visual content availability.
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.deleteImage()
print(response)Response: Response
Parameters
Query Parameters:
url(String)
listUserGroups
Retrieve a list of all user groups. Use this to view and manage the groups available within your application.
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.listUserGroups()
print(response)Response: ListUserGroupsResponse
Parameters
Query Parameters:
limit(Int)idGt(String)createdAtGt(String)teamID(String)
createUserGroup
Create a new user group. Use this method to organize users into groups for better management and access control.
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.createUserGroup(
request: .init(
name: "Example Name",
description: "example_value",
id: "example-id"
)
)
print(response)Response: CreateUserGroupResponse
Parameters
Request Body:
description(String): An optional description for the groupid(String): Optional user group ID. If not provided, a UUID v7 will be generatedmemberIds([String]): Optional initial list of user IDs to add as membersname(String) (required): The user friendly name of the user groupteamID(String): Optional team ID to scope the group to a team
searchUserGroups
Find user groups based on specific criteria. Use this to quickly locate groups that meet your search parameters.
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.searchUserGroups(
query: "example_value"
)
print(response)Response: SearchUserGroupsResponse
Parameters
Query Parameters:
query(String) (required)limit(Int)nameGt(String)idGt(String)teamID(String)
getUserGroup
Retrieve details of a specific user group. Use this to view information about a particular group and its members.
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.getUserGroup(
id: "example-id"
)
print(response)Response: GetUserGroupResponse
Parameters
Path Parameters:
id(String) (required)
Query Parameters:
teamID(String)
updateUserGroup
Modify the details of an existing user group. Use this method to change group settings or update group 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.updateUserGroup(
request: .init(
description: "example_value",
name: "Example Name"
)
)
print(response)Response: UpdateUserGroupResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
description(String): The new description for the groupname(String): The new name of the user groupteamID(String)
deleteUserGroup
Remove a user group from the system. Use this to delete groups that are no longer needed, ensuring the organization of your user base.
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.deleteUserGroup(
id: "example-id"
)
print(response)Response: Response
Parameters
Path Parameters:
id(String) (required)
Query Parameters:
teamID(String)
addUserGroupMembers
Use this method to add members to a user group, allowing them to access the group's resources and participate in group activities. Ideal for managing team memberships and ensuring the right people are included in specific group communications.
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.addUserGroupMembers(
request: .init(
memberIds: ["id-1", "id-2"],
asAdmin: true,
teamID: "example_value"
)
)
print(response)Response: AddUserGroupMembersResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
asAdmin(Bool): Whether to add the members as group admins. Defaults to falsememberIds([String]) (required): List of user IDs to add as membersteamID(String)
removeUserGroupMembers
This method removes members from a user group, revoking their access to the group's resources and activities. It is useful for managing group memberships and maintaining security by ensuring only authorized users remain in the group.
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.removeUserGroupMembers(
request: .init(
memberIds: ["id-1", "id-2"],
teamID: "example_value"
)
)
print(response)Response: RemoveUserGroupMembersResponse
Parameters
Path Parameters:
id(String) (required)
Request Body:
memberIds([String]) (required): List of user IDs to removeteamID(String)
queryUsers
Search for users within the chat application based on specific criteria to find and interact with them; use this to efficiently locate users.
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.queryUsers()
print(response)Response: QueryUsersResponse
Parameters
Query Parameters:
payload()
updateUsers
Add new users or modify existing user details within the chat application to keep user information current; use this for comprehensive user management.
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.updateUsers(
request: .init(
users: ["john", "jane"]
)
)
print(response)Response: UpdateUsersResponse
Parameters
Request Body:
users([String: Any]) (required): Object containing users
updateUsersPartial
Make specific updates to existing user details without altering the entire user profile; use this for targeted changes to user 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.updateUsersPartial(
request: .init(
users: ["john", "jane"]
)
)
print(response)Response: UpdateUsersResponse
Parameters
Request Body:
users([UpdateUserPartialRequest]) (required)
getBlockedUsers
Retrieve a list of users currently blocked from accessing chat services, useful for managing and reviewing user restrictions.
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.getBlockedUsers()
print(response)Response: GetBlockedUsersResponse
blockUsers
Block specified users from accessing chat features, ideal for temporarily restricting users due to policy violations or other administrative reasons.
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.blockUsers(
request: .init(
blockedUserID: "john"
)
)
print(response)Response: BlockUsersResponse
Parameters
Request Body:
blockedUserID(String) (required): User id to block
getUserLiveLocations
Access the real-time location of users, useful for features that depend on location-based services or tracking.
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.getUserLiveLocations()
print(response)Response: SharedLocationsResponse
updateLiveLocation
Refresh the live location data for a user, ensuring that location-based services have the most current 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.updateLiveLocation(
request: .init(
messageID: "message-789",
endAt: 1.0,
latitude: 1.0
)
)
print(response)Response: SharedLocationResponse
Parameters
Request Body:
endAt(Double): Time when the live location expireslatitude(Double): Latitude coordinatelongitude(Double): Longitude coordinatemessageID(String) (required): Live location ID
unblockUsers
Remove restrictions on users who were previously blocked, allowing them to access chat services again.
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.unblockUsers(
request: .init(
blockedUserID: "john"
)
)
print(response)Response: UnblockUsersResponse
Parameters
Request Body:
blockedUserID(String) (required)
Types Reference
This section documents the types/interfaces used in this API. These types are extracted from the OpenAPI specification.
Action
struct Action {
var name: String
var style: String?
var text: String
var type: String
var value: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | |
| text | String | Yes | |
| type | String | Yes | |
| style | String | No | |
| value | String | No |
AddUserGroupMembersResponse
Response for adding members to a user group
struct AddUserGroupMembersResponse {
var duration: String
var userGroup: UserGroupResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| user_group | UserGroupResponse | No | The updated user group |
AppResponseFields
struct AppResponseFields {
var asyncURLEnrichEnabled: Bool
var autoTranslationEnabled: Bool
var fileUploadConfig: FileUploadConfig
var id: Int
var imageUploadConfig: FileUploadConfig
var name: String
var placement: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async_url_enrich_enabled | Bool | Yes | |
| auto_translation_enabled | Bool | Yes | |
| file_upload_config | FileUploadConfig | Yes | |
| id | Int | Yes | |
| image_upload_config | FileUploadConfig | Yes | |
| name | String | Yes | |
| placement | String | Yes |
BlockListResponse
Block list contains restricted words
struct BlockListResponse {
var createdAt: Double?
var id: String?
var isLeetCheckEnabled: Bool
var isPluralCheckEnabled: Bool
var name: String
var team: String?
var type: String
var updatedAt: Double?
var words: [String]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| is_leet_check_enabled | Bool | Yes | |
| is_plural_check_enabled | Bool | Yes | |
| name | String | Yes | Block list name |
| type | String | Yes | Block list type. One of: regex, domain, domain_allowlist, email, email_allowl... |
| words | [String] | Yes | List of words to block |
| created_at | Double | No | Date/time of creation |
| id | String | No | |
| team | String | No | |
| updated_at | Double | No | Date/time of the last update |
BlockUsersResponse
struct BlockUsersResponse {
var blockedByUserID: String
var blockedUserID: String
var createdAt: Double
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocked_by_user_id | String | Yes | User id who blocked another user |
| blocked_user_id | String | Yes | User id who got blocked |
| created_at | Double | Yes | Timestamp when the user was blocked |
| duration | String | Yes | Duration of the request in milliseconds |
BlockedUserResponse
struct BlockedUserResponse {
var blockedUser: UserResponse
var blockedUserID: String
var createdAt: Double
var user: UserResponse
var userID: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocked_user | UserResponse | Yes | User who got blocked |
| blocked_user_id | String | Yes | ID of the user who got blocked |
| created_at | Double | Yes | |
| user | UserResponse | Yes | User who blocked another user |
| user_id | String | Yes | ID of the user who blocked another user |
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 |
ChatPreferencesInput
struct ChatPreferencesInput {
var channelMentions: String /* all | none */?
var defaultPreference: String /* all | none */?
var directMentions: String /* all | none */?
var groupMentions: String /* all | none */?
var hereMentions: String /* all | none */?
var roleMentions: String /* all | none */?
var threadReplies: String /* all | none */?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_mentions | String /* all | none */ | No |
| default_preference | String /* all | none */ | No |
| direct_mentions | String /* all | none */ | No |
| group_mentions | String /* all | none */ | No |
| here_mentions | String /* all | none */ | No |
| role_mentions | String /* all | none */ | No |
| thread_replies | String /* all | none */ | No |
CreateBlockListResponse
Basic response information
struct CreateBlockListResponse {
var blocklist: BlockListResponse?
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| blocklist | BlockListResponse | No |
CreateGuestResponse
struct CreateGuestResponse {
var accessToken: String
var duration: String
var user: UserResponse
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| access_token | String | Yes | the access token to authenticate the user |
| duration | String | Yes | Duration of the request in milliseconds |
| user | UserResponse | Yes | User object which server acts upon |
CreateUserGroupResponse
Response for creating a user group
struct CreateUserGroupResponse {
var duration: String
var userGroup: UserGroupResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| user_group | UserGroupResponse | No | The created user group |
DeviceResponse
Response for Device
struct DeviceResponse {
var createdAt: Double
var disabled: Bool?
var disabledReason: String?
var id: String
var pushProvider: String
var pushProviderName: String?
var userID: String
var voip: Bool?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | Date/time of creation |
| id | String | Yes | Device ID |
| push_provider | String | Yes | Push provider |
| user_id | String | Yes | User ID |
| disabled | Bool | No | Whether device is disabled or not |
| disabled_reason | String | No | Reason explaining why device had been disabled |
| push_provider_name | String | No | Push provider name |
| voip | Bool | No | When true the token is for Apple VoIP push notifications |
FeedsPreferences
struct FeedsPreferences {
var comment: String /* all | none */?
var commentMention: String /* all | none */?
var commentReaction: String /* all | none */?
var commentReply: String /* all | none */?
var customActivityTypes: [String: Any]?
var follow: String /* all | none */?
var mention: String /* all | none */?
var reaction: String /* all | none */?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| comment | String /* all | none */ | No |
| comment_mention | String /* all | none */ | No |
| comment_reaction | String /* all | none */ | No |
| comment_reply | String /* all | none */ | No |
| custom_activity_types | [String: Any] | No | Push notification preferences for custom activity types. Map of activity type... |
| follow | String /* all | none */ | No |
| mention | String /* all | none */ | No |
| reaction | String /* all | none */ | No |
Field
struct Field {
var short: Bool
var title: String
var value: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| short | Bool | Yes | |
| title | String | Yes | |
| value | String | Yes |
FileUploadResponse
struct FileUploadResponse {
var duration: String
var file: 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 |
| thumb_url | String | No | URL of the file thumbnail for supported file formats. Should be put to `thumb... |
FullUserResponse
struct FullUserResponse {
var avgResponseTime: Int?
var banExpires: Double?
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 revokeTokensIssuedBefore: Double?
var role: String
var shadowBanned: Bool
var teams: [String]
var teamsRole: [String: Any]?
var totalUnreadCount: Int
var unreadChannels: Int
var unreadCount: Int
var unreadThreads: Int
var updatedAt: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | Bool | Yes | |
| blocked_user_ids | [String] | 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 | |
| shadow_banned | Bool | 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 | |
| ban_expires | Double | 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 | |
| revoke_tokens_issued_before | Double | No | |
| teams_role | [String: Any] | No |
GetApplicationResponse
Basic response information
struct GetApplicationResponse {
var app: AppResponseFields
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app | AppResponseFields | Yes | |
| duration | String | Yes | Duration of the request in milliseconds |
GetBlockedUsersResponse
struct GetBlockedUsersResponse {
var blocks: [BlockedUserResponse]
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocks | [BlockedUserResponse] | Yes | Array of blocked user object |
| duration | String | Yes | Duration of the request in milliseconds |
GetOGResponse
struct GetOGResponse {
var actions: [Action]?
var assetURL: String?
var authorIcon: String?
var authorLink: String?
var authorName: String?
var color: String?
var custom: [String: Any]
var duration: String
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 | |
| duration | String | Yes | |
| actions | [Action] | No | |
| asset_url | String | No | URL of detected video or audio |
| author_icon | String | No | |
| author_link | String | No | og:site |
| author_name | String | No | og:site_name |
| color | String | No | |
| fallback | String | No | |
| fields | [Field] | No | |
| footer | String | No | |
| footer_icon | String | No | |
| giphy | Images | No | |
| image_url | String | No | URL of detected image |
| og_scrape_url | String | No | extracted url from the text |
| original_height | Int | No | |
| original_width | Int | No | |
| pretext | String | No | |
| text | String | No | og:description |
| thumb_url | String | No | URL of detected thumb image |
| title | String | No | og:title |
| title_link | String | No | og:url |
| type | String | No | Attachment type, could be empty, image, audio or video |
GetUserGroupResponse
Response for getting a user group
struct GetUserGroupResponse {
var duration: String
var userGroup: UserGroupResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| user_group | UserGroupResponse | No | The user group |
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 |
ImageUploadResponse
struct ImageUploadResponse {
var duration: String
var file: String?
var thumbURL: String?
var uploadSizes: [ImageSize]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| file | String | No | |
| thumb_url | String | No | |
| upload_sizes | [ImageSize] | No | Array of image size configurations |
Images
struct Images {
var fixedHeight: ImageData
var fixedHeightDownsampled: ImageData
var fixedHeightStill: ImageData
var fixedWidth: ImageData
var fixedWidthDownsampled: ImageData
var fixedWidthStill: ImageData
var original: ImageData
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| fixed_height | ImageData | Yes | |
| fixed_height_downsampled | ImageData | Yes | |
| fixed_height_still | ImageData | Yes | |
| fixed_width | ImageData | Yes | |
| fixed_width_downsampled | ImageData | Yes | |
| fixed_width_still | ImageData | Yes | |
| original | ImageData | Yes |
ListBlockListResponse
Basic response information
struct ListBlockListResponse {
var blocklists: [BlockListResponse]
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklists | [BlockListResponse] | Yes | |
| duration | String | Yes | Duration of the request in milliseconds |
ListDevicesResponse
List devices response
struct ListDevicesResponse {
var devices: [DeviceResponse]
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| devices | [DeviceResponse] | Yes | List of devices |
| duration | String | Yes |
ListUserGroupsResponse
Response for listing user groups
struct ListUserGroupsResponse {
var duration: String
var userGroups: [UserGroupResponse]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| user_groups | [UserGroupResponse] | Yes | List of user groups |
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 |
OnlyUserID
struct OnlyUserID {
var id: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes |
PollOptionInput
struct PollOptionInput {
var custom: [String: Any]?
var text: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | [String: Any] | No | |
| text | String | No |
PollOptionRequest
struct PollOptionRequest {
var custom: [String: Any]?
var id: String
var text: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes | |
| custom | [String: Any] | No | |
| text | String | No |
PollOptionResponse
struct PollOptionResponse {
var duration: String
var pollOption: PollOptionResponseData
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| poll_option | PollOptionResponseData | Yes | Poll option |
PollOptionResponseData
struct PollOptionResponseData {
var custom: [String: Any]
var id: String
var text: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | [String: Any] | Yes | |
| id | String | Yes | |
| text | String | Yes |
PollResponse
struct PollResponse {
var duration: String
var poll: PollResponseData
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| poll | PollResponseData | Yes | Poll |
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 |
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 |
PollVotesResponse
struct PollVotesResponse {
var duration: String
var next: String?
var prev: String?
var votes: [PollVoteResponseData]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| votes | [PollVoteResponseData] | Yes | Poll votes |
| next | String | No | |
| prev | String | No |
PrivacySettingsResponse
struct PrivacySettingsResponse {
var deliveryReceipts: DeliveryReceiptsResponse?
var readReceipts: ReadReceiptsResponse?
var typingIndicators: TypingIndicatorsResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| delivery_receipts | DeliveryReceiptsResponse | No | |
| read_receipts | ReadReceiptsResponse | No | |
| typing_indicators | TypingIndicatorsResponse | No |
PushPreferenceInput
struct PushPreferenceInput {
var callLevel: String /* all | none | default */?
var channelCid: String?
var chatLevel: String /* all | mentions | direct_mentions | all_mentions | none | default */?
var chatPreferences: ChatPreferencesInput?
var disabledUntil: Double?
var feedsLevel: String /* all | none | default */?
var feedsPreferences: FeedsPreferences?
var removeDisable: Bool?
var userID: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| call_level | String /* all | none | default */ |
| channel_cid | String | No | Set the push preferences for a specific channel. If empty it sets the default... |
| chat_level | String /* all | mentions | direct_mentions |
| chat_preferences | ChatPreferencesInput | No | |
| disabled_until | Double | No | Disable push notifications till a certain time |
| feeds_level | String /* all | none | default */ |
| feeds_preferences | FeedsPreferences | No | Set granular feeds preferences for reactions, comments, new followers, mentio... |
| remove_disable | Bool | No | Remove the disabled until time. (IE stop snoozing notifications) |
| user_id | String | No | The user id for which to set the push preferences. Required when using server... |
QueryPollsResponse
struct QueryPollsResponse {
var duration: String
var next: String?
var polls: [PollResponseData]
var prev: String?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| polls | [PollResponseData] | Yes | Polls data returned by the query |
| next | String | No | |
| prev | String | No |
QueryUsersResponse
struct QueryUsersResponse {
var duration: String
var users: [FullUserResponse]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| users | [FullUserResponse] | Yes | Array of users as result of filters applied. |
RemoveUserGroupMembersResponse
Response for removing members from a user group
struct RemoveUserGroupMembersResponse {
var duration: String
var userGroup: UserGroupResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| user_group | UserGroupResponse | No | The updated user group |
Response
Basic response information
struct Response {
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
SearchUserGroupsResponse
Response for searching user groups
struct SearchUserGroupsResponse {
var duration: String
var userGroups: [UserGroupResponse]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| user_groups | [UserGroupResponse] | Yes | List of matching user groups |
SharedLocationResponse
struct SharedLocationResponse {
var channel: ChannelResponse?
var channelCid: String
var createdAt: Double
var createdByDeviceID: String
var duration: 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 | Channel CID |
| created_at | Double | Yes | Date/time of creation |
| created_by_device_id | String | Yes | Device ID that created the live location |
| duration | String | Yes | |
| latitude | Double | Yes | Latitude coordinate |
| longitude | Double | Yes | Longitude coordinate |
| message_id | String | Yes | Message ID |
| updated_at | Double | Yes | Date/time of the last update |
| user_id | String | Yes | User ID |
| channel | ChannelResponse | No | |
| end_at | Double | No | Time when the live location expires |
| message | MessageResponse | 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 |
SharedLocationsResponse
struct SharedLocationsResponse {
var activeLiveLocations: [SharedLocationResponseData]
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_live_locations | [SharedLocationResponseData] | Yes | |
| duration | String | Yes |
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)... |
Time
struct Time {
}UnblockUsersResponse
struct UnblockUsersResponse {
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
UpdateBlockListResponse
Basic response information
struct UpdateBlockListResponse {
var blocklist: BlockListResponse?
var duration: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| blocklist | BlockListResponse | No |
UpdateUserGroupResponse
Response for updating a user group
struct UpdateUserGroupResponse {
var duration: String
var userGroup: UserGroupResponse?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | |
| user_group | UserGroupResponse | No | The updated user group |
UpdateUserPartialRequest
struct UpdateUserPartialRequest {
var id: String
var set: [String: Any]?
var unset: [String]?
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes | User ID to update |
| set | [String: Any] | No | |
| unset | [String] | No |
UpdateUsersResponse
struct UpdateUsersResponse {
var duration: String
var membershipDeletionTaskID: String
var users: [String: Any]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| membership_deletion_task_id | String | Yes | |
| users | [String: Any] | Yes | Object containing users |
UpsertPushPreferencesResponse
struct UpsertPushPreferencesResponse {
var duration: String
var userChannelPreferences: [String: Any]
var userPreferences: [String: Any]
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | String | Yes | Duration of the request in milliseconds |
| user_channel_preferences | [String: Any] | Yes | The channel specific push notification preferences, only returned for channel... |
| user_preferences | [String: Any] | Yes | The user preferences, always returned regardless if you edited it |
User
struct User {
var data: [String: Any]?
var id: String
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | String | Yes | |
| data | [String: Any] | No |
UserGroupResponse
struct UserGroupResponse {
var createdAt: Double
var createdBy: String?
var description: String?
var id: String
var members: [UserGroupMember]?
var name: String
var teamID: String?
var updatedAt: Double
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | Double | Yes | |
| id | String | Yes | |
| name | String | Yes | |
| updated_at | Double | Yes | |
| created_by | String | No | |
| description | String | No | |
| members | [UserGroupMember] | No | |
| team_id | String | 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 |