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