Appearance
Chat
About 25884 wordsAbout 86 min
Go-Serverside SDK - Chat API
Table of Contents
- QueryCampaigns
- GetCampaign
- StartCampaign
- StopCampaign
- QueryChannels
- ChannelBatchUpdate
- DeleteChannels
- MarkDelivered
- MarkChannelsRead
- GetOrCreateDistinctChannel
- UpdateChannel
- UpdateChannelPartial
- DeleteChannel
- GetDraft
- DeleteDraft
- SendEvent
- UploadChannelFile
- DeleteChannelFile
- HideChannel
- UploadChannelImage
- DeleteChannelImage
- UpdateMemberPartial
- SendMessage
- GetManyMessages
- GetOrCreateChannel
- MarkRead
- ShowChannel
- TruncateChannel
- MarkUnread
- ListChannelTypes
- CreateChannelType
- GetChannelType
- UpdateChannelType
- DeleteChannelType
- ListCommands
- CreateCommand
- GetCommand
- UpdateCommand
- DeleteCommand
- QueryDrafts
- ExportChannels
- QueryMembers
- QueryMessageHistory
- GetMessage
- UpdateMessage
- UpdateMessagePartial
- DeleteMessage
- RunMessageAction
- CommitMessage
- EphemeralMessageUpdate
- SendReaction
- DeleteReaction
- GetReactions
- QueryReactions
- TranslateMessage
- UndeleteMessage
- CastPollVote
- DeletePollVote
- CreateReminder
- UpdateReminder
- DeleteReminder
- GetReplies
- QueryMessageFlags
- MuteChannel
- UnmuteChannel
- QueryBannedUsers
- QueryFutureChannelBans
- QueryReminders
- GetRetentionPolicy
- SetRetentionPolicy
- DeleteRetentionPolicy
- GetRetentionPolicyRuns
- Search
- QuerySegments
- GetSegment
- DeleteSegment
- DeleteSegmentTargets
- SegmentTargetExists
- QuerySegmentTargets
- QueryTeamUsageStats
- QueryThreads
- GetThread
- UpdateThreadPartial
- UnreadCounts
- UnreadCountsBatch
- SendUserCustomEvent
- Types Reference
QueryCampaigns
Retrieve a list of campaigns based on specific criteria, helping you manage and analyze multiple marketing efforts simultaneously.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query campaigns
resp, err := chatClient.QueryCampaigns(context.Background(), &stream.QueryCampaignsRequest{
Limit: stream.PtrTo(25),
Filter: map[string]any{},
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev and next
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query campaigns
resp, err := chatClient.QueryCampaigns(context.Background(), &stream.QueryCampaignsRequest{
Prev: nil,
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user_limit
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query campaigns
resp, err := chatClient.QueryCampaigns(context.Background(), &stream.QueryCampaignsRequest{
UserLimit: stream.PtrTo(10),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryCampaignsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Filter | map[string]any | No | - |
| Limit | int | No | - |
| Next | string | No | - |
| Prev | string | No | - |
| Sort | []SortParamRequest | No | - |
| UserLimit | int | No | - |
GetCampaign
Obtain detailed information about a specific campaign, allowing you to review its current status and settings.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get campaign
resp, err := chatClient.GetCampaign(context.Background(), &stream.GetCampaignRequest{
ID: "activity-123",
Limit: stream.PtrTo(25),
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get campaign
resp, err := chatClient.GetCampaign(context.Background(), &stream.GetCampaignRequest{
ID: "activity-123",
Prev: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetCampaignResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Prev | string | No | - |
| Next | string | No | - |
| Limit | int | No | - |
StartCampaign
Initiate or schedule a campaign to begin at a designated time, enabling you to automate your marketing and outreach activities.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Start/schedule campaign
resp, err := chatClient.StartCampaign(context.Background(), &stream.StartCampaignRequest{
ID: "activity-123",
ScheduledFor: &10,
StopAt: &10,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: StartCampaignResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| ScheduledFor | float | No | - |
| StopAt | float | No | - |
StopCampaign
Stop an ongoing campaign to prevent further messages from being sent, useful when campaign objectives have been achieved or if errors are detected.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Stop campaign
resp, err := chatClient.StopCampaign(context.Background(), &stream.StopCampaignRequest{
ID: "activity-123",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: CampaignResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
QueryChannels
Access a list of communication channels available in your account, facilitating efficient management and selection for your campaigns.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query channels
resp, err := chatClient.QueryChannels(context.Background(), &stream.QueryChannelsRequest{
UserID: stream.PtrTo("john"),
Limit: stream.PtrTo(25),
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with filter_conditions and message_limit
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query channels
resp, err := chatClient.QueryChannels(context.Background(), &stream.QueryChannelsRequest{
FilterConditions: map[string]any{},
MessageLimit: stream.PtrTo(10),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with offset and predefined_filter
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query channels
resp, err := chatClient.QueryChannels(context.Background(), &stream.QueryChannelsRequest{
Offset: stream.PtrTo(0),
PredefinedFilter: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with filter_values and sort_values
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query channels
resp, err := chatClient.QueryChannels(context.Background(), &stream.QueryChannelsRequest{
FilterValues: map[string]any{},
SortValues: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryChannelsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| FilterConditions | map[string]any | No | Filter conditions to apply to the query |
| FilterValues | map[string]any | No | Values to interpolate into the predefined filter template |
| Limit | int | No | Number of channels to limit |
| MemberLimit | int | No | Number of members to limit |
| MessageLimit | int | No | Number of messages to limit |
| Offset | int | No | Channel pagination offset |
| PredefinedFilter | string | No | ID of a predefined filter to use instead of filter_conditions |
| Sort | []SortParamRequest | No | List of sort parameters |
| SortValues | map[string]any | No | - |
| State | bool | No | Whether to update channel state or not |
| User | UserRequest | No | - |
| UserID | string | No | - |
ChannelBatchUpdate
Update multiple channels simultaneously to save time and ensure consistency across channel settings or configurations.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channels in batch
resp, err := chatClient.ChannelBatchUpdate(context.Background(), &stream.ChannelBatchUpdateRequest{
Filter: map[string]any{},
Operation: "add",
Data: &stream.ChannelDataUpdate{AutoTranslationEnabled: false},
Members: []stream.ChannelBatchMemberRequest{{UserID: "john"}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ChannelBatchUpdateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Filter | map[string]any | Yes | - |
| Operation | string | Yes | - |
| Data | ChannelDataUpdate | No | - |
| Members | []ChannelBatchMemberRequest | No | - |
DeleteChannels
Asynchronously remove specific channels from your account, helping you maintain an organized and relevant channel list without immediate blocking.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Deletes channels asynchronously
resp, err := chatClient.DeleteChannels(context.Background(), &stream.DeleteChannelsRequest{
Cids: nil,
HardDelete: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: DeleteChannelsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Cids | []string | Yes | All channels that should be deleted |
| HardDelete | bool | No | Specify if channels and all ressources should be hard deleted |
MarkDelivered
Update the delivery status of messages sent through a channel, ensuring accurate tracking and reporting of message delivery outcomes.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mark channel message delivery status
resp, err := chatClient.MarkDelivered(context.Background(), &stream.MarkDeliveredRequest{
UserID: stream.PtrTo("john"),
LatestDeliveredMessages: []stream.DeliveredMessagePayload{{ID: stream.PtrTo("activity-123")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MarkDeliveredResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| UserID | string | No | - |
| LatestDeliveredMessages | []DeliveredMessagePayload | No | - |
MarkChannelsRead
Mark all messages in selected channels as read, allowing you to streamline communication management and reduce notification clutter.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mark channels as read
resp, err := chatClient.MarkChannelsRead(context.Background(), &stream.MarkChannelsReadRequest{
UserID: stream.PtrTo("john"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
ReadByChannel: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MarkReadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ReadByChannel | map[string]any | No | Map of channel ID to last read message ID |
| User | UserRequest | No | - |
| UserID | string | No | - |
GetOrCreateDistinctChannel
Retrieve an existing channel or create a new one based on unique identifiers, simplifying the process of managing distinct communication threads.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateDistinctChannel(context.Background(), &stream.GetOrCreateDistinctChannelRequest{
Type: "like",
Data: &stream.ChannelInput{AutoTranslationEnabled: false},
HideForCreator: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with members and messages
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateDistinctChannel(context.Background(), &stream.GetOrCreateDistinctChannelRequest{
Type: "like",
Members: &stream.PaginationParams{Limit: 25},
Messages: &stream.MessagePaginationParams{CreatedAtAfter: 10},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with state and thread_unread_counts
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateDistinctChannel(context.Background(), &stream.GetOrCreateDistinctChannelRequest{
Type: "like",
State: stream.PtrTo(false),
ThreadUnreadCounts: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with watchers
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateDistinctChannel(context.Background(), &stream.GetOrCreateDistinctChannelRequest{
Type: "like",
Watchers: &stream.PaginationParams{Limit: 25},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ChannelStateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| Data | ChannelInput | No | - |
| HideForCreator | 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 |
| ThreadUnreadCounts | bool | No | - |
| Watchers | PaginationParams | No | - |
UpdateChannel
Modify the settings or attributes of an existing channel to keep your communication channels up-to-date and aligned with your needs.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel
resp, err := chatClient.UpdateChannel(context.Background(), &stream.UpdateChannelRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
SkipPush: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with add_members and add_moderators
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel
resp, err := chatClient.UpdateChannel(context.Background(), &stream.UpdateChannelRequest{
Type: "like",
ID: "activity-123",
AddMembers: []stream.ChannelMemberRequest{{UserID: "john"}},
AddModerators: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with assign_roles and cooldown
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel
resp, err := chatClient.UpdateChannel(context.Background(), &stream.UpdateChannelRequest{
Type: "like",
ID: "activity-123",
AssignRoles: []stream.ChannelMemberRequest{{UserID: "john"}},
Cooldown: stream.PtrTo(10),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with data and demote_moderators
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel
resp, err := chatClient.UpdateChannel(context.Background(), &stream.UpdateChannelRequest{
Type: "like",
ID: "activity-123",
Data: &stream.ChannelInputRequest{AutoTranslationEnabled: false},
DemoteModerators: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| AcceptInvite | bool | No | Set to true to accept the invite |
| AddFilterTags | []string | No | List of filter tags to add to the channel |
| AddMembers | []ChannelMemberRequest | No | List of user IDs to add to the channel |
| AddModerators | []string | No | List of user IDs to make channel moderators |
| AssignRoles | []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 | - |
| DemoteModerators | []string | No | List of user IDs to take away moderators status from |
| HideHistory | bool | No | Set to true to hide channel's history when adding new members |
| HideHistoryBefore | 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 |
| RejectInvite | bool | No | Set to true to reject the invite |
| RemoveFilterTags | []string | No | List of filter tags to remove from the channel |
| RemoveMembers | []string | No | List of user IDs to remove from the channel |
| SkipPush | bool | No | When message is set disables all push notifications for it |
| User | UserRequest | No | - |
| UserID | string | No | - |
UpdateChannelPartial
Update specific attributes of a channel without altering the entire channel configuration. Use this to make targeted changes, such as updating channel metadata or settings.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially update channel
resp, err := chatClient.UpdateChannelPartial(context.Background(), &stream.UpdateChannelPartialRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
Unset: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user and set
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially update channel
resp, err := chatClient.UpdateChannelPartial(context.Background(), &stream.UpdateChannelPartialRequest{
Type: "like",
ID: "activity-123",
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
Set: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateChannelPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| Set | map[string]any | No | - |
| Unset | []string | No | - |
| User | UserRequest | No | - |
| UserID | string | No | - |
DeleteChannel
Remove a channel from the system entirely. Use this when you want to permanently delete a channel and its associated data.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete channel
resp, err := chatClient.DeleteChannel(context.Background(), &stream.DeleteChannelRequest{
Type: "like",
ID: "activity-123",
HardDelete: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: DeleteChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| HardDelete | bool | No | - |
GetDraft
Retrieve a draft message for editing or review. Use this to access unsent messages saved as drafts before finalizing or sending them.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get draft
resp, err := chatClient.GetDraft(context.Background(), &stream.GetDraftRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
ParentID: stream.PtrTo("parent-123"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetDraftResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| ParentID | string | No | - |
| UserID | string | No | - |
DeleteDraft
Remove a draft message from the system. Use this when a draft is no longer needed and you want to declutter saved drafts.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete draft
resp, err := chatClient.DeleteDraft(context.Background(), &stream.DeleteDraftRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
ParentID: stream.PtrTo("parent-123"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| ParentID | string | No | - |
| UserID | string | No | - |
SendEvent
Trigger an event within a channel to notify users of actions or updates. Use this to communicate important events, such as member joins or message reactions.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Send event
resp, err := chatClient.SendEvent(context.Background(), &stream.SendEventRequest{
Type: "like",
ID: "activity-123",
Event: stream.EventRequest{Type: "like", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: EventResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| Event | EventRequest | Yes | - |
UploadChannelFile
Upload a file to a channel for sharing with other members. Use this to share documents, images, or any relevant files within the channel.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Upload file
resp, err := chatClient.UploadChannelFile(context.Background(), &stream.UploadChannelFileRequest{
Type: "like",
ID: "activity-123",
File: stream.PtrTo("value"),
User: &stream.OnlyUserID{ID: "activity-123"},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UploadChannelFileResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| File | string | No | file field |
| User | OnlyUserID | No | user for the request server side only |
DeleteChannelFile
Remove a previously uploaded file from a channel. Use this to manage or clean up files that are no longer needed in the channel.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete file
resp, err := chatClient.DeleteChannelFile(context.Background(), &stream.DeleteChannelFileRequest{
Type: "like",
ID: "activity-123",
URL: "value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| URL | string | No | - |
HideChannel
Temporarily hide a channel from the user's view without deleting it. Use this to reduce clutter while retaining access to the channel for future engagement.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Hide channel
resp, err := chatClient.HideChannel(context.Background(), &stream.HideChannelRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with clear_history
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Hide channel
resp, err := chatClient.HideChannel(context.Background(), &stream.HideChannelRequest{
Type: "like",
ID: "activity-123",
ClearHistory: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: HideChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| ClearHistory | bool | No | Whether to clear message history of the channel or not |
| User | UserRequest | No | - |
| UserID | string | No | - |
UploadChannelImage
Upload an image to a channel, enhancing communication with visual content. Use this to share images relevant to the channel's discussions or activities.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Upload image
resp, err := chatClient.UploadChannelImage(context.Background(), &stream.UploadChannelImageRequest{
Type: "like",
ID: "activity-123",
File: stream.PtrTo("value"),
UploadSizes: []stream.ImageSize{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Upload image
resp, err := chatClient.UploadChannelImage(context.Background(), &stream.UploadChannelImageRequest{
Type: "like",
ID: "activity-123",
User: &stream.OnlyUserID{ID: "activity-123"},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UploadChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| File | string | No | - |
| UploadSizes | []ImageSize | No | field with JSON-encoded array of image size configurations |
| User | OnlyUserID | No | - |
DeleteChannelImage
Remove an uploaded image from a channel. Use this to manage the visual content and keep the channel's media relevant and up-to-date.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete image
resp, err := chatClient.DeleteChannelImage(context.Background(), &stream.DeleteChannelImageRequest{
Type: "like",
ID: "activity-123",
URL: "value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| URL | string | No | - |
UpdateMemberPartial
Partially update the details of a channel member, such as their role or nickname, without altering their entire profile. Use this when you need to make specific updates to a member's attributes in a channel.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially channel member update
resp, err := chatClient.UpdateMemberPartial(context.Background(), &stream.UpdateMemberPartialRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
Set: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with unset
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially channel member update
resp, err := chatClient.UpdateMemberPartial(context.Background(), &stream.UpdateMemberPartialRequest{
Type: "like",
ID: "activity-123",
Unset: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateMemberPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| UserID | string | No | - |
| Set | map[string]any | No | - |
| Unset | []string | No | - |
SendMessage
Send a new message to a specified channel, allowing you to initiate or continue a conversation. Use this to communicate with channel members through text, attachments, or other supported message types.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Send new message
resp, err := chatClient.SendMessage(context.Background(), &stream.SendMessageRequest{
Type: "like",
ID: "activity-123",
Message: stream.MessageRequest{Attachments: nil},
SkipPush: stream.PtrTo(false),
KeepChannelHidden: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with pending and pending_message_metadata
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Send new message
resp, err := chatClient.SendMessage(context.Background(), &stream.SendMessageRequest{
Type: "like",
ID: "activity-123",
Message: stream.MessageRequest{Attachments: nil},
Pending: stream.PtrTo(false),
PendingMessageMetadata: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with skip_enrich_url and force_moderation
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Send new message
resp, err := chatClient.SendMessage(context.Background(), &stream.SendMessageRequest{
Type: "like",
ID: "activity-123",
Message: stream.MessageRequest{Attachments: nil},
SkipEnrichURL: false,
ForceModeration: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: SendMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| Message | MessageRequest | Yes | - |
| ForceModeration | bool | No | - |
| KeepChannelHidden | bool | No | - |
| Pending | bool | No | - |
| PendingMessageMetadata | map[string]any | No | - |
| SkipEnrichURL | bool | No | - |
| SkipPush | bool | No | - |
GetManyMessages
Retrieve a batch of messages from a channel, which can be useful for loading conversation history or displaying older messages. Use this to efficiently access multiple messages at once.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get many messages
resp, err := chatClient.GetManyMessages(context.Background(), &stream.GetManyMessagesRequest{
Type: "like",
ID: "activity-123",
Ids: []string{"activity-1", "activity-2"},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetManyMessagesResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| Ids | []string | Yes | - |
GetOrCreateChannel
Retrieve an existing channel or create a new one if it doesn't exist, ensuring you have a channel to work with for communication. Use this when you need to set up or access a channel dynamically.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateChannel(context.Background(), &stream.GetOrCreateChannelRequest{
Type: "like",
ID: "activity-123",
Data: &stream.ChannelInput{AutoTranslationEnabled: false},
HideForCreator: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with members and messages
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateChannel(context.Background(), &stream.GetOrCreateChannelRequest{
Type: "like",
ID: "activity-123",
Members: &stream.PaginationParams{Limit: 25},
Messages: &stream.MessagePaginationParams{CreatedAtAfter: 10},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with state and thread_unread_counts
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateChannel(context.Background(), &stream.GetOrCreateChannelRequest{
Type: "like",
ID: "activity-123",
State: stream.PtrTo(false),
ThreadUnreadCounts: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with watchers
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get or create channel
resp, err := chatClient.GetOrCreateChannel(context.Background(), &stream.GetOrCreateChannelRequest{
Type: "like",
ID: "activity-123",
Watchers: &stream.PaginationParams{Limit: 25},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ChannelStateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| Data | ChannelInput | No | - |
| HideForCreator | 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 |
| ThreadUnreadCounts | bool | No | - |
| Watchers | PaginationParams | No | - |
MarkRead
Mark messages in a channel as read to update the read status and notify other members. Use this to keep track of read messages and manage message notifications.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mark read
resp, err := chatClient.MarkRead(context.Background(), &stream.MarkReadRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
ThreadID: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user and message_id
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mark read
resp, err := chatClient.MarkRead(context.Background(), &stream.MarkReadRequest{
Type: "like",
ID: "activity-123",
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
MessageID: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MarkReadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| MessageID | string | No | ID of the message that is considered last read by client |
| ThreadID | string | No | Optional Thread ID to specifically mark a given thread as read |
| User | UserRequest | No | - |
| UserID | string | No | - |
ShowChannel
Display detailed information about a specific channel, including its settings and current members. Use this to gain insights into a channel's configuration and participant list.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Show channel
resp, err := chatClient.ShowChannel(context.Background(), &stream.ShowChannelRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ShowChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| User | UserRequest | No | - |
| UserID | string | No | - |
TruncateChannel
Clear all messages from a channel while preserving its settings and members, effectively resetting the conversation. Use this to start anew without deleting the channel entirely.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Truncate channel
resp, err := chatClient.TruncateChannel(context.Background(), &stream.TruncateChannelRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
HardDelete: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with skip_push and member_ids
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Truncate channel
resp, err := chatClient.TruncateChannel(context.Background(), &stream.TruncateChannelRequest{
Type: "like",
ID: "activity-123",
SkipPush: stream.PtrTo(false),
MemberIds: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with truncated_at and user
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Truncate channel
resp, err := chatClient.TruncateChannel(context.Background(), &stream.TruncateChannelRequest{
Type: "like",
ID: "activity-123",
TruncatedAt: &10,
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with message
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Truncate channel
resp, err := chatClient.TruncateChannel(context.Background(), &stream.TruncateChannelRequest{
Type: "like",
ID: "activity-123",
Message: &stream.MessageRequest{Attachments: nil},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: TruncateChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| HardDelete | bool | No | Permanently delete channel data (messages, reactions, etc.) |
| MemberIds | []string | No | List of member IDs to hide message history for. If empty, truncates the channel for all members |
| Message | MessageRequest | No | - |
| SkipPush | bool | No | When message is set disables all push notifications for it |
| TruncatedAt | float | No | Truncate channel data up to truncated_at. The system message (if provided) creation time is alw... |
| User | UserRequest | No | - |
| UserID | string | No | - |
MarkUnread
Mark messages in a channel as unread, which can be useful for revisiting important conversations or managing notification settings. Use this to reset the read status of messages that need attention.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mark unread
resp, err := chatClient.MarkUnread(context.Background(), &stream.MarkUnreadRequest{
Type: "like",
ID: "activity-123",
UserID: stream.PtrTo("john"),
MessageTimestamp: &10,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with thread_id and user
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mark unread
resp, err := chatClient.MarkUnread(context.Background(), &stream.MarkUnreadRequest{
Type: "like",
ID: "activity-123",
ThreadID: stream.PtrTo("value"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with message_id
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mark unread
resp, err := chatClient.MarkUnread(context.Background(), &stream.MarkUnreadRequest{
Type: "like",
ID: "activity-123",
MessageID: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | - |
| ID | string | Yes | - |
| MessageID | string | No | ID of the message from where the channel is marked unread |
| MessageTimestamp | float | No | Timestamp of the message from where the channel is marked unread |
| ThreadID | string | No | Mark a thread unread, specify one of the thread, message timestamp, or message id |
| User | UserRequest | No | - |
| UserID | string | No | - |
ListChannelTypes
Retrieve a list of available channel types, each defining specific settings and behaviors. Use this to explore or select from different channel configurations for your communication needs.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// List channel types
resp, err := chatClient.ListChannelTypes(context.Background())
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ListChannelTypesResponse
CreateChannelType
Define and create a new channel type with specific settings and behaviors to suit your application's requirements. Use this to customize how channels operate and interact based on your unique use case.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Create channel type
resp, err := chatClient.CreateChannelType(context.Background(), &stream.CreateChannelTypeRequest{
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
Name: "My Feed",
Blocklist: stream.PtrTo("value"),
BlocklistBehavior: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with blocklists and chat_preferences
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Create channel type
resp, err := chatClient.CreateChannelType(context.Background(), &stream.CreateChannelTypeRequest{
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
Name: "My Feed",
Blocklists: []stream.BlockListOptions{},
ChatPreferences: &stream.ChatPreferences{ChannelMentions: "value"},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with commands and connect_events
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Create channel type
resp, err := chatClient.CreateChannelType(context.Background(), &stream.CreateChannelTypeRequest{
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
Name: "My Feed",
Commands: nil,
ConnectEvents: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with count_messages and custom_events
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Create channel type
resp, err := chatClient.CreateChannelType(context.Background(), &stream.CreateChannelTypeRequest{
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
Name: "My Feed",
CountMessages: stream.PtrTo(false),
CustomEvents: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: CreateChannelTypeResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Automod | string | Yes | Automod. One of: disabled, simple, AI |
| AutomodBehavior | string | Yes | Automod behavior. One of: flag, block |
| MaxMessageLength | int | Yes | Max message length |
| Name | string | Yes | Channel type name |
| Blocklist | string | No | Blocklist |
| BlocklistBehavior | string | No | Blocklist behavior. One of: flag, block, shadow_block |
| Blocklists | []BlockListOptions | No | Blocklists |
| ChatPreferences | ChatPreferences | No | - |
| Commands | []string | No | List of commands that channel supports |
| ConnectEvents | bool | No | Connect events |
| CountMessages | bool | No | Count messages in channel. |
| CustomEvents | bool | No | Custom events |
| DeliveryEvents | bool | No | - |
| Grants | map[string]any | No | List of grants for the channel type |
| MarkMessagesPending | bool | No | Mark messages pending |
| MessageRetention | string | No | Message retention. One of: infinite, numeric |
| Mutes | bool | No | Mutes |
| PartitionSize | int | No | Partition size |
| PartitionTtl | string | No | Partition TTL |
| Permissions | []PolicyRequest | No | List of permissions for the channel type |
| Polls | bool | No | Polls |
| PushLevel | string | No | Default push notification level for the channel type. One of: all, all_mentions, mentions, direct... |
| PushNotifications | bool | No | Push notifications |
| Reactions | bool | No | Reactions |
| ReadEvents | bool | No | Read events |
| Replies | bool | No | Replies |
| Search | bool | No | Search |
| SharedLocations | bool | No | Enables shared location messages |
| SkipLastMsgUpdateForSystemMsgs | bool | No | - |
| TypingEvents | bool | No | Typing events |
| Uploads | bool | No | Uploads |
| URLEnrichment | bool | No | URL enrichment |
| UserMessageReminders | bool | No | - |
GetChannelType
Retrieve information about a specific channel type to understand its configuration and settings, useful for reviewing or managing channel functionalities.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get channel type
resp, err := chatClient.GetChannelType(context.Background(), &stream.GetChannelTypeRequest{
Name: "My Feed",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetChannelTypeResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Name | string | Yes | - |
UpdateChannelType
Modify the properties of an existing channel type to customize or enhance channel behavior according to specific requirements.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel type
resp, err := chatClient.UpdateChannelType(context.Background(), &stream.UpdateChannelTypeRequest{
Name: "My Feed",
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
AllowedFlagReasons: nil,
AutomodThresholds: &stream.Thresholds{Explicit: stream.LabelThresholds{Block: 10}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with blocklist and blocklist_behavior
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel type
resp, err := chatClient.UpdateChannelType(context.Background(), &stream.UpdateChannelTypeRequest{
Name: "My Feed",
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
Blocklist: stream.PtrTo("value"),
BlocklistBehavior: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with blocklists and chat_preferences
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel type
resp, err := chatClient.UpdateChannelType(context.Background(), &stream.UpdateChannelTypeRequest{
Name: "My Feed",
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
Blocklists: []stream.BlockListOptions{},
ChatPreferences: &stream.ChatPreferences{ChannelMentions: "value"},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with commands and connect_events
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update channel type
resp, err := chatClient.UpdateChannelType(context.Background(), &stream.UpdateChannelTypeRequest{
Name: "My Feed",
Automod: "value",
AutomodBehavior: "value",
MaxMessageLength: 10,
Commands: nil,
ConnectEvents: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateChannelTypeResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Name | string | Yes | - |
| Automod | string | Yes | - |
| AutomodBehavior | string | Yes | - |
| MaxMessageLength | int | Yes | - |
| AllowedFlagReasons | []string | No | - |
| AutomodThresholds | Thresholds | No | - |
| Blocklist | string | No | - |
| BlocklistBehavior | string | No | - |
| Blocklists | []BlockListOptions | No | - |
| ChatPreferences | ChatPreferences | No | - |
| Commands | []string | No | List of commands that channel supports |
| ConnectEvents | bool | No | - |
| CountMessages | bool | No | - |
| CustomEvents | bool | No | - |
| DeliveryEvents | bool | No | - |
| Grants | map[string]any | No | - |
| MarkMessagesPending | bool | No | - |
| Mutes | bool | No | - |
| PartitionSize | int | No | - |
| PartitionTtl | string | No | - |
| Permissions | []PolicyRequest | No | - |
| Polls | bool | No | - |
| PushLevel | string | No | - |
| PushNotifications | bool | No | - |
| Quotes | bool | No | - |
| Reactions | bool | No | - |
| ReadEvents | bool | No | - |
| Reminders | bool | No | - |
| Replies | bool | No | - |
| Search | bool | No | - |
| SharedLocations | bool | No | - |
| SkipLastMsgUpdateForSystemMsgs | bool | No | - |
| TypingEvents | bool | No | - |
| Uploads | bool | No | - |
| URLEnrichment | bool | No | - |
| UserMessageReminders | bool | No | - |
DeleteChannelType
Remove a channel type from your application to streamline channel categories or eliminate unused configurations.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete channel type
resp, err := chatClient.DeleteChannelType(context.Background(), &stream.DeleteChannelTypeRequest{
Name: "My Feed",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Name | string | Yes | - |
ListCommands
Obtain a list of all available commands, providing a quick reference to the commands that can be used within the chat environment.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// List commands
resp, err := chatClient.ListCommands(context.Background())
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ListCommandsResponse
CreateCommand
Create a new command to extend chat functionalities, enabling custom actions or automations based on user input.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Create command
resp, err := chatClient.CreateCommand(context.Background(), &stream.CreateCommandRequest{
Description: "A description",
Name: "My Feed",
Args: stream.PtrTo("value"),
Set: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: CreateCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Description | string | Yes | Description, shown in commands auto-completion |
| Name | string | Yes | Unique command name |
| Args | string | No | Arguments help text, shown in commands auto-completion |
| Set | string | No | Set name used for grouping commands |
GetCommand
Access details about a specific command to review its configuration or ensure it performs as expected within the chat.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get command
resp, err := chatClient.GetCommand(context.Background(), &stream.GetCommandRequest{
Name: "My Feed",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Name | string | Yes | - |
UpdateCommand
Alter the properties of an existing command to refine its behavior or adapt to changing requirements in the chat application.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update command
resp, err := chatClient.UpdateCommand(context.Background(), &stream.UpdateCommandRequest{
Name: "My Feed",
Description: "A description",
Args: stream.PtrTo("value"),
Set: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Name | string | Yes | - |
| Description | string | Yes | Description, shown in commands auto-completion |
| Args | string | No | Arguments help text, shown in commands auto-completion |
| Set | string | No | Set name used for grouping commands |
DeleteCommand
Eliminate a command from your chat environment to simplify command options or remove outdated functionalities.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete command
resp, err := chatClient.DeleteCommand(context.Background(), &stream.DeleteCommandRequest{
Name: "My Feed",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: DeleteCommandResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Name | string | Yes | - |
QueryDrafts
Search for draft messages to review or manage incomplete communications before they are sent within the chat.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query draft messages
resp, err := chatClient.QueryDrafts(context.Background(), &stream.QueryDraftsRequest{
UserID: stream.PtrTo("john"),
Limit: stream.PtrTo(25),
Filter: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with sort and next
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query draft messages
resp, err := chatClient.QueryDrafts(context.Background(), &stream.QueryDraftsRequest{
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user and prev
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query draft messages
resp, err := chatClient.QueryDrafts(context.Background(), &stream.QueryDraftsRequest{
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
Prev: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryDraftsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Filter | map[string]any | No | Filter to apply to the query |
| Limit | int | No | - |
| Next | string | No | - |
| Prev | string | No | - |
| Sort | []SortParamRequest | No | Array of sort parameters |
| User | UserRequest | No | - |
| UserID | string | No | - |
ExportChannels
Export channel data to preserve chat history, analyze communication patterns, or integrate with external systems for broader data use.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Export channels
resp, err := chatClient.ExportChannels(context.Background(), &stream.ExportChannelsRequest{
Channels: []stream.ChannelExport{{ID: stream.PtrTo("activity-123"), Type: stream.PtrTo("like")}},
ClearDeletedMessageText: stream.PtrTo(false),
ExportUsers: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with include_soft_deleted_channels and include_truncated_messages
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Export channels
resp, err := chatClient.ExportChannels(context.Background(), &stream.ExportChannelsRequest{
Channels: []stream.ChannelExport{{ID: stream.PtrTo("activity-123"), Type: stream.PtrTo("like")}},
IncludeSoftDeletedChannels: stream.PtrTo(false),
IncludeTruncatedMessages: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with version
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Export channels
resp, err := chatClient.ExportChannels(context.Background(), &stream.ExportChannelsRequest{
Channels: []stream.ChannelExport{{ID: stream.PtrTo("activity-123"), Type: stream.PtrTo("like")}},
Version: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ExportChannelsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Channels | []ChannelExport | Yes | Export options for channels |
| ClearDeletedMessageText | bool | No | Set if deleted message text should be cleared |
| ExportUsers | bool | No | - |
| IncludeSoftDeletedChannels | bool | No | Set if you want to include deleted channels |
| IncludeTruncatedMessages | bool | No | Set if you want to include truncated messages |
| Version | string | No | Export version |
QueryMembers
Retrieve a list of members within a chat, perfect for when you need to understand the participants in a conversation or manage member-related actions.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query members
resp, err := chatClient.QueryMembers(context.Background(), &stream.QueryMembersRequest{
Payload: &"value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MembersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Payload | No | - |
QueryMessageHistory
Access past messages in a chat to review previous interactions, useful for catching up on conversations or retrieving historical data.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query message history
resp, err := chatClient.QueryMessageHistory(context.Background(), &stream.QueryMessageHistoryRequest{
Filter: map[string]any{},
Limit: stream.PtrTo(25),
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev and next
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query message history
resp, err := chatClient.QueryMessageHistory(context.Background(), &stream.QueryMessageHistoryRequest{
Filter: map[string]any{},
Prev: nil,
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryMessageHistoryResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Filter | map[string]any | Yes | Filter to apply to the query |
| Limit | int | No | - |
| Next | string | No | - |
| Prev | string | No | - |
| Sort | []SortParamRequest | No | Array of sort parameters |
GetMessage
Fetch a specific message by its identifier, ideal for when you need detailed information about a particular message.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get message
resp, err := chatClient.GetMessage(context.Background(), &stream.GetMessageRequest{
ID: "activity-123",
ShowDeletedMessage: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| ShowDeletedMessage | bool | No | - |
UpdateMessage
Modify the content of an existing message, useful for correcting errors or updating information within a conversation.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Update message
resp, err := chatClient.UpdateMessage(context.Background(), &stream.UpdateMessageRequest{
ID: "activity-123",
Message: stream.MessageRequest{Attachments: nil},
SkipPush: stream.PtrTo(false),
SkipEnrichURL: false,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Message | MessageRequest | Yes | Message |
| SkipEnrichURL | bool | No | Skip enrich URL |
| SkipPush | bool | No | - |
UpdateMessagePartial
Make selective changes to parts of a message without altering the entire content, perfect for minor edits or updates.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially message update
resp, err := chatClient.UpdateMessagePartial(context.Background(), &stream.UpdateMessagePartialRequest{
ID: "activity-123",
UserID: stream.PtrTo("john"),
SkipPush: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with set and unset
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially message update
resp, err := chatClient.UpdateMessagePartial(context.Background(), &stream.UpdateMessagePartialRequest{
ID: "activity-123",
Set: map[string]any{},
Unset: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user and skip_enrich_url
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially message update
resp, err := chatClient.UpdateMessagePartial(context.Background(), &stream.UpdateMessagePartialRequest{
ID: "activity-123",
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
SkipEnrichURL: false,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateMessagePartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Set | map[string]any | No | Sets new field values |
| SkipEnrichURL | bool | No | Skip enriching the URL in the message |
| SkipPush | bool | No | - |
| Unset | []string | No | Array of field names to unset |
| User | UserRequest | No | - |
| UserID | string | No | - |
DeleteMessage
Remove a message from the chat, useful for managing content or when you need to eliminate outdated or inappropriate information.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete message
resp, err := chatClient.DeleteMessage(context.Background(), &stream.DeleteMessageRequest{
ID: "activity-123",
Hard: stream.PtrTo(false),
DeletedBy: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with delete_for_me
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete message
resp, err := chatClient.DeleteMessage(context.Background(), &stream.DeleteMessageRequest{
ID: "activity-123",
DeleteForMe: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: DeleteMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Hard | bool | No | - |
| DeletedBy | string | No | - |
| DeleteForMe | bool | No | - |
RunMessageAction
Execute a predefined action on a message, ideal for triggering automated responses or workflows based on message content.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Run message command action
resp, err := chatClient.RunMessageAction(context.Background(), &stream.RunMessageActionRequest{
ID: "activity-123",
FormData: map[string]any{},
UserID: stream.PtrTo("john"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MessageActionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| FormData | map[string]any | Yes | ReadOnlyData to execute command with |
| User | UserRequest | No | - |
| UserID | string | No | - |
CommitMessage
Finalize and save changes made to a message, ensuring that all updates are applied and visible to chat participants.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Commit message
resp, err := chatClient.CommitMessage(context.Background(), &stream.CommitMessageRequest{
ID: "activity-123",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MessageActionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
EphemeralMessageUpdate
Update an ephemeral message, which is temporary and may disappear after a set time, useful for time-sensitive or transient information.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Ephemeral message update
resp, err := chatClient.EphemeralMessageUpdate(context.Background(), &stream.EphemeralMessageUpdateRequest{
ID: "activity-123",
UserID: stream.PtrTo("john"),
SkipPush: stream.PtrTo(false),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with set and unset
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Ephemeral message update
resp, err := chatClient.EphemeralMessageUpdate(context.Background(), &stream.EphemeralMessageUpdateRequest{
ID: "activity-123",
Set: map[string]any{},
Unset: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user and skip_enrich_url
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Ephemeral message update
resp, err := chatClient.EphemeralMessageUpdate(context.Background(), &stream.EphemeralMessageUpdateRequest{
ID: "activity-123",
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
SkipEnrichURL: false,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateMessagePartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Set | map[string]any | No | Sets new field values |
| SkipEnrichURL | bool | No | Skip enriching the URL in the message |
| SkipPush | bool | No | - |
| Unset | []string | No | Array of field names to unset |
| User | UserRequest | No | - |
| UserID | string | No | - |
SendReaction
Express your response or feedback to a message by sending an emoji reaction, enhancing interaction and engagement within the chat.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Send reaction
resp, err := chatClient.SendReaction(context.Background(), &stream.SendReactionRequest{
ID: "activity-123",
Reaction: stream.ReactionRequest{Type: "like", CreatedAt: 10},
SkipPush: stream.PtrTo(false),
EnforceUnique: stream.PtrTo(true),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: SendReactionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Reaction | ReactionRequest | Yes | - |
| EnforceUnique | bool | No | Whether to replace all existing user reactions |
| SkipPush | bool | No | Skips any mobile push notifications |
DeleteReaction
Removes a user's reaction from a message, useful for managing or correcting reactions in a conversation.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete reaction
resp, err := chatClient.DeleteReaction(context.Background(), &stream.DeleteReactionRequest{
ID: "activity-123",
Type: "like",
UserID: stream.PtrTo("john"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: DeleteReactionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Type | string | Yes | - |
| UserID | string | No | - |
GetReactions
Retrieves all reactions associated with a specific message, allowing users to view collective feedback or expressions from the chat participants.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get reactions
resp, err := chatClient.GetReactions(context.Background(), &stream.GetReactionsRequest{
ID: "activity-123",
Limit: stream.PtrTo(25),
Offset: stream.PtrTo(0),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetReactionsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Limit | int | No | - |
| Offset | int | No | - |
QueryReactions
Fetches specific reactions based on given criteria, enabling users to filter and analyze reactions for insights or moderation.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
//
resp, err := chatClient.QueryReactions(context.Background(), &stream.QueryReactionsRequest{
ID: "activity-123",
UserID: stream.PtrTo("john"),
Limit: stream.PtrTo(25),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with filter and sort
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
//
resp, err := chatClient.QueryReactions(context.Background(), &stream.QueryReactionsRequest{
ID: "activity-123",
Filter: map[string]any{},
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with next and user
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
//
resp, err := chatClient.QueryReactions(context.Background(), &stream.QueryReactionsRequest{
ID: "activity-123",
Next: nil,
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
//
resp, err := chatClient.QueryReactions(context.Background(), &stream.QueryReactionsRequest{
ID: "activity-123",
Prev: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryReactionsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Filter | map[string]any | No | Filter to apply to the query |
| Limit | int | No | - |
| Next | string | No | - |
| Prev | string | No | - |
| Sort | []SortParamRequest | No | Array of sort parameters |
| User | UserRequest | No | - |
| UserID | string | No | - |
TranslateMessage
Converts a message into a different language, facilitating communication between users who speak different languages.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Translate message
resp, err := chatClient.TranslateMessage(context.Background(), &stream.TranslateMessageRequest{
ID: "activity-123",
Language: "value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MessageActionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Language | string | Yes | Language to translate message to |
UndeleteMessage
Restores a previously deleted message, useful for recovering important information or correcting accidental deletions.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Undelete message
resp, err := chatClient.UndeleteMessage(context.Background(), &stream.UndeleteMessageRequest{
ID: "activity-123",
UndeletedBy: "value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UndeleteMessageResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| UndeletedBy | string | Yes | ID of the user who is undeleting the message |
CastPollVote
Allows a user to submit their vote in a poll, enabling participation and engagement in decision-making processes.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Cast vote
resp, err := chatClient.CastPollVote(context.Background(), &stream.CastPollVoteRequest{
MessageID: "value",
PollID: "poll-123",
UserID: stream.PtrTo("john"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with vote
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Cast vote
resp, err := chatClient.CastPollVote(context.Background(), &stream.CastPollVoteRequest{
MessageID: "value",
PollID: "poll-123",
Vote: &stream.VoteData{AnswerText: "value"},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: PollVoteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MessageID | string | Yes | - |
| PollID | string | Yes | - |
| User | UserRequest | No | - |
| UserID | string | No | - |
| Vote | VoteData | No | Vote data |
DeletePollVote
Removes a user's vote from a poll, providing flexibility to change decisions or correct voting errors.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete vote
resp, err := chatClient.DeletePollVote(context.Background(), &stream.DeletePollVoteRequest{
MessageID: "value",
PollID: "poll-123",
VoteID: "vote-123",
UserID: stream.PtrTo("john"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: PollVoteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MessageID | string | Yes | - |
| PollID | string | Yes | - |
| VoteID | string | Yes | - |
| UserID | string | No | - |
CreateReminder
Sets up a reminder for a specific event or task, helping users stay organized and remember important dates or activities.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Create reminder
resp, err := chatClient.CreateReminder(context.Background(), &stream.CreateReminderRequest{
MessageID: "value",
UserID: stream.PtrTo("john"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with remind_at
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Create reminder
resp, err := chatClient.CreateReminder(context.Background(), &stream.CreateReminderRequest{
MessageID: "value",
RemindAt: &10,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: ReminderResponseData
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MessageID | string | Yes | - |
| RemindAt | float | No | - |
| User | UserRequest | No | - |
| UserID | string | No | - |
UpdateReminder
Modifies an existing reminder, allowing users to adjust details or schedules to accommodate changes in plans.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Updates Reminder
resp, err := chatClient.UpdateReminder(context.Background(), &stream.UpdateReminderRequest{
MessageID: "value",
UserID: stream.PtrTo("john"),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with remind_at
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Updates Reminder
resp, err := chatClient.UpdateReminder(context.Background(), &stream.UpdateReminderRequest{
MessageID: "value",
RemindAt: &10,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateReminderResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MessageID | string | Yes | - |
| RemindAt | float | No | - |
| User | UserRequest | No | - |
| UserID | string | No | - |
DeleteReminder
Removes an existing reminder, useful for clearing completed tasks or canceling unnecessary notifications.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete reminder
resp, err := chatClient.DeleteReminder(context.Background(), &stream.DeleteReminderRequest{
MessageID: "value",
UserID: stream.PtrTo("john"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: DeleteReminderResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MessageID | string | Yes | - |
| UserID | string | No | - |
GetReplies
Retrieve all replies to a specific message, useful for following a conversation thread within a chat.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get replies
resp, err := chatClient.GetReplies(context.Background(), &stream.GetRepliesRequest{
ParentID: "parent-123",
Limit: stream.PtrTo(25),
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with id_gte and id_gt
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get replies
resp, err := chatClient.GetReplies(context.Background(), &stream.GetRepliesRequest{
ParentID: "parent-123",
IDGte: stream.PtrTo("value"),
IDGt: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with id_lte and id_lt
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get replies
resp, err := chatClient.GetReplies(context.Background(), &stream.GetRepliesRequest{
ParentID: "parent-123",
IDLte: stream.PtrTo("value"),
IDLt: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with id_around
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get replies
resp, err := chatClient.GetReplies(context.Background(), &stream.GetRepliesRequest{
ParentID: "parent-123",
IDAround: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetRepliesResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ParentID | string | Yes | - |
| Sort | []SortParamRequest | No | - |
| Limit | int | No | - |
| IDGte | string | No | - |
| IDGt | string | No | - |
| IDLte | string | No | - |
| IDLt | string | No | - |
| IDAround | string | No | - |
QueryMessageFlags
Check the flags associated with messages, helping to identify and manage content that requires moderation or attention.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Message Flags
resp, err := chatClient.QueryMessageFlags(context.Background(), &stream.QueryMessageFlagsRequest{
Payload: &"value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryMessageFlagsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Payload | No | - |
MuteChannel
Temporarily silence notifications from a specific channel, ideal for minimizing distractions without leaving the conversation.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mute channel
resp, err := chatClient.MuteChannel(context.Background(), &stream.MuteChannelRequest{
UserID: stream.PtrTo("john"),
Expiration: stream.PtrTo(10),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with channel_cids
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Mute channel
resp, err := chatClient.MuteChannel(context.Background(), &stream.MuteChannelRequest{
ChannelCids: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: MuteChannelResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ChannelCids | []string | No | Channel CIDs to mute (if multiple channels) |
| Expiration | int | No | Duration of mute in milliseconds |
| User | UserRequest | No | - |
| UserID | string | No | - |
UnmuteChannel
Re-enable notifications for a previously muted channel, allowing you to stay updated on new messages.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Unmute channel
resp, err := chatClient.UnmuteChannel(context.Background(), &stream.UnmuteChannelRequest{
UserID: stream.PtrTo("john"),
Expiration: stream.PtrTo(10),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with channel_cids
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Unmute channel
resp, err := chatClient.UnmuteChannel(context.Background(), &stream.UnmuteChannelRequest{
ChannelCids: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UnmuteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ChannelCids | []string | No | Channel CIDs to mute (if multiple channels) |
| Expiration | int | No | Duration of mute in milliseconds |
| User | UserRequest | No | - |
| UserID | string | No | - |
QueryBannedUsers
List the users who have been banned from a chat, useful for managing community access and enforcing rules.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Banned Users
resp, err := chatClient.QueryBannedUsers(context.Background(), &stream.QueryBannedUsersRequest{
Payload: &"value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryBannedUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Payload | No | - |
QueryFutureChannelBans
View scheduled bans for a channel, helping you anticipate and manage upcoming restrictions on user access.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Future Channel Bans
resp, err := chatClient.QueryFutureChannelBans(context.Background(), &stream.QueryFutureChannelBansRequest{
Payload: &"value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryFutureChannelBansResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Payload | No | - |
QueryReminders
Access a list of reminders set within the chat, ensuring you don't miss important events or tasks.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query reminders
resp, err := chatClient.QueryReminders(context.Background(), &stream.QueryRemindersRequest{
UserID: stream.PtrTo("john"),
Limit: stream.PtrTo(25),
Filter: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with sort and next
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query reminders
resp, err := chatClient.QueryReminders(context.Background(), &stream.QueryRemindersRequest{
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user and prev
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query reminders
resp, err := chatClient.QueryReminders(context.Background(), &stream.QueryRemindersRequest{
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
Prev: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryRemindersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Filter | map[string]any | No | Filter to apply to the query |
| Limit | int | No | - |
| Next | string | No | - |
| Prev | string | No | - |
| Sort | []SortParamRequest | No | Array of sort parameters |
| User | UserRequest | No | - |
| UserID | string | No | - |
GetRetentionPolicy
Retrieve the current data retention policy to understand how long data is stored and managed, ensuring compliance with organizational or regulatory requirements.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get retention policy
resp, err := chatClient.GetRetentionPolicy(context.Background())
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetRetentionPolicyResponse
SetRetentionPolicy
Define or modify the data retention policy to control how long data is retained, helping maintain data governance and compliance.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Set retention policy
resp, err := chatClient.SetRetentionPolicy(context.Background(), &stream.SetRetentionPolicyRequest{
MaxAgeHours: 10,
Policy: "value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: SetRetentionPolicyResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MaxAgeHours | int | Yes | - |
| Policy | string | Yes | - |
DeleteRetentionPolicy
Remove an existing data retention policy when it is no longer needed, helping streamline data management practices.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete retention policy
resp, err := chatClient.DeleteRetentionPolicy(context.Background(), &stream.DeleteRetentionPolicyRequest{
Policy: "value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: DeleteRetentionPolicyResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Policy | string | Yes | - |
GetRetentionPolicyRuns
Access historical records of retention policy executions to monitor compliance and review data management activities over time.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get retention policy runs
resp, err := chatClient.GetRetentionPolicyRuns(context.Background(), &stream.GetRetentionPolicyRunsRequest{
Limit: stream.PtrTo(25),
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
FilterConditions: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev and next
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get retention policy runs
resp, err := chatClient.GetRetentionPolicyRuns(context.Background(), &stream.GetRetentionPolicyRunsRequest{
Prev: nil,
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetRetentionPolicyRunsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| FilterConditions | map[string]any | No | Filter conditions to apply to the query |
| Limit | int | No | - |
| Next | string | No | - |
| Prev | string | No | - |
| Sort | []SortParamRequest | No | Array of sort parameters |
Search
Look for specific messages across channels using keywords, enabling you to quickly find relevant information or past conversations.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Search messages
resp, err := chatClient.Search(context.Background(), &stream.SearchRequest{
Payload: &"value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: SearchResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Payload | No | - |
QuerySegments
Retrieve a list of user segments based on specified criteria, useful for targeted communication and analysis.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query segments
resp, err := chatClient.QuerySegments(context.Background(), &stream.QuerySegmentsRequest{
Filter: map[string]any{},
Limit: stream.PtrTo(25),
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev and next
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query segments
resp, err := chatClient.QuerySegments(context.Background(), &stream.QuerySegmentsRequest{
Filter: map[string]any{},
Prev: nil,
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QuerySegmentsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Filter | map[string]any | Yes | Filter to apply to the query |
| Limit | int | No | - |
| Next | string | No | - |
| Prev | string | No | - |
| Sort | []SortParamRequest | No | Array of sort parameters |
GetSegment
Obtain detailed information about a specific user segment, aiding in personalized engagement and insights.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get segment
resp, err := chatClient.GetSegment(context.Background(), &stream.GetSegmentRequest{
ID: "activity-123",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetSegmentResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
DeleteSegment
Remove a specific segment from your chat application, useful for managing and organizing user groups or data collections.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete segment
resp, err := chatClient.DeleteSegment(context.Background(), &stream.DeleteSegmentRequest{
ID: "activity-123",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
DeleteSegmentTargets
Remove specified targets from a segment, helpful for updating or refining the members or elements within a segment.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Delete targets from a segment
resp, err := chatClient.DeleteSegmentTargets(context.Background(), &stream.DeleteSegmentTargetsRequest{
ID: "activity-123",
TargetIds: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| TargetIds | []string | Yes | Target IDs |
SegmentTargetExists
Verify if a particular target is part of a segment, useful for ensuring data accuracy or confirming membership before performing operations.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Check whether a target exists in a segment
resp, err := chatClient.SegmentTargetExists(context.Background(), &stream.SegmentTargetExistsRequest{
ID: "activity-123",
TargetID: "value",
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| TargetID | string | Yes | - |
QuerySegmentTargets
Retrieve a list of targets within a segment, ideal for gaining insights or performing actions on specific segment members.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query segment targets
resp, err := chatClient.QuerySegmentTargets(context.Background(), &stream.QuerySegmentTargetsRequest{
ID: "activity-123",
Limit: stream.PtrTo(25),
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with Filter and next
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query segment targets
resp, err := chatClient.QuerySegmentTargets(context.Background(), &stream.QuerySegmentTargetsRequest{
ID: "activity-123",
Filter: map[string]any{},
Next: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query segment targets
resp, err := chatClient.QuerySegmentTargets(context.Background(), &stream.QuerySegmentTargetsRequest{
ID: "activity-123",
Prev: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QuerySegmentTargetsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ID | string | Yes | - |
| Filter | map[string]any | No | - |
| Sort | []SortParamRequest | No | - |
| Limit | int | No | Limit |
| Next | string | No | Next |
| Prev | string | No | Prev |
QueryTeamUsageStats
Obtain detailed statistics on team usage to evaluate engagement levels, optimize resource allocation, and improve team performance.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Team Usage Statistics
resp, err := chatClient.QueryTeamUsageStats(context.Background(), &stream.QueryTeamUsageStatsRequest{
Limit: stream.PtrTo(25),
EndDate: stream.PtrTo("value"),
Month: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with next and start_date
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Team Usage Statistics
resp, err := chatClient.QueryTeamUsageStats(context.Background(), &stream.QueryTeamUsageStatsRequest{
Next: nil,
StartDate: stream.PtrTo("value"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryTeamUsageStatsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| EndDate | string | 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 | string | No | Month in YYYY-MM format (e.g., '2026-01'). Mutually exclusive with start_date/end_date. Returns a... |
| Next | string | No | Cursor for pagination to fetch next page of teams |
| StartDate | string | No | Start date in YYYY-MM-DD format. Used with end_date for custom date range. Returns daily breakdown. |
QueryThreads
Search and filter chat threads based on specific criteria, enabling efficient navigation and management of conversation histories.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Threads
resp, err := chatClient.QueryThreads(context.Background(), &stream.QueryThreadsRequest{
UserID: stream.PtrTo("john"),
Limit: stream.PtrTo(25),
Filter: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with sort and participant_limit
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Threads
resp, err := chatClient.QueryThreads(context.Background(), &stream.QueryThreadsRequest{
Sort: []stream.SortParamRequest{{Direction: stream.PtrTo(-1), Field: stream.PtrTo("created_at"), Type: stream.PtrTo("like")}},
ParticipantLimit: stream.PtrTo(10),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with prev and reply_limit
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Threads
resp, err := chatClient.QueryThreads(context.Background(), &stream.QueryThreadsRequest{
Prev: nil,
ReplyLimit: stream.PtrTo(10),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with member_limit and user
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Query Threads
resp, err := chatClient.QueryThreads(context.Background(), &stream.QueryThreadsRequest{
MemberLimit: stream.PtrTo(10),
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: QueryThreadsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Filter | map[string]any | No | Filter to apply to the query |
| Limit | int | No | - |
| MemberLimit | int | No | - |
| Next | string | No | - |
| ParticipantLimit | int | No | Limit the number of participants returned per each thread |
| Prev | string | No | - |
| ReplyLimit | int | No | Limit the number of replies returned per each thread |
| Sort | []SortParamRequest | No | Array of sort parameters |
| User | UserRequest | No | - |
| UserID | string | No | - |
GetThread
Retrieve detailed information about a specific chat thread, useful for reviewing conversation content or metadata.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get Thread
resp, err := chatClient.GetThread(context.Background(), &stream.GetThreadRequest{
MessageID: "value",
ReplyLimit: stream.PtrTo(10),
ParticipantLimit: stream.PtrTo(10),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with member_limit
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Get Thread
resp, err := chatClient.GetThread(context.Background(), &stream.GetThreadRequest{
MessageID: "value",
MemberLimit: stream.PtrTo(10),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: GetThreadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MessageID | string | Yes | - |
| ReplyLimit | int | No | - |
| ParticipantLimit | int | No | - |
| MemberLimit | int | No | - |
UpdateThreadPartial
Make selective updates to a chat thread without altering its entire content, useful for modifying specific details or attributes.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially update thread
resp, err := chatClient.UpdateThreadPartial(context.Background(), &stream.UpdateThreadPartialRequest{
MessageID: "value",
UserID: stream.PtrTo("john"),
Unset: nil,
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Example: with user and set
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Partially update thread
resp, err := chatClient.UpdateThreadPartial(context.Background(), &stream.UpdateThreadPartialRequest{
MessageID: "value",
User: &stream.UserRequest{ID: "activity-123", Custom: map[string]any{}},
Set: map[string]any{},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UpdateThreadPartialResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MessageID | string | Yes | - |
| Set | map[string]any | No | Sets new field values |
| Unset | []string | No | Array of field names to unset |
| User | UserRequest | No | - |
| UserID | string | No | - |
UnreadCounts
Check the number of unread messages in chat threads, helping users stay informed about new activity and prioritize responses.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Unread counts
resp, err := chatClient.UnreadCounts(context.Background(), &stream.UnreadCountsRequest{
UserID: stream.PtrTo("john"),
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: WrappedUnreadCountsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| UserID | string | No | - |
UnreadCountsBatch
Obtain unread message counts for multiple chat threads simultaneously, providing a comprehensive overview of pending messages.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Batch unread counts
resp, err := chatClient.UnreadCountsBatch(context.Background(), &stream.UnreadCountsBatchRequest{
UserIds: []string{"user-1", "user-2"},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: UnreadCountsBatchResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| UserIds | []string | Yes | - |
SendUserCustomEvent
Trigger a custom event associated with a user, useful for tracking user interactions or implementing personalized features.
Example
package main
import (
"context"
"fmt"
stream "github.com/GetStream/getstream-go/v3"
)
func main() {
// Initialize client
client, _ := stream.NewClient(apiKey, apiSecret)
chatClient := client.Chat()
// Send user event
resp, err := chatClient.SendUserCustomEvent(context.Background(), &stream.SendUserCustomEventRequest{
UserID: "john",
Event: stream.UserCustomEventRequest{Type: "like", Custom: map[string]any{}},
})
if err != nil {
panic(err)
}
fmt.Println(resp)
}Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| UserID | string | Yes | - |
| Event | UserCustomEventRequest | Yes | - |
Types Reference
This section documents the types/interfaces used in this API. These types are extracted from the OpenAPI specification.
Attachment
An attachment is a message object that represents a file uploaded by a user.
type Attachment struct {
Actions []Action `json:"actions,omitempty"`
AssetUrl string `json:"asset_url,omitempty"`
AuthorIcon string `json:"author_icon,omitempty"`
AuthorLink string `json:"author_link,omitempty"`
AuthorName string `json:"author_name,omitempty"`
Color string `json:"color,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Fallback string `json:"fallback,omitempty"`
Fields []Field `json:"fields,omitempty"`
Footer string `json:"footer,omitempty"`
FooterIcon string `json:"footer_icon,omitempty"`
Giphy Images `json:"giphy,omitempty"`
ImageUrl string `json:"image_url,omitempty"`
OgScrapeUrl string `json:"og_scrape_url,omitempty"`
OriginalHeight int `json:"original_height,omitempty"`
OriginalWidth int `json:"original_width,omitempty"`
Pretext string `json:"pretext,omitempty"`
Text string `json:"text,omitempty"`
ThumbUrl string `json:"thumb_url,omitempty"`
Title string `json:"title,omitempty"`
TitleLink string `json:"title_link,omitempty"`
Type string `json:"type,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | map[string]interface{} | Yes | |
| actions | []Action | No | |
| asset_url | string | No | |
| author_icon | string | No | |
| author_link | string | No | |
| author_name | string | No | |
| color | string | No | |
| fallback | string | No | |
| fields | []Field | No | |
| footer | string | No | |
| footer_icon | string | No | |
| giphy | Images | No | |
| image_url | string | No | |
| og_scrape_url | string | No | |
| original_height | int | No | |
| original_width | int | No | |
| pretext | string | No | |
| text | string | No | |
| thumb_url | string | No | |
| title | string | No | |
| title_link | string | No | |
| type | string | No | Attachment type (e.g. image, video, url) |
BanResponse
type BanResponse struct {
BannedBy UserResponse `json:"banned_by,omitempty"`
Channel ChannelResponse `json:"channel,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Expires float64 `json:"expires,omitempty"`
Reason string `json:"reason,omitempty"`
Shadow bool `json:"shadow,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | |
| banned_by | UserResponse | No | |
| channel | ChannelResponse | No | |
| expires | float64 | No | |
| reason | string | No | |
| shadow | bool | No | |
| user | UserResponse | No |
BlockListOptions
type BlockListOptions struct {
Behavior string `json:"behavior,omitempty"`
Blocklist string `json:"blocklist,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| behavior | string | Yes | Blocklist behavior. One of: flag, block, shadow_block |
| blocklist | string | Yes | Blocklist name |
CampaignChannelTemplate
type CampaignChannelTemplate struct {
Custom map[string]interface{} `json:"custom,omitempty"`
Id string `json:"id,omitempty"`
Members []string `json:"members,omitempty"`
MembersTemplate []CampaignChannelMember `json:"members_template,omitempty"`
Team string `json:"team,omitempty"`
Type string `json:"type,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | map[string]interface{} | Yes | |
| type | string | Yes | |
| id | string | No | |
| members | []string | No | |
| members_template | []CampaignChannelMember | No | |
| team | string | No |
CampaignMessageTemplate
type CampaignMessageTemplate struct {
Attachments []Attachment `json:"attachments,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
PollId string `json:"poll_id,omitempty"`
Searchable bool `json:"searchable,omitempty"`
Text string `json:"text,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | []Attachment | Yes | |
| custom | map[string]interface{} | Yes | |
| poll_id | string | Yes | |
| searchable | bool | Yes | |
| text | string | Yes |
CampaignResponse
type CampaignResponse struct {
ChannelTemplate CampaignChannelTemplate `json:"channel_template,omitempty"`
CreateChannels bool `json:"create_channels,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
Id string `json:"id,omitempty"`
MessageTemplate CampaignMessageTemplate `json:"message_template,omitempty"`
Name string `json:"name,omitempty"`
ScheduledFor float64 `json:"scheduled_for,omitempty"`
SegmentIds []string `json:"segment_ids,omitempty"`
Segments []Segment `json:"segments,omitempty"`
Sender UserResponse `json:"sender,omitempty"`
SenderId string `json:"sender_id,omitempty"`
SenderMode string `json:"sender_mode,omitempty"`
SenderVisibility string `json:"sender_visibility,omitempty"`
ShowChannels bool `json:"show_channels,omitempty"`
SkipPush bool `json:"skip_push,omitempty"`
SkipWebhook bool `json:"skip_webhook,omitempty"`
Stats CampaignStatsResponse `json:"stats,omitempty"`
Status string `json:"status,omitempty"`
StopAt float64 `json:"stop_at,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
UserIds []string `json:"user_ids,omitempty"`
Users []UserResponse `json:"users,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| create_channels | bool | Yes | |
| created_at | float64 | Yes | |
| description | string | Yes | |
| id | string | Yes | |
| name | string | Yes | |
| segment_ids | []string | Yes | |
| segments | []Segment | Yes | |
| sender_id | string | Yes | |
| sender_mode | string | Yes | |
| sender_visibility | string | Yes | |
| show_channels | bool | Yes | |
| skip_push | bool | Yes | |
| skip_webhook | bool | Yes | |
| stats | CampaignStatsResponse | Yes | |
| status | string | Yes | |
| updated_at | float64 | Yes | |
| user_ids | []string | Yes | |
| users | []UserResponse | Yes | |
| channel_template | CampaignChannelTemplate | No | |
| message_template | CampaignMessageTemplate | No | |
| scheduled_for | float64 | No | |
| sender | UserResponse | No | |
| stop_at | float64 | No |
CampaignStatsResponse
type CampaignStatsResponse struct {
Progress float64 `json:"progress,omitempty"`
StatsChannelsCreated int `json:"stats_channels_created,omitempty"`
StatsCompletedAt float64 `json:"stats_completed_at,omitempty"`
StatsMessagesSent int `json:"stats_messages_sent,omitempty"`
StatsStartedAt float64 `json:"stats_started_at,omitempty"`
StatsUsersRead int `json:"stats_users_read,omitempty"`
StatsUsersSent int `json:"stats_users_sent,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| progress | float64 | Yes | |
| stats_channels_created | int | Yes | |
| stats_completed_at | float64 | Yes | |
| stats_messages_sent | int | Yes | |
| stats_started_at | float64 | Yes | |
| stats_users_read | int | Yes | |
| stats_users_sent | int | Yes |
ChannelBatchMemberRequest
type ChannelBatchMemberRequest struct {
ChannelRole string `json:"channel_role,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | |
| channel_role | string | No |
ChannelBatchUpdateResponse
Basic response information
type ChannelBatchUpdateResponse struct {
Duration string `json:"duration,omitempty"`
TaskId string `json:"task_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| task_id | string | No |
ChannelConfig
type ChannelConfig struct {
AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"`
Automod string `json:"automod,omitempty"`
AutomodBehavior string `json:"automod_behavior,omitempty"`
AutomodThresholds Thresholds `json:"automod_thresholds,omitempty"`
Blocklist string `json:"blocklist,omitempty"`
BlocklistBehavior string `json:"blocklist_behavior,omitempty"`
Blocklists []BlockListOptions `json:"blocklists,omitempty"`
ChatPreferences ChatPreferences `json:"chat_preferences,omitempty"`
Commands []string `json:"commands,omitempty"`
ConnectEvents bool `json:"connect_events,omitempty"`
CountMessages bool `json:"count_messages,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CustomEvents bool `json:"custom_events,omitempty"`
DeliveryEvents bool `json:"delivery_events,omitempty"`
MarkMessagesPending bool `json:"mark_messages_pending,omitempty"`
MaxMessageLength int `json:"max_message_length,omitempty"`
Mutes bool `json:"mutes,omitempty"`
Name string `json:"name,omitempty"`
PartitionSize int `json:"partition_size,omitempty"`
PartitionTtl string `json:"partition_ttl,omitempty"`
Polls bool `json:"polls,omitempty"`
PushLevel string `json:"push_level,omitempty"`
PushNotifications bool `json:"push_notifications,omitempty"`
Quotes bool `json:"quotes,omitempty"`
Reactions bool `json:"reactions,omitempty"`
ReadEvents bool `json:"read_events,omitempty"`
Reminders bool `json:"reminders,omitempty"`
Replies bool `json:"replies,omitempty"`
Search bool `json:"search,omitempty"`
SharedLocations bool `json:"shared_locations,omitempty"`
SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs,omitempty"`
TypingEvents bool `json:"typing_events,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
Uploads bool `json:"uploads,omitempty"`
UrlEnrichment bool `json:"url_enrichment,omitempty"`
UserMessageReminders bool `json:"user_message_reminders,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | string | Yes | |
| automod_behavior | string | Yes | |
| commands | []string | Yes | List of commands that channel supports |
| connect_events | bool | Yes | |
| count_messages | bool | Yes | |
| created_at | float64 | Yes | |
| custom_events | bool | Yes | |
| delivery_events | bool | Yes | |
| mark_messages_pending | bool | Yes | |
| max_message_length | int | Yes | |
| mutes | bool | Yes | |
| name | string | 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 | float64 | Yes | |
| uploads | bool | Yes | |
| url_enrichment | bool | Yes | |
| user_message_reminders | bool | Yes | |
| allowed_flag_reasons | []string | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | string | No | |
| blocklists | []BlockListOptions | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | int | No | |
| partition_ttl | string | No | |
| push_level | string | No |
ChannelDataUpdate
type ChannelDataUpdate struct {
AutoTranslationEnabled bool `json:"auto_translation_enabled,omitempty"`
AutoTranslationLanguage string `json:"auto_translation_language,omitempty"`
ConfigOverrides ChannelConfig `json:"config_overrides,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Frozen bool `json:"frozen,omitempty"`
Team string `json:"team,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | bool | No | |
| auto_translation_language | string | No | |
| config_overrides | ChannelConfig | No | |
| custom | map[string]interface{} | No | |
| disabled | bool | No | |
| frozen | bool | No | |
| team | string | No |
ChannelExport
type ChannelExport struct {
Cid string `json:"cid,omitempty"`
Id string `json:"id,omitempty"`
MessagesSince float64 `json:"messages_since,omitempty"`
MessagesUntil float64 `json:"messages_until,omitempty"`
Type string `json:"type,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | No | |
| id | string | No | Channel ID |
| messages_since | float64 | No | Date to export messages since |
| messages_until | float64 | No | Date to export messages until |
| type | string | No | Channel type |
ChannelInput
type ChannelInput struct {
AutoTranslationEnabled bool `json:"auto_translation_enabled,omitempty"`
AutoTranslationLanguage string `json:"auto_translation_language,omitempty"`
ConfigOverrides ChannelConfig `json:"config_overrides,omitempty"`
CreatedBy UserRequest `json:"created_by,omitempty"`
CreatedById string `json:"created_by_id,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Disabled bool `json:"disabled,omitempty"`
FilterTags []string `json:"filter_tags,omitempty"`
Frozen bool `json:"frozen,omitempty"`
Invites []ChannelMemberRequest `json:"invites,omitempty"`
Members []ChannelMemberRequest `json:"members,omitempty"`
Team string `json:"team,omitempty"`
TruncatedById string `json:"truncated_by_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | bool | No | Enable or disable auto translation |
| auto_translation_language | string | No | Switch auto translation language |
| config_overrides | ChannelConfig | No | |
| created_by | UserRequest | No | |
| created_by_id | string | No | |
| custom | map[string]interface{} | No | |
| disabled | bool | No | |
| filter_tags | []string | No | |
| frozen | bool | No | Freeze or unfreeze the channel |
| invites | []ChannelMemberRequest | No | |
| members | []ChannelMemberRequest | No | |
| team | string | No | Team the channel belongs to (if multi-tenant mode is enabled) |
| truncated_by_id | string | No |
ChannelInputRequest
type ChannelInputRequest struct {
AutoTranslationEnabled bool `json:"auto_translation_enabled,omitempty"`
AutoTranslationLanguage string `json:"auto_translation_language,omitempty"`
ConfigOverrides ConfigOverridesRequest `json:"config_overrides,omitempty"`
CreatedBy UserRequest `json:"created_by,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Frozen bool `json:"frozen,omitempty"`
Invites []ChannelMemberRequest `json:"invites,omitempty"`
Members []ChannelMemberRequest `json:"members,omitempty"`
Team string `json:"team,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| auto_translation_enabled | bool | No | |
| auto_translation_language | string | No | |
| config_overrides | ConfigOverridesRequest | No | |
| created_by | UserRequest | No | |
| custom | map[string]interface{} | No | |
| disabled | bool | No | |
| frozen | bool | No | |
| invites | []ChannelMemberRequest | No | |
| members | []ChannelMemberRequest | No | |
| team | string | No |
ChannelMemberRequest
type ChannelMemberRequest struct {
ChannelRole string `json:"channel_role,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
User UserResponse `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | |
| channel_role | string | No | Role of the member in the channel |
| custom | map[string]interface{} | No | |
| user | UserResponse | No |
ChannelMemberResponse
type ChannelMemberResponse struct {
ArchivedAt float64 `json:"archived_at,omitempty"`
BanExpires float64 `json:"ban_expires,omitempty"`
Banned bool `json:"banned,omitempty"`
ChannelRole string `json:"channel_role,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
DeletedMessages []string `json:"deleted_messages,omitempty"`
InviteAcceptedAt float64 `json:"invite_accepted_at,omitempty"`
InviteRejectedAt float64 `json:"invite_rejected_at,omitempty"`
Invited bool `json:"invited,omitempty"`
IsModerator bool `json:"is_moderator,omitempty"`
NotificationsMuted bool `json:"notifications_muted,omitempty"`
PinnedAt float64 `json:"pinned_at,omitempty"`
Role string `json:"role,omitempty"`
ShadowBanned bool `json:"shadow_banned,omitempty"`
Status string `json:"status,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | bool | Yes | Whether member is banned this channel or not |
| channel_role | string | Yes | Role of the member in the channel |
| created_at | float64 | Yes | Date/time of creation |
| custom | map[string]interface{} | Yes | |
| notifications_muted | bool | Yes | |
| shadow_banned | bool | Yes | Whether member is shadow banned in this channel or not |
| updated_at | float64 | Yes | Date/time of the last update |
| archived_at | float64 | No | |
| ban_expires | float64 | No | Expiration date of the ban |
| deleted_at | float64 | No | |
| deleted_messages | []string | No | |
| invite_accepted_at | float64 | No | Date when invite was accepted |
| invite_rejected_at | float64 | 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 | float64 | No | |
| role | string | No | Permission level of the member in the channel (DEPRECATED: use channel_role i... |
| status | string | No | |
| user | UserResponse | No | |
| user_id | string | No |
ChannelMute
type ChannelMute struct {
Channel ChannelResponse `json:"channel,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Expires float64 `json:"expires,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | Date/time of creation |
| updated_at | float64 | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel that is muted |
| expires | float64 | No | Date/time of mute expiration |
| user | UserResponse | No | Owner of channel mute |
ChannelPushPreferencesResponse
type ChannelPushPreferencesResponse struct {
ChatLevel string `json:"chat_level,omitempty"`
ChatPreferences ChatPreferencesResponse `json:"chat_preferences,omitempty"`
DisabledUntil float64 `json:"disabled_until,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| chat_level | string | No | |
| chat_preferences | ChatPreferencesResponse | No | |
| disabled_until | float64 | No |
ChannelResponse
Represents channel in chat
type ChannelResponse struct {
AutoTranslationEnabled bool `json:"auto_translation_enabled,omitempty"`
AutoTranslationLanguage string `json:"auto_translation_language,omitempty"`
Blocked bool `json:"blocked,omitempty"`
Cid string `json:"cid,omitempty"`
Config ChannelConfigWithInfo `json:"config,omitempty"`
Cooldown int `json:"cooldown,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CreatedBy UserResponse `json:"created_by,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
Disabled bool `json:"disabled,omitempty"`
FilterTags []string `json:"filter_tags,omitempty"`
Frozen bool `json:"frozen,omitempty"`
Hidden bool `json:"hidden,omitempty"`
HideMessagesBefore float64 `json:"hide_messages_before,omitempty"`
Id string `json:"id,omitempty"`
LastMessageAt float64 `json:"last_message_at,omitempty"`
MemberCount int `json:"member_count,omitempty"`
Members []ChannelMemberResponse `json:"members,omitempty"`
MessageCount int `json:"message_count,omitempty"`
MuteExpiresAt float64 `json:"mute_expires_at,omitempty"`
Muted bool `json:"muted,omitempty"`
OwnCapabilities []ChannelOwnCapability `json:"own_capabilities,omitempty"`
Team string `json:"team,omitempty"`
TruncatedAt float64 `json:"truncated_at,omitempty"`
TruncatedBy UserResponse `json:"truncated_by,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | Yes | Channel CID (<type>:<id>) |
| created_at | float64 | Yes | Date/time of creation |
| custom | map[string]interface{} | Yes | Custom data for this object |
| disabled | bool | Yes | |
| frozen | bool | Yes | Whether channel is frozen or not |
| id | string | Yes | Channel unique ID |
| type | string | Yes | Type of the channel |
| updated_at | float64 | Yes | Date/time of the last update |
| auto_translation_enabled | bool | No | Whether auto translation is enabled or not |
| auto_translation_language | string | No | Language to translate to when auto translation is active |
| blocked | bool | No | Whether this channel is blocked by current user or not |
| config | ChannelConfigWithInfo | No | Channel configuration |
| cooldown | int | No | Cooldown period after sending each message |
| created_by | UserResponse | No | Creator of the channel |
| deleted_at | float64 | No | Date/time of deletion |
| filter_tags | []string | No | List of filter tags associated with the channel |
| hidden | bool | No | Whether this channel is hidden by current user or not |
| hide_messages_before | float64 | No | Date since when the message history is accessible |
| last_message_at | float64 | No | Date of the last message sent |
| member_count | int | No | Number of members in the channel |
| members | []ChannelMemberResponse | No | List of channel members (max 100) |
| message_count | int | No | Number of messages in the channel |
| mute_expires_at | float64 | No | Date of mute expiration |
| muted | bool | No | Whether this channel is muted or not |
| own_capabilities | []ChannelOwnCapability | No | List of channel capabilities of authenticated user |
| team | string | No | Team the channel belongs to (multi-tenant only) |
| truncated_at | float64 | No | Date of the latest truncation of the channel |
| truncated_by | UserResponse | No |
ChannelStateResponse
type ChannelStateResponse struct {
ActiveLiveLocations []SharedLocationResponseData `json:"active_live_locations,omitempty"`
Channel ChannelResponse `json:"channel,omitempty"`
Draft DraftResponse `json:"draft,omitempty"`
Duration string `json:"duration,omitempty"`
Hidden bool `json:"hidden,omitempty"`
HideMessagesBefore float64 `json:"hide_messages_before,omitempty"`
Members []ChannelMemberResponse `json:"members,omitempty"`
Membership ChannelMemberResponse `json:"membership,omitempty"`
Messages []MessageResponse `json:"messages,omitempty"`
PendingMessages []PendingMessageResponse `json:"pending_messages,omitempty"`
PinnedMessages []MessageResponse `json:"pinned_messages,omitempty"`
PushPreferences ChannelPushPreferencesResponse `json:"push_preferences,omitempty"`
Read []ReadStateResponse `json:"read,omitempty"`
Threads []ThreadStateResponse `json:"threads,omitempty"`
WatcherCount int `json:"watcher_count,omitempty"`
Watchers []UserResponse `json:"watchers,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| members | []ChannelMemberResponse | Yes | |
| messages | []MessageResponse | Yes | |
| pinned_messages | []MessageResponse | Yes | |
| threads | []ThreadStateResponse | Yes | |
| active_live_locations | []SharedLocationResponseData | No | |
| channel | ChannelResponse | No | |
| draft | DraftResponse | No | |
| hidden | bool | No | |
| hide_messages_before | float64 | No | |
| membership | ChannelMemberResponse | No | |
| pending_messages | []PendingMessageResponse | No | |
| push_preferences | ChannelPushPreferencesResponse | No | |
| read | []ReadStateResponse | No | |
| watcher_count | int | No | |
| watchers | []UserResponse | No |
ChannelStateResponseFields
type ChannelStateResponseFields struct {
ActiveLiveLocations []SharedLocationResponseData `json:"active_live_locations,omitempty"`
Channel ChannelResponse `json:"channel,omitempty"`
Draft DraftResponse `json:"draft,omitempty"`
Hidden bool `json:"hidden,omitempty"`
HideMessagesBefore float64 `json:"hide_messages_before,omitempty"`
Members []ChannelMemberResponse `json:"members,omitempty"`
Membership ChannelMemberResponse `json:"membership,omitempty"`
Messages []MessageResponse `json:"messages,omitempty"`
PendingMessages []PendingMessageResponse `json:"pending_messages,omitempty"`
PinnedMessages []MessageResponse `json:"pinned_messages,omitempty"`
PushPreferences ChannelPushPreferencesResponse `json:"push_preferences,omitempty"`
Read []ReadStateResponse `json:"read,omitempty"`
Threads []ThreadStateResponse `json:"threads,omitempty"`
WatcherCount int `json:"watcher_count,omitempty"`
Watchers []UserResponse `json:"watchers,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| members | []ChannelMemberResponse | Yes | List of channel members |
| messages | []MessageResponse | Yes | List of channel messages |
| pinned_messages | []MessageResponse | Yes | List of pinned messages in the channel |
| threads | []ThreadStateResponse | Yes | |
| active_live_locations | []SharedLocationResponseData | No | Active live locations in the channel |
| channel | ChannelResponse | No | |
| draft | DraftResponse | No | |
| hidden | bool | No | Whether this channel is hidden or not |
| hide_messages_before | float64 | No | Messages before this date are hidden from the user |
| membership | ChannelMemberResponse | No | Current user membership object |
| pending_messages | []PendingMessageResponse | No | Pending messages that this user has sent |
| push_preferences | ChannelPushPreferencesResponse | No | |
| read | []ReadStateResponse | No | List of read states |
| watcher_count | int | No | Number of channel watchers |
| watchers | []UserResponse | No | List of user who is watching the channel |
ChatPreferences
type ChatPreferences struct {
ChannelMentions string `json:"channel_mentions,omitempty"`
DefaultPreference string `json:"default_preference,omitempty"`
DirectMentions string `json:"direct_mentions,omitempty"`
DistinctChannelMessages string `json:"distinct_channel_messages,omitempty"`
GroupMentions string `json:"group_mentions,omitempty"`
HereMentions string `json:"here_mentions,omitempty"`
RoleMentions string `json:"role_mentions,omitempty"`
ThreadReplies string `json:"thread_replies,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_mentions | string | No | |
| default_preference | string | No | |
| direct_mentions | string | No | |
| distinct_channel_messages | string | No | |
| group_mentions | string | No | |
| here_mentions | string | No | |
| role_mentions | string | No | |
| thread_replies | string | No |
Command
Represents custom chat command
type Command struct {
Args string `json:"args,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name,omitempty"`
Set string `json:"set,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| args | string | Yes | Arguments help text, shown in commands auto-completion |
| description | string | Yes | Description, shown in commands auto-completion |
| name | string | Yes | Unique command name |
| set | string | Yes | Set name used for grouping commands |
| created_at | float64 | No | Date/time of creation |
| updated_at | float64 | No | Date/time of the last update |
ConfigOverridesRequest
Channel configuration overrides
type ConfigOverridesRequest struct {
Blocklist string `json:"blocklist,omitempty"`
BlocklistBehavior string `json:"blocklist_behavior,omitempty"`
ChatPreferences ChatPreferences `json:"chat_preferences,omitempty"`
Commands []string `json:"commands,omitempty"`
CountMessages bool `json:"count_messages,omitempty"`
Grants map[string]interface{} `json:"grants,omitempty"`
MaxMessageLength int `json:"max_message_length,omitempty"`
PushLevel string `json:"push_level,omitempty"`
Quotes bool `json:"quotes,omitempty"`
Reactions bool `json:"reactions,omitempty"`
Replies bool `json:"replies,omitempty"`
SharedLocations bool `json:"shared_locations,omitempty"`
TypingEvents bool `json:"typing_events,omitempty"`
Uploads bool `json:"uploads,omitempty"`
UrlEnrichment bool `json:"url_enrichment,omitempty"`
UserMessageReminders bool `json:"user_message_reminders,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklist | string | No | Blocklist name |
| blocklist_behavior | string | No | Blocklist behavior. One of: flag, block |
| chat_preferences | ChatPreferences | No | |
| commands | []string | No | List of available commands |
| count_messages | bool | No | Enable/disable message counting |
| grants | map[string]interface{} | No | Permission grants modifiers |
| max_message_length | int | No | Maximum message length |
| push_level | string | 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
type CreateChannelTypeResponse struct {
AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"`
Automod string `json:"automod,omitempty"`
AutomodBehavior string `json:"automod_behavior,omitempty"`
AutomodThresholds Thresholds `json:"automod_thresholds,omitempty"`
Blocklist string `json:"blocklist,omitempty"`
BlocklistBehavior string `json:"blocklist_behavior,omitempty"`
Blocklists []BlockListOptions `json:"blocklists,omitempty"`
ChatPreferences ChatPreferences `json:"chat_preferences,omitempty"`
Commands []string `json:"commands,omitempty"`
ConnectEvents bool `json:"connect_events,omitempty"`
CountMessages bool `json:"count_messages,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CustomEvents bool `json:"custom_events,omitempty"`
DeliveryEvents bool `json:"delivery_events,omitempty"`
Duration string `json:"duration,omitempty"`
Grants map[string]interface{} `json:"grants,omitempty"`
MarkMessagesPending bool `json:"mark_messages_pending,omitempty"`
MaxMessageLength int `json:"max_message_length,omitempty"`
Mutes bool `json:"mutes,omitempty"`
Name string `json:"name,omitempty"`
PartitionSize int `json:"partition_size,omitempty"`
PartitionTtl string `json:"partition_ttl,omitempty"`
Permissions []PolicyRequest `json:"permissions,omitempty"`
Polls bool `json:"polls,omitempty"`
PushLevel string `json:"push_level,omitempty"`
PushNotifications bool `json:"push_notifications,omitempty"`
Quotes bool `json:"quotes,omitempty"`
Reactions bool `json:"reactions,omitempty"`
ReadEvents bool `json:"read_events,omitempty"`
Reminders bool `json:"reminders,omitempty"`
Replies bool `json:"replies,omitempty"`
Search bool `json:"search,omitempty"`
SharedLocations bool `json:"shared_locations,omitempty"`
SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs,omitempty"`
TypingEvents bool `json:"typing_events,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
Uploads bool `json:"uploads,omitempty"`
UrlEnrichment bool `json:"url_enrichment,omitempty"`
UserMessageReminders bool `json:"user_message_reminders,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | string | Yes | |
| automod_behavior | string | Yes | |
| commands | []string | Yes | |
| connect_events | bool | Yes | |
| count_messages | bool | Yes | |
| created_at | float64 | Yes | |
| custom_events | bool | Yes | |
| delivery_events | bool | Yes | |
| duration | string | Yes | |
| grants | map[string]interface{} | Yes | |
| mark_messages_pending | bool | Yes | |
| max_message_length | int | Yes | |
| mutes | bool | Yes | |
| name | string | Yes | |
| permissions | []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 | float64 | Yes | |
| uploads | bool | Yes | |
| url_enrichment | bool | Yes | |
| user_message_reminders | bool | Yes | |
| allowed_flag_reasons | []string | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | string | No | |
| blocklists | []BlockListOptions | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | int | No | |
| partition_ttl | string | No | |
| push_level | string | No |
CreateCommandResponse
type CreateCommandResponse struct {
Command Command `json:"command,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| command | Command | No | Command object |
CustomEvent
type CustomEvent struct {
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
ReceivedAt float64 `json:"received_at,omitempty"`
Type string `json:"type,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | |
| custom | map[string]interface{} | Yes | |
| type | string | Yes | |
| received_at | float64 | No |
Data
type Data struct {
Id string `json:"id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes |
DeleteChannelResponse
Basic response information
type DeleteChannelResponse struct {
Channel ChannelResponse `json:"channel,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| channel | ChannelResponse | No |
DeleteChannelsResponse
type DeleteChannelsResponse struct {
Duration string `json:"duration,omitempty"`
Result map[string]interface{} `json:"result,omitempty"`
TaskId string `json:"task_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| result | map[string]interface{} | No | Map of channel IDs and their deletion results |
| task_id | string | No |
DeleteCommandResponse
type DeleteCommandResponse struct {
Duration string `json:"duration,omitempty"`
Name string `json:"name,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| name | string | Yes | Command name |
DeleteMessageResponse
Basic response information
type DeleteMessageResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes |
DeleteReactionResponse
Basic response information
type DeleteReactionResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
Reaction ReactionResponse `json:"reaction,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| reaction | ReactionResponse | Yes |
DeleteReminderResponse
Basic response information
type DeleteReminderResponse struct {
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
DeleteRetentionPolicyResponse
Basic response information
type DeleteRetentionPolicyResponse struct {
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
DeliveredMessagePayload
type DeliveredMessagePayload struct {
Cid string `json:"cid,omitempty"`
Id string `json:"id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | No | |
| id | string | No |
DraftResponse
type DraftResponse struct {
Channel ChannelResponse `json:"channel,omitempty"`
ChannelCid string `json:"channel_cid,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Message DraftPayloadResponse `json:"message,omitempty"`
ParentId string `json:"parent_id,omitempty"`
ParentMessage MessageResponse `json:"parent_message,omitempty"`
QuotedMessage MessageResponse `json:"quoted_message,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | float64 | Yes | |
| message | DraftPayloadResponse | Yes | |
| channel | ChannelResponse | No | |
| parent_id | string | No | |
| parent_message | MessageResponse | No | |
| quoted_message | MessageResponse | No |
EventRequest
type EventRequest struct {
Custom map[string]interface{} `json:"custom,omitempty"`
ParentId string `json:"parent_id,omitempty"`
Type string `json:"type,omitempty"`
User UserRequest `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | |
| custom | map[string]interface{} | No | |
| parent_id | string | No | |
| user | UserRequest | No | |
| user_id | string | No |
EventResponse
Basic response information
type EventResponse struct {
Duration string `json:"duration,omitempty"`
Event WSEvent `json:"event,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| event | WSEvent | Yes |
ExportChannelsResponse
type ExportChannelsResponse struct {
Duration string `json:"duration,omitempty"`
TaskId string `json:"task_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| task_id | string | Yes | ID of the task to export channels |
FutureChannelBanResponse
type FutureChannelBanResponse struct {
BannedBy UserResponse `json:"banned_by,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Expires float64 `json:"expires,omitempty"`
Reason string `json:"reason,omitempty"`
Shadow bool `json:"shadow,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | |
| banned_by | UserResponse | No | |
| expires | float64 | No | |
| reason | string | No | |
| shadow | bool | No | |
| user | UserResponse | No |
GetCampaignResponse
Basic response information
type GetCampaignResponse struct {
Campaign CampaignResponse `json:"campaign,omitempty"`
Duration string `json:"duration,omitempty"`
Users PagerResponse `json:"users,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| campaign | CampaignResponse | No | |
| users | PagerResponse | No |
GetChannelTypeResponse
Basic response information
type GetChannelTypeResponse struct {
AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"`
Automod string `json:"automod,omitempty"`
AutomodBehavior string `json:"automod_behavior,omitempty"`
AutomodThresholds Thresholds `json:"automod_thresholds,omitempty"`
Blocklist string `json:"blocklist,omitempty"`
BlocklistBehavior string `json:"blocklist_behavior,omitempty"`
Blocklists []BlockListOptions `json:"blocklists,omitempty"`
ChatPreferences ChatPreferences `json:"chat_preferences,omitempty"`
Commands []Command `json:"commands,omitempty"`
ConnectEvents bool `json:"connect_events,omitempty"`
CountMessages bool `json:"count_messages,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CustomEvents bool `json:"custom_events,omitempty"`
DeliveryEvents bool `json:"delivery_events,omitempty"`
Duration string `json:"duration,omitempty"`
Grants map[string]interface{} `json:"grants,omitempty"`
MarkMessagesPending bool `json:"mark_messages_pending,omitempty"`
MaxMessageLength int `json:"max_message_length,omitempty"`
Mutes bool `json:"mutes,omitempty"`
Name string `json:"name,omitempty"`
PartitionSize int `json:"partition_size,omitempty"`
PartitionTtl string `json:"partition_ttl,omitempty"`
Permissions []PolicyRequest `json:"permissions,omitempty"`
Polls bool `json:"polls,omitempty"`
PushLevel string `json:"push_level,omitempty"`
PushNotifications bool `json:"push_notifications,omitempty"`
Quotes bool `json:"quotes,omitempty"`
Reactions bool `json:"reactions,omitempty"`
ReadEvents bool `json:"read_events,omitempty"`
Reminders bool `json:"reminders,omitempty"`
Replies bool `json:"replies,omitempty"`
Search bool `json:"search,omitempty"`
SharedLocations bool `json:"shared_locations,omitempty"`
SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs,omitempty"`
TypingEvents bool `json:"typing_events,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
Uploads bool `json:"uploads,omitempty"`
UrlEnrichment bool `json:"url_enrichment,omitempty"`
UserMessageReminders bool `json:"user_message_reminders,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | string | Yes | |
| automod_behavior | string | Yes | |
| commands | []Command | Yes | |
| connect_events | bool | Yes | |
| count_messages | bool | Yes | |
| created_at | float64 | Yes | |
| custom_events | bool | Yes | |
| delivery_events | bool | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
| grants | map[string]interface{} | Yes | |
| mark_messages_pending | bool | Yes | |
| max_message_length | int | Yes | |
| mutes | bool | Yes | |
| name | string | Yes | |
| permissions | []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 | float64 | Yes | |
| uploads | bool | Yes | |
| url_enrichment | bool | Yes | |
| user_message_reminders | bool | Yes | |
| allowed_flag_reasons | []string | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | string | No | |
| blocklists | []BlockListOptions | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | int | No | |
| partition_ttl | string | No | |
| push_level | string | No |
GetCommandResponse
type GetCommandResponse struct {
Args string `json:"args,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
Duration string `json:"duration,omitempty"`
Name string `json:"name,omitempty"`
Set string `json:"set,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| args | string | Yes | |
| description | string | Yes | |
| duration | string | Yes | |
| name | string | Yes | |
| set | string | Yes | |
| created_at | float64 | No | |
| updated_at | float64 | No |
GetDraftResponse
Basic response information
type GetDraftResponse struct {
Draft DraftResponse `json:"draft,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| draft | DraftResponse | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
GetManyMessagesResponse
type GetManyMessagesResponse struct {
Duration string `json:"duration,omitempty"`
Messages []MessageResponse `json:"messages,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| messages | []MessageResponse | Yes | List of messages |
GetMessageResponse
Basic response information
type GetMessageResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageWithChannelResponse `json:"message,omitempty"`
PendingMessageMetadata map[string]interface{} `json:"pending_message_metadata,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageWithChannelResponse | Yes | |
| pending_message_metadata | map[string]interface{} | No |
GetReactionsResponse
type GetReactionsResponse struct {
Duration string `json:"duration,omitempty"`
Reactions []ReactionResponse `json:"reactions,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| reactions | []ReactionResponse | Yes | List of reactions |
GetRepliesResponse
Basic response information
type GetRepliesResponse struct {
Duration string `json:"duration,omitempty"`
Messages []MessageResponse `json:"messages,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| messages | []MessageResponse | Yes |
GetRetentionPolicyResponse
Basic response information
type GetRetentionPolicyResponse struct {
Duration string `json:"duration,omitempty"`
Policies []RetentionPolicy `json:"policies,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| policies | []RetentionPolicy | Yes |
GetRetentionPolicyRunsResponse
Basic response information
type GetRetentionPolicyRunsResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
Runs []RetentionRunResponse `json:"runs,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| runs | []RetentionRunResponse | Yes | |
| next | string | No | |
| prev | string | No |
GetSegmentResponse
type GetSegmentResponse struct {
Duration string `json:"duration,omitempty"`
Segment SegmentResponse `json:"segment,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| segment | SegmentResponse | No | Segment |
GetThreadResponse
type GetThreadResponse struct {
Duration string `json:"duration,omitempty"`
Thread ThreadStateResponse `json:"thread,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| thread | ThreadStateResponse | Yes | Enriched thread state |
HideChannelResponse
Basic response information
type HideChannelResponse struct {
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
ImageSize
type ImageSize struct {
Crop string `json:"crop,omitempty"`
Height int `json:"height,omitempty"`
Resize string `json:"resize,omitempty"`
Width int `json:"width,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| crop | string | No | Crop mode. One of: top, bottom, left, right, center |
| height | int | No | Target image height |
| resize | string | No | Resize method. One of: clip, crop, scale, fill |
| width | int | No | Target image width |
LabelThresholds
type LabelThresholds struct {
Block float64 `json:"block,omitempty"`
Flag float64 `json:"flag,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| block | float64 | No | Threshold for automatic message block |
| flag | float64 | No | Threshold for automatic message flag |
ListChannelTypesResponse
type ListChannelTypesResponse struct {
ChannelTypes map[string]interface{} `json:"channel_types,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_types | map[string]interface{} | Yes | Object with all channel types |
| duration | string | Yes |
ListCommandsResponse
type ListCommandsResponse struct {
Commands []Command `json:"commands,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| commands | []Command | Yes | List of commands |
| duration | string | Yes |
MarkDeliveredResponse
Basic response information
type MarkDeliveredResponse struct {
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
MarkReadResponse
type MarkReadResponse struct {
Duration string `json:"duration,omitempty"`
Event MarkReadResponseEvent `json:"event,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| event | MarkReadResponseEvent | No | Mark read event |
MarkReadResponseEvent
type MarkReadResponseEvent struct {
Channel ChannelResponse `json:"channel,omitempty"`
ChannelId string `json:"channel_id,omitempty"`
ChannelLastMessageAt float64 `json:"channel_last_message_at,omitempty"`
ChannelType string `json:"channel_type,omitempty"`
Cid string `json:"cid,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
LastReadMessageId string `json:"last_read_message_id,omitempty"`
Team string `json:"team,omitempty"`
Thread ThreadResponse `json:"thread,omitempty"`
Type string `json:"type,omitempty"`
User UserResponseCommonFields `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_id | string | Yes | |
| channel_type | string | Yes | |
| cid | string | Yes | |
| created_at | float64 | Yes | |
| type | string | Yes | |
| channel | ChannelResponse | No | |
| channel_last_message_at | float64 | No | |
| last_read_message_id | string | No | |
| team | string | No | |
| thread | ThreadResponse | No | |
| user | UserResponseCommonFields | No |
MembersResponse
type MembersResponse struct {
Duration string `json:"duration,omitempty"`
Members []ChannelMemberResponse `json:"members,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| members | []ChannelMemberResponse | Yes | List of found members |
MessageActionResponse
Basic response information
type MessageActionResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | No |
MessageFlagResponse
type MessageFlagResponse struct {
ApprovedAt float64 `json:"approved_at,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CreatedByAutomod bool `json:"created_by_automod,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Details FlagDetailsResponse `json:"details,omitempty"`
Message MessageResponse `json:"message,omitempty"`
ModerationFeedback FlagFeedbackResponse `json:"moderation_feedback,omitempty"`
ModerationResult MessageModerationResult `json:"moderation_result,omitempty"`
Reason string `json:"reason,omitempty"`
RejectedAt float64 `json:"rejected_at,omitempty"`
ReviewedAt float64 `json:"reviewed_at,omitempty"`
ReviewedBy UserResponse `json:"reviewed_by,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | |
| created_by_automod | bool | Yes | |
| updated_at | float64 | Yes | |
| approved_at | float64 | No | |
| custom | map[string]interface{} | No | |
| details | FlagDetailsResponse | No | |
| message | MessageResponse | No | |
| moderation_feedback | FlagFeedbackResponse | No | |
| moderation_result | MessageModerationResult | No | |
| reason | string | No | |
| rejected_at | float64 | No | |
| reviewed_at | float64 | No | |
| reviewed_by | UserResponse | No | |
| user | UserResponse | No |
MessageHistoryEntryResponse
type MessageHistoryEntryResponse struct {
Custom map[string]interface{} `json:"Custom,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
IsDeleted bool `json:"is_deleted,omitempty"`
MessageId string `json:"message_id,omitempty"`
MessageUpdatedAt float64 `json:"message_updated_at,omitempty"`
MessageUpdatedById string `json:"message_updated_by_id,omitempty"`
Text string `json:"text,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| Custom | map[string]interface{} | Yes | |
| attachments | []Attachment | Yes | |
| is_deleted | bool | Yes | |
| message_id | string | Yes | |
| message_updated_at | float64 | Yes | |
| message_updated_by_id | string | Yes | |
| text | string | Yes |
MessagePaginationParams
type MessagePaginationParams struct {
CreatedAtAfter float64 `json:"created_at_after,omitempty"`
CreatedAtAfterOrEqual float64 `json:"created_at_after_or_equal,omitempty"`
CreatedAtAround float64 `json:"created_at_around,omitempty"`
CreatedAtBefore float64 `json:"created_at_before,omitempty"`
CreatedAtBeforeOrEqual float64 `json:"created_at_before_or_equal,omitempty"`
IdAround string `json:"id_around,omitempty"`
IdGt string `json:"id_gt,omitempty"`
IdGte string `json:"id_gte,omitempty"`
IdLt string `json:"id_lt,omitempty"`
IdLte string `json:"id_lte,omitempty"`
Limit int `json:"limit,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at_after | float64 | No | The timestamp to get messages with a created_at timestamp greater than |
| created_at_after_or_equal | float64 | No | The timestamp to get messages with a created_at timestamp greater than or equ... |
| created_at_around | float64 | No | The result will be a set of messages, that are both older and newer than the ... |
| created_at_before | float64 | No | The timestamp to get messages with a created_at timestamp smaller than |
| created_at_before_or_equal | float64 | No | The timestamp to get messages with a created_at timestamp smaller than or equ... |
| id_around | string | No | The result will be a set of messages, that are both older and newer than the ... |
| id_gt | string | No | The ID of the message to get messages with a timestamp greater than |
| id_gte | string | No | The ID of the message to get messages with a timestamp greater than or equal to |
| id_lt | string | No | The ID of the message to get messages with a timestamp smaller than |
| id_lte | string | No | The ID of the message to get messages with a timestamp smaller than or equal to |
| limit | int | No | The maximum number of messages to return (max limit |
MessageRequest
Message data for creating or updating a message
type MessageRequest struct {
Attachments []Attachment `json:"attachments,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Html string `json:"html,omitempty"`
Id string `json:"id,omitempty"`
MentionedChannel bool `json:"mentioned_channel,omitempty"`
MentionedGroupIds []string `json:"mentioned_group_ids,omitempty"`
MentionedHere bool `json:"mentioned_here,omitempty"`
MentionedRoles []string `json:"mentioned_roles,omitempty"`
MentionedUsers []string `json:"mentioned_users,omitempty"`
Mml string `json:"mml,omitempty"`
ParentId string `json:"parent_id,omitempty"`
PinExpires float64 `json:"pin_expires,omitempty"`
Pinned bool `json:"pinned,omitempty"`
PinnedAt string `json:"pinned_at,omitempty"`
PollId string `json:"poll_id,omitempty"`
QuotedMessageId string `json:"quoted_message_id,omitempty"`
RestrictedVisibility []string `json:"restricted_visibility,omitempty"`
SharedLocation SharedLocation `json:"shared_location,omitempty"`
ShowInChannel bool `json:"show_in_channel,omitempty"`
Silent bool `json:"silent,omitempty"`
Text string `json:"text,omitempty"`
Type string `json:"type,omitempty"`
User UserRequest `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | []Attachment | No | Array of message attachments |
| custom | map[string]interface{} | No | |
| html | string | No | Contains HTML markup of the message. Can only be set when using server-side API |
| id | string | No | Message ID is unique string identifier of the message |
| mentioned_channel | bool | No | |
| mentioned_group_ids | []string | No | List of user group IDs to mention. Group members who are also channel members... |
| mentioned_here | bool | No | |
| mentioned_roles | []string | No | |
| mentioned_users | []string | No | Array of user IDs to mention |
| mml | string | No | Should be empty if text is provided. Can only be set when using server-side... |
| parent_id | string | No | ID of parent message (thread) |
| pin_expires | float64 | No | Date when pinned message expires |
| pinned | bool | No | Whether message is pinned or not |
| pinned_at | string | No | Date when message got pinned |
| poll_id | string | No | Identifier of the poll to include in the message |
| quoted_message_id | string | No | |
| restricted_visibility | []string | No | A list of user ids that have restricted visibility to the message |
| shared_location | SharedLocation | No | Contains shared location data |
| show_in_channel | bool | No | Whether thread reply should be shown in the channel as well |
| silent | bool | No | Whether message is silent or not |
| text | string | No | Text of the message. Should be empty if mml is provided |
| type | string | No | Contains type of the message. One of: regular, system |
| user | UserRequest | No | |
| user_id | string | No |
MessageResponse
Represents any chat message
type MessageResponse struct {
Attachments []Attachment `json:"attachments,omitempty"`
Cid string `json:"cid,omitempty"`
Command string `json:"command,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
DeletedForMe bool `json:"deleted_for_me,omitempty"`
DeletedReplyCount int `json:"deleted_reply_count,omitempty"`
Draft DraftResponse `json:"draft,omitempty"`
Html string `json:"html,omitempty"`
I18n map[string]interface{} `json:"i18n,omitempty"`
Id string `json:"id,omitempty"`
ImageLabels map[string]interface{} `json:"image_labels,omitempty"`
LatestReactions []ReactionResponse `json:"latest_reactions,omitempty"`
Member ChannelMemberResponse `json:"member,omitempty"`
MentionedChannel bool `json:"mentioned_channel,omitempty"`
MentionedGroupIds []string `json:"mentioned_group_ids,omitempty"`
MentionedHere bool `json:"mentioned_here,omitempty"`
MentionedRoles []string `json:"mentioned_roles,omitempty"`
MentionedUsers []UserResponse `json:"mentioned_users,omitempty"`
MessageTextUpdatedAt float64 `json:"message_text_updated_at,omitempty"`
Mml string `json:"mml,omitempty"`
Moderation ModerationV2Response `json:"moderation,omitempty"`
OwnReactions []ReactionResponse `json:"own_reactions,omitempty"`
ParentId string `json:"parent_id,omitempty"`
PinExpires float64 `json:"pin_expires,omitempty"`
Pinned bool `json:"pinned,omitempty"`
PinnedAt float64 `json:"pinned_at,omitempty"`
PinnedBy UserResponse `json:"pinned_by,omitempty"`
Poll PollResponseData `json:"poll,omitempty"`
PollId string `json:"poll_id,omitempty"`
QuotedMessage MessageResponse `json:"quoted_message,omitempty"`
QuotedMessageId string `json:"quoted_message_id,omitempty"`
ReactionCounts map[string]interface{} `json:"reaction_counts,omitempty"`
ReactionGroups map[string]interface{} `json:"reaction_groups,omitempty"`
ReactionScores map[string]interface{} `json:"reaction_scores,omitempty"`
Reminder ReminderResponseData `json:"reminder,omitempty"`
ReplyCount int `json:"reply_count,omitempty"`
RestrictedVisibility []string `json:"restricted_visibility,omitempty"`
Shadowed bool `json:"shadowed,omitempty"`
SharedLocation SharedLocationResponseData `json:"shared_location,omitempty"`
ShowInChannel bool `json:"show_in_channel,omitempty"`
Silent bool `json:"silent,omitempty"`
Text string `json:"text,omitempty"`
ThreadParticipants []UserResponse `json:"thread_participants,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | []Attachment | Yes | Array of message attachments |
| cid | string | Yes | Channel unique identifier in <type>:<id> format |
| created_at | float64 | Yes | Date/time of creation |
| custom | map[string]interface{} | Yes | |
| deleted_reply_count | int | Yes | |
| html | string | Yes | Contains HTML markup of the message. Can only be set when using server-side API |
| id | string | Yes | Message ID is unique string identifier of the message |
| latest_reactions | []ReactionResponse | Yes | List of 10 latest reactions to this message |
| mentioned_channel | bool | Yes | Whether the message mentioned the channel tag |
| mentioned_here | bool | Yes | Whether the message mentioned online users with @here tag |
| mentioned_users | []UserResponse | Yes | List of mentioned users |
| own_reactions | []ReactionResponse | Yes | List of 10 latest reactions of authenticated user to this message |
| pinned | bool | Yes | Whether message is pinned or not |
| reaction_counts | map[string]interface{} | Yes | An object containing number of reactions of each type. Key: reaction type (st... |
| reaction_scores | map[string]interface{} | Yes | An object containing scores of reactions of each type. Key: reaction type (st... |
| reply_count | int | Yes | Number of replies to this message |
| restricted_visibility | []string | Yes | A list of user ids that have restricted visibility to the message, if the lis... |
| shadowed | bool | Yes | Whether the message was shadowed or not |
| silent | bool | Yes | Whether message is silent or not |
| text | string | Yes | Text of the message. Should be empty if mml is provided |
| type | string | Yes | Contains type of the message. One of: regular, ephemeral, error, reply, syste... |
| updated_at | float64 | Yes | Date/time of the last update |
| user | UserResponse | Yes | Sender of the message. Required when using server-side API |
| command | string | No | Contains provided slash command |
| deleted_at | float64 | No | Date/time of deletion |
| deleted_for_me | bool | No | |
| draft | DraftResponse | No | |
| i18n | map[string]interface{} | No | Object with translations. Key language contains the original language key. ... |
| image_labels | map[string]interface{} | No | Contains image moderation information |
| member | ChannelMemberResponse | No | Channel member data for the message sender including only the channel_role |
| mentioned_group_ids | []string | No | List of user group IDs mentioned in the message. Group members who are also c... |
| mentioned_roles | []string | No | List of roles mentioned in the message (e.g. admin, channel_moderator, custom... |
| message_text_updated_at | float64 | No | |
| mml | string | No | Should be empty if text is provided. Can only be set when using server-side... |
| moderation | ModerationV2Response | No | |
| parent_id | string | No | ID of parent message (thread) |
| pin_expires | float64 | No | Date when pinned message expires |
| pinned_at | float64 | No | Date when message got pinned |
| pinned_by | UserResponse | No | Contains user who pinned the message |
| poll | PollResponseData | No | |
| poll_id | string | No | Identifier of the poll to include in the message |
| quoted_message | MessageResponse | No | Contains quoted message |
| quoted_message_id | string | No | |
| reaction_groups | map[string]interface{} | No | |
| reminder | ReminderResponseData | No | |
| shared_location | SharedLocationResponseData | No | Contains shared location data |
| show_in_channel | bool | No | Whether thread reply should be shown in the channel as well |
| thread_participants | []UserResponse | No | List of users who participate in thread |
MessageWithChannelResponse
Represents any chat message
type MessageWithChannelResponse struct {
Attachments []Attachment `json:"attachments,omitempty"`
Channel ChannelResponse `json:"channel,omitempty"`
Cid string `json:"cid,omitempty"`
Command string `json:"command,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
DeletedForMe bool `json:"deleted_for_me,omitempty"`
DeletedReplyCount int `json:"deleted_reply_count,omitempty"`
Draft DraftResponse `json:"draft,omitempty"`
Html string `json:"html,omitempty"`
I18n map[string]interface{} `json:"i18n,omitempty"`
Id string `json:"id,omitempty"`
ImageLabels map[string]interface{} `json:"image_labels,omitempty"`
LatestReactions []ReactionResponse `json:"latest_reactions,omitempty"`
Member ChannelMemberResponse `json:"member,omitempty"`
MentionedChannel bool `json:"mentioned_channel,omitempty"`
MentionedGroupIds []string `json:"mentioned_group_ids,omitempty"`
MentionedHere bool `json:"mentioned_here,omitempty"`
MentionedRoles []string `json:"mentioned_roles,omitempty"`
MentionedUsers []UserResponse `json:"mentioned_users,omitempty"`
MessageTextUpdatedAt float64 `json:"message_text_updated_at,omitempty"`
Mml string `json:"mml,omitempty"`
Moderation ModerationV2Response `json:"moderation,omitempty"`
OwnReactions []ReactionResponse `json:"own_reactions,omitempty"`
ParentId string `json:"parent_id,omitempty"`
PinExpires float64 `json:"pin_expires,omitempty"`
Pinned bool `json:"pinned,omitempty"`
PinnedAt float64 `json:"pinned_at,omitempty"`
PinnedBy UserResponse `json:"pinned_by,omitempty"`
Poll PollResponseData `json:"poll,omitempty"`
PollId string `json:"poll_id,omitempty"`
QuotedMessage MessageResponse `json:"quoted_message,omitempty"`
QuotedMessageId string `json:"quoted_message_id,omitempty"`
ReactionCounts map[string]interface{} `json:"reaction_counts,omitempty"`
ReactionGroups map[string]interface{} `json:"reaction_groups,omitempty"`
ReactionScores map[string]interface{} `json:"reaction_scores,omitempty"`
Reminder ReminderResponseData `json:"reminder,omitempty"`
ReplyCount int `json:"reply_count,omitempty"`
RestrictedVisibility []string `json:"restricted_visibility,omitempty"`
Shadowed bool `json:"shadowed,omitempty"`
SharedLocation SharedLocationResponseData `json:"shared_location,omitempty"`
ShowInChannel bool `json:"show_in_channel,omitempty"`
Silent bool `json:"silent,omitempty"`
Text string `json:"text,omitempty"`
ThreadParticipants []UserResponse `json:"thread_participants,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | []Attachment | Yes | Array of message attachments |
| channel | ChannelResponse | Yes | Channel object |
| cid | string | Yes | Channel unique identifier in <type>:<id> format |
| created_at | float64 | Yes | Date/time of creation |
| custom | map[string]interface{} | Yes | |
| deleted_reply_count | int | Yes | |
| html | string | Yes | Contains HTML markup of the message. Can only be set when using server-side API |
| id | string | Yes | Message ID is unique string identifier of the message |
| latest_reactions | []ReactionResponse | Yes | List of 10 latest reactions to this message |
| mentioned_channel | bool | Yes | Whether the message mentioned the channel tag |
| mentioned_here | bool | Yes | Whether the message mentioned online users with @here tag |
| mentioned_users | []UserResponse | Yes | List of mentioned users |
| own_reactions | []ReactionResponse | Yes | List of 10 latest reactions of authenticated user to this message |
| pinned | bool | Yes | Whether message is pinned or not |
| reaction_counts | map[string]interface{} | Yes | An object containing number of reactions of each type. Key: reaction type (st... |
| reaction_scores | map[string]interface{} | Yes | An object containing scores of reactions of each type. Key: reaction type (st... |
| reply_count | int | Yes | Number of replies to this message |
| restricted_visibility | []string | Yes | A list of user ids that have restricted visibility to the message, if the lis... |
| shadowed | bool | Yes | Whether the message was shadowed or not |
| silent | bool | Yes | Whether message is silent or not |
| text | string | Yes | Text of the message. Should be empty if mml is provided |
| type | string | Yes | Contains type of the message. One of: regular, ephemeral, error, reply, syste... |
| updated_at | float64 | Yes | Date/time of the last update |
| user | UserResponse | Yes | Sender of the message. Required when using server-side API |
| command | string | No | Contains provided slash command |
| deleted_at | float64 | No | Date/time of deletion |
| deleted_for_me | bool | No | |
| draft | DraftResponse | No | |
| i18n | map[string]interface{} | No | Object with translations. Key language contains the original language key. ... |
| image_labels | map[string]interface{} | No | Contains image moderation information |
| member | ChannelMemberResponse | No | Channel member data for the message sender including only the channel_role |
| mentioned_group_ids | []string | No | List of user group IDs mentioned in the message. Group members who are also c... |
| mentioned_roles | []string | No | List of roles mentioned in the message (e.g. admin, channel_moderator, custom... |
| message_text_updated_at | float64 | No | |
| mml | string | No | Should be empty if text is provided. Can only be set when using server-side... |
| moderation | ModerationV2Response | No | |
| parent_id | string | No | ID of parent message (thread) |
| pin_expires | float64 | No | Date when pinned message expires |
| pinned_at | float64 | No | Date when message got pinned |
| pinned_by | UserResponse | No | Contains user who pinned the message |
| poll | PollResponseData | No | |
| poll_id | string | No | Identifier of the poll to include in the message |
| quoted_message | MessageResponse | No | Contains quoted message |
| quoted_message_id | string | No | |
| reaction_groups | map[string]interface{} | No | |
| reminder | ReminderResponseData | No | |
| shared_location | SharedLocationResponseData | No | Contains shared location data |
| show_in_channel | bool | No | Whether thread reply should be shown in the channel as well |
| thread_participants | []UserResponse | No | List of users who participate in thread |
MuteChannelResponse
type MuteChannelResponse struct {
ChannelMute ChannelMute `json:"channel_mute,omitempty"`
ChannelMutes []ChannelMute `json:"channel_mutes,omitempty"`
Duration string `json:"duration,omitempty"`
OwnUser OwnUserResponse `json:"own_user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| channel_mute | ChannelMute | No | Object with channel mute (if one channel was muted) |
| channel_mutes | []ChannelMute | No | Object with mutes (if multiple channels were muted) |
| own_user | OwnUserResponse | No | Authorized user object with fresh mutes information |
OnlyUserID
type OnlyUserID struct {
Id string `json:"id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes |
OwnUserResponse
type OwnUserResponse struct {
AvgResponseTime int `json:"avg_response_time,omitempty"`
Banned bool `json:"banned,omitempty"`
BlockedUserIds []string `json:"blocked_user_ids,omitempty"`
ChannelMutes []ChannelMute `json:"channel_mutes,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeactivatedAt float64 `json:"deactivated_at,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
Devices []DeviceResponse `json:"devices,omitempty"`
Id string `json:"id,omitempty"`
Image string `json:"image,omitempty"`
Invisible bool `json:"invisible,omitempty"`
Language string `json:"language,omitempty"`
LastActive float64 `json:"last_active,omitempty"`
LatestHiddenChannels []string `json:"latest_hidden_channels,omitempty"`
Mutes []UserMuteResponse `json:"mutes,omitempty"`
Name string `json:"name,omitempty"`
Online bool `json:"online,omitempty"`
PrivacySettings PrivacySettingsResponse `json:"privacy_settings,omitempty"`
PushPreferences PushPreferencesResponse `json:"push_preferences,omitempty"`
RevokeTokensIssuedBefore float64 `json:"revoke_tokens_issued_before,omitempty"`
Role string `json:"role,omitempty"`
Teams []string `json:"teams,omitempty"`
TeamsRole map[string]interface{} `json:"teams_role,omitempty"`
TotalUnreadCount int `json:"total_unread_count,omitempty"`
TotalUnreadCountByTeam map[string]interface{} `json:"total_unread_count_by_team,omitempty"`
UnreadChannels int `json:"unread_channels,omitempty"`
UnreadCount int `json:"unread_count,omitempty"`
UnreadThreads int `json:"unread_threads,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | bool | Yes | |
| channel_mutes | []ChannelMute | Yes | |
| created_at | float64 | Yes | |
| custom | map[string]interface{} | Yes | |
| devices | []DeviceResponse | Yes | |
| id | string | Yes | |
| invisible | bool | Yes | |
| language | string | Yes | |
| mutes | []UserMuteResponse | Yes | |
| online | bool | Yes | |
| role | string | Yes | |
| teams | []string | Yes | |
| total_unread_count | int | Yes | |
| unread_channels | int | Yes | |
| unread_count | int | Yes | |
| unread_threads | int | Yes | |
| updated_at | float64 | Yes | |
| avg_response_time | int | No | |
| blocked_user_ids | []string | No | |
| deactivated_at | float64 | No | |
| deleted_at | float64 | No | |
| image | string | No | |
| last_active | float64 | No | |
| latest_hidden_channels | []string | No | |
| name | string | No | |
| privacy_settings | PrivacySettingsResponse | No | |
| push_preferences | PushPreferencesResponse | No | |
| revoke_tokens_issued_before | float64 | No | |
| teams_role | map[string]interface{} | No | |
| total_unread_count_by_team | map[string]interface{} | No |
PagerResponse
type PagerResponse struct {
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| next | string | No | |
| prev | string | No |
PaginationParams
type PaginationParams struct {
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| limit | int | No | |
| offset | int | No |
ParsedPredefinedFilterResponse
type ParsedPredefinedFilterResponse struct {
Filter map[string]interface{} `json:"filter,omitempty"`
Name string `json:"name,omitempty"`
Sort []SortParamRequest `json:"sort,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| filter | map[string]interface{} | Yes | |
| name | string | Yes | |
| sort | []SortParamRequest | No |
PendingMessageResponse
type PendingMessageResponse struct {
Channel ChannelResponse `json:"channel,omitempty"`
Message MessageResponse `json:"message,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel | ChannelResponse | No | |
| message | MessageResponse | No | |
| metadata | map[string]interface{} | No | |
| user | UserResponse | No |
Permission
type Permission struct {
Action string `json:"action,omitempty"`
Condition map[string]interface{} `json:"condition,omitempty"`
Custom bool `json:"custom,omitempty"`
Description string `json:"description,omitempty"`
Id string `json:"id,omitempty"`
Level string `json:"level,omitempty"`
Name string `json:"name,omitempty"`
Owner bool `json:"owner,omitempty"`
SameTeam bool `json:"same_team,omitempty"`
Tags []string `json:"tags,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | Action name this permission is for (e.g. SendMessage) |
| custom | bool | Yes | Whether this is a custom permission or built-in |
| description | string | Yes | Description of the permission |
| id | string | Yes | Unique permission ID |
| level | string | Yes | Level at which permission could be applied (app or channel). One of: app, cha... |
| name | string | Yes | Name of the permission |
| owner | bool | Yes | Whether this permission applies to resource owner or not |
| same_team | bool | Yes | Whether this permission applies to teammates (multi-tenancy mode only) |
| tags | []string | Yes | List of tags of the permission |
| condition | map[string]interface{} | No | MongoDB style condition which decides whether or not the permission is granted |
Policy
type Policy struct {
Action int `json:"action,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Name string `json:"name,omitempty"`
Owner bool `json:"owner,omitempty"`
Priority int `json:"priority,omitempty"`
Resources []string `json:"resources,omitempty"`
Roles []string `json:"roles,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | int | Yes | |
| created_at | float64 | Yes | |
| name | string | Yes | |
| owner | bool | Yes | |
| priority | int | Yes | |
| resources | []string | Yes | |
| roles | []string | Yes | |
| updated_at | float64 | Yes |
PolicyRequest
Policy request
type PolicyRequest struct {
Action string `json:"action,omitempty"`
Name string `json:"name,omitempty"`
Owner bool `json:"owner,omitempty"`
Priority int `json:"priority,omitempty"`
Resources []string `json:"resources,omitempty"`
Roles []string `json:"roles,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | |
| name | string | Yes | User-friendly policy name |
| owner | bool | Yes | Whether policy applies to resource owner or not |
| priority | int | Yes | Policy priority |
| resources | []string | Yes | List of resources to apply policy to |
| roles | []string | Yes | List of roles to apply policy to |
PollResponseData
type PollResponseData struct {
AllowAnswers bool `json:"allow_answers,omitempty"`
AllowUserSuggestedOptions bool `json:"allow_user_suggested_options,omitempty"`
AnswersCount int `json:"answers_count,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CreatedBy UserResponse `json:"created_by,omitempty"`
CreatedById string `json:"created_by_id,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Description string `json:"description,omitempty"`
EnforceUniqueVote bool `json:"enforce_unique_vote,omitempty"`
Id string `json:"id,omitempty"`
IsClosed bool `json:"is_closed,omitempty"`
LatestAnswers []PollVoteResponseData `json:"latest_answers,omitempty"`
LatestVotesByOption map[string]interface{} `json:"latest_votes_by_option,omitempty"`
MaxVotesAllowed int `json:"max_votes_allowed,omitempty"`
Name string `json:"name,omitempty"`
Options []PollOptionResponseData `json:"options,omitempty"`
OwnVotes []PollVoteResponseData `json:"own_votes,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
VoteCount int `json:"vote_count,omitempty"`
VoteCountsByOption map[string]interface{} `json:"vote_counts_by_option,omitempty"`
VotingVisibility string `json:"voting_visibility,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| allow_answers | bool | Yes | |
| allow_user_suggested_options | bool | Yes | |
| answers_count | int | Yes | |
| created_at | float64 | Yes | |
| created_by_id | string | Yes | |
| custom | map[string]interface{} | Yes | |
| description | string | Yes | |
| enforce_unique_vote | bool | Yes | |
| id | string | Yes | |
| latest_answers | []PollVoteResponseData | Yes | |
| latest_votes_by_option | map[string]interface{} | Yes | |
| name | string | Yes | |
| options | []PollOptionResponseData | Yes | |
| own_votes | []PollVoteResponseData | Yes | |
| updated_at | float64 | Yes | |
| vote_count | int | Yes | |
| vote_counts_by_option | map[string]interface{} | Yes | |
| voting_visibility | string | Yes | |
| created_by | UserResponse | No | |
| is_closed | bool | No | |
| max_votes_allowed | int | No |
PollVoteResponse
type PollVoteResponse struct {
Duration string `json:"duration,omitempty"`
Poll PollResponseData `json:"poll,omitempty"`
Vote PollVoteResponseData `json:"vote,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| poll | PollResponseData | No | Poll |
| vote | PollVoteResponseData | No | Poll vote |
PollVoteResponseData
type PollVoteResponseData struct {
AnswerText string `json:"answer_text,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Id string `json:"id,omitempty"`
IsAnswer bool `json:"is_answer,omitempty"`
OptionId string `json:"option_id,omitempty"`
PollId string `json:"poll_id,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | |
| id | string | Yes | |
| option_id | string | Yes | |
| poll_id | string | Yes | |
| updated_at | float64 | Yes | |
| answer_text | string | No | |
| is_answer | bool | No | |
| user | UserResponse | No | |
| user_id | string | No |
PrivacySettingsResponse
type PrivacySettingsResponse struct {
DeliveryReceipts DeliveryReceiptsResponse `json:"delivery_receipts,omitempty"`
ReadReceipts ReadReceiptsResponse `json:"read_receipts,omitempty"`
TypingIndicators TypingIndicatorsResponse `json:"typing_indicators,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| delivery_receipts | DeliveryReceiptsResponse | No | |
| read_receipts | ReadReceiptsResponse | No | |
| typing_indicators | TypingIndicatorsResponse | No |
QueryBannedUsersResponse
type QueryBannedUsersResponse struct {
Bans []BanResponse `json:"bans,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| bans | []BanResponse | Yes | List of found bans |
| duration | string | Yes | Duration of the request in milliseconds |
QueryCampaignsResponse
Basic response information
type QueryCampaignsResponse struct {
Campaigns []CampaignResponse `json:"campaigns,omitempty"`
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| campaigns | []CampaignResponse | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
| next | string | No | |
| prev | string | No |
QueryChannelsResponse
type QueryChannelsResponse struct {
Channels []ChannelStateResponseFields `json:"channels,omitempty"`
Duration string `json:"duration,omitempty"`
PredefinedFilter ParsedPredefinedFilterResponse `json:"predefined_filter,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channels | []ChannelStateResponseFields | Yes | List of channels |
| duration | string | Yes | Duration of the request in milliseconds |
| predefined_filter | ParsedPredefinedFilterResponse | No | The parsed predefined filter with interpolated values, only present when usin... |
QueryDraftsResponse
type QueryDraftsResponse struct {
Drafts []DraftResponse `json:"drafts,omitempty"`
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| drafts | []DraftResponse | Yes | Drafts |
| duration | string | Yes | Duration of the request in milliseconds |
| next | string | No | |
| prev | string | No |
QueryFutureChannelBansResponse
type QueryFutureChannelBansResponse struct {
Bans []FutureChannelBanResponse `json:"bans,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| bans | []FutureChannelBanResponse | Yes | List of found future channel bans |
| duration | string | Yes | Duration of the request in milliseconds |
QueryMessageFlagsResponse
Query message flags response
type QueryMessageFlagsResponse struct {
Duration string `json:"duration,omitempty"`
Flags []MessageFlagResponse `json:"flags,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| flags | []MessageFlagResponse | Yes | The flags that match the query |
QueryMessageHistoryResponse
type QueryMessageHistoryResponse struct {
Duration string `json:"duration,omitempty"`
MessageHistory []MessageHistoryEntryResponse `json:"message_history,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message_history | []MessageHistoryEntryResponse | Yes | Message history entries |
| next | string | No | |
| prev | string | No |
QueryReactionsResponse
Basic response information
type QueryReactionsResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
Reactions []ReactionResponse `json:"reactions,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| reactions | []ReactionResponse | Yes | |
| next | string | No | |
| prev | string | No |
QueryRemindersResponse
type QueryRemindersResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
Reminders []ReminderResponseData `json:"reminders,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| reminders | []ReminderResponseData | Yes | MessageReminders data returned by the query |
| next | string | No | |
| prev | string | No |
QuerySegmentTargetsResponse
type QuerySegmentTargetsResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
Targets []SegmentTargetResponse `json:"targets,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| targets | []SegmentTargetResponse | Yes | Targets |
| next | string | No | |
| prev | string | No |
QuerySegmentsResponse
type QuerySegmentsResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
Segments []SegmentResponse `json:"segments,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| segments | []SegmentResponse | Yes | Segments |
| next | string | No | |
| prev | string | No |
QueryTeamUsageStatsResponse
Response containing team-level usage statistics
type QueryTeamUsageStatsResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Teams []TeamUsageStats `json:"teams,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| teams | []TeamUsageStats | Yes | Array of team usage statistics |
| next | string | No | Cursor for pagination to fetch next page |
QueryThreadsResponse
type QueryThreadsResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
Threads []ThreadStateResponse `json:"threads,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| threads | []ThreadStateResponse | Yes | List of enriched thread states |
| next | string | No | |
| prev | string | No |
Reaction
type Reaction struct {
ActivityId string `json:"activity_id,omitempty"`
ChildrenCounts map[string]interface{} `json:"children_counts,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
Id string `json:"id,omitempty"`
Kind string `json:"kind,omitempty"`
LatestChildren map[string]interface{} `json:"latest_children,omitempty"`
Moderation map[string]interface{} `json:"moderation,omitempty"`
OwnChildren map[string]interface{} `json:"own_children,omitempty"`
Parent string `json:"parent,omitempty"`
Score float64 `json:"score,omitempty"`
TargetFeeds []string `json:"target_feeds,omitempty"`
TargetFeedsExtraData map[string]interface{} `json:"target_feeds_extra_data,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User User `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| activity_id | string | Yes | |
| created_at | float64 | Yes | |
| kind | string | Yes | |
| updated_at | float64 | Yes | |
| user_id | string | Yes | |
| children_counts | map[string]interface{} | No | |
| data | map[string]interface{} | No | |
| deleted_at | float64 | No | |
| id | string | No | |
| latest_children | map[string]interface{} | No | |
| moderation | map[string]interface{} | No | |
| own_children | map[string]interface{} | No | |
| parent | string | No | |
| score | float64 | No | |
| target_feeds | []string | No | |
| target_feeds_extra_data | map[string]interface{} | No | |
| user | User | No |
ReactionRequest
Represents user reaction to a message
type ReactionRequest struct {
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Score int `json:"score,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserRequest `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | The type of reaction (e.g. 'like', 'laugh', 'wow') |
| created_at | float64 | No | Date/time of creation |
| custom | map[string]interface{} | No | |
| score | int | No | Reaction score. If not specified reaction has score of 1 |
| updated_at | float64 | No | Date/time of the last update |
| user | UserRequest | No | |
| user_id | string | No |
ReactionResponse
type ReactionResponse struct {
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
MessageId string `json:"message_id,omitempty"`
Score int `json:"score,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | Date/time of creation |
| custom | map[string]interface{} | Yes | Custom data for this object |
| message_id | string | Yes | Message ID |
| score | int | Yes | Score of the reaction |
| type | string | Yes | Type of reaction |
| updated_at | float64 | Yes | Date/time of the last update |
| user | UserResponse | Yes | User |
| user_id | string | Yes | User ID |
ReadStateResponse
type ReadStateResponse struct {
LastDeliveredAt float64 `json:"last_delivered_at,omitempty"`
LastDeliveredMessageId string `json:"last_delivered_message_id,omitempty"`
LastRead float64 `json:"last_read,omitempty"`
LastReadMessageId string `json:"last_read_message_id,omitempty"`
UnreadMessages int `json:"unread_messages,omitempty"`
User UserResponse `json:"user,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| last_read | float64 | Yes | |
| unread_messages | int | Yes | |
| user | UserResponse | Yes | |
| last_delivered_at | float64 | No | |
| last_delivered_message_id | string | No | |
| last_read_message_id | string | No |
ReminderResponseData
type ReminderResponseData struct {
Channel ChannelResponse `json:"channel,omitempty"`
ChannelCid string `json:"channel_cid,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Message MessageResponse `json:"message,omitempty"`
MessageId string `json:"message_id,omitempty"`
RemindAt float64 `json:"remind_at,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
User UserResponse `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | float64 | Yes | |
| message_id | string | Yes | |
| updated_at | float64 | Yes | |
| user_id | string | Yes | |
| channel | ChannelResponse | No | |
| message | MessageResponse | No | |
| remind_at | float64 | No | |
| user | UserResponse | No |
Response
Basic response information
type Response struct {
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
RetentionPolicy
type RetentionPolicy struct {
AppPk int `json:"app_pk,omitempty"`
Config PolicyConfig `json:"config,omitempty"`
EnabledAt float64 `json:"enabled_at,omitempty"`
Policy string `json:"policy,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app_pk | int | Yes | |
| config | PolicyConfig | Yes | |
| enabled_at | float64 | Yes | |
| policy | string | Yes |
RetentionRunResponse
type RetentionRunResponse struct {
AppPk int `json:"app_pk,omitempty"`
Date string `json:"date,omitempty"`
Policy string `json:"policy,omitempty"`
Stats RunStats `json:"stats,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app_pk | int | Yes | |
| date | string | Yes | |
| policy | string | Yes | |
| stats | RunStats | Yes |
Role
type Role struct {
CreatedAt float64 `json:"created_at,omitempty"`
Custom bool `json:"custom,omitempty"`
Name string `json:"name,omitempty"`
Scopes []string `json:"scopes,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | Date/time of creation |
| custom | bool | Yes | Whether this is a custom role or built-in |
| name | string | Yes | Unique role name |
| scopes | []string | Yes | List of scopes where this role is currently present. .app means that role i... |
| updated_at | float64 | Yes | Date/time of the last update |
SearchResponse
type SearchResponse struct {
Duration string `json:"duration,omitempty"`
Next string `json:"next,omitempty"`
Previous string `json:"previous,omitempty"`
Results []SearchResult `json:"results,omitempty"`
ResultsWarning SearchWarning `json:"results_warning,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| results | []SearchResult | Yes | Search results |
| next | string | No | Value to pass to the next search query in order to paginate |
| previous | string | No | Value that points to the previous page. Pass as the next value in a search qu... |
| results_warning | SearchWarning | No | Warning about the search results |
SearchResult
type SearchResult struct {
Message SearchResultMessage `json:"message,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| message | SearchResultMessage | No | Found message |
SearchWarning
type SearchWarning struct {
ChannelSearchCids []string `json:"channel_search_cids,omitempty"`
ChannelSearchCount int `json:"channel_search_count,omitempty"`
WarningCode int `json:"warning_code,omitempty"`
WarningDescription string `json:"warning_description,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| warning_code | int | Yes | Code corresponding to the warning |
| warning_description | string | Yes | Description of the warning |
| channel_search_cids | []string | No | Channel CIDs for the searched channels |
| channel_search_count | int | No | Number of channels searched |
Segment
type Segment struct {
AllSenderChannels bool `json:"all_sender_channels,omitempty"`
AllUsers bool `json:"all_users,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
Description string `json:"description,omitempty"`
Filter map[string]interface{} `json:"filter,omitempty"`
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Size int `json:"size,omitempty"`
TaskId string `json:"task_id,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| all_sender_channels | bool | Yes | |
| all_users | bool | Yes | |
| created_at | float64 | Yes | |
| id | string | Yes | |
| name | string | Yes | |
| size | int | Yes | |
| type | string | Yes | |
| updated_at | float64 | Yes | |
| deleted_at | float64 | No | |
| description | string | No | |
| filter | map[string]interface{} | No | |
| task_id | string | No |
SegmentResponse
type SegmentResponse struct {
AllSenderChannels bool `json:"all_sender_channels,omitempty"`
AllUsers bool `json:"all_users,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
Description string `json:"description,omitempty"`
Filter map[string]interface{} `json:"filter,omitempty"`
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Size int `json:"size,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| all_sender_channels | bool | Yes | |
| all_users | bool | Yes | |
| created_at | float64 | Yes | |
| deleted_at | float64 | Yes | |
| description | string | Yes | |
| filter | map[string]interface{} | Yes | |
| id | string | Yes | |
| name | string | Yes | |
| size | int | Yes | |
| type | string | Yes | |
| updated_at | float64 | Yes |
SegmentTargetResponse
type SegmentTargetResponse struct {
AppPk int `json:"app_pk,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
SegmentId string `json:"segment_id,omitempty"`
TargetId string `json:"target_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app_pk | int | Yes | |
| created_at | float64 | Yes | |
| segment_id | string | Yes | |
| target_id | string | Yes |
SendMessageResponse
type SendMessageResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
PendingMessageMetadata map[string]interface{} `json:"pending_message_metadata,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | Message response |
| pending_message_metadata | map[string]interface{} | No | Pending message metadata |
SendReactionResponse
Basic response information
type SendReactionResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
Reaction ReactionResponse `json:"reaction,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| reaction | ReactionResponse | Yes |
SetRetentionPolicyResponse
Basic response information
type SetRetentionPolicyResponse struct {
Duration string `json:"duration,omitempty"`
Policy RetentionPolicy `json:"policy,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| policy | RetentionPolicy | Yes |
SharedLocation
type SharedLocation struct {
CreatedByDeviceId string `json:"created_by_device_id,omitempty"`
EndAt float64 `json:"end_at,omitempty"`
Latitude float64 `json:"latitude,omitempty"`
Longitude float64 `json:"longitude,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| latitude | float64 | Yes | |
| longitude | float64 | Yes | |
| created_by_device_id | string | No | |
| end_at | float64 | No |
SharedLocationResponseData
type SharedLocationResponseData struct {
Channel ChannelResponse `json:"channel,omitempty"`
ChannelCid string `json:"channel_cid,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CreatedByDeviceId string `json:"created_by_device_id,omitempty"`
EndAt float64 `json:"end_at,omitempty"`
Latitude float64 `json:"latitude,omitempty"`
Longitude float64 `json:"longitude,omitempty"`
Message MessageResponse `json:"message,omitempty"`
MessageId string `json:"message_id,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
UserId string `json:"user_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | float64 | Yes | |
| created_by_device_id | string | Yes | |
| latitude | float64 | Yes | |
| longitude | float64 | Yes | |
| message_id | string | Yes | |
| updated_at | float64 | Yes | |
| user_id | string | Yes | |
| channel | ChannelResponse | No | |
| end_at | float64 | No | |
| message | MessageResponse | No |
ShowChannelResponse
Basic response information
type ShowChannelResponse struct {
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
SortParamRequest
type SortParamRequest struct {
Direction int `json:"direction,omitempty"`
Field string `json:"field,omitempty"`
Type string `json:"type,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| direction | int | No | Direction of sorting, 1 for Ascending, -1 for Descending, default is 1. One o... |
| field | string | No | Name of field to sort by |
| type | string | No | Type of field to sort by. Empty string or omitted means string type (default)... |
StartCampaignResponse
Basic response information
type StartCampaignResponse struct {
Campaign CampaignResponse `json:"campaign,omitempty"`
Duration string `json:"duration,omitempty"`
Users PagerResponse `json:"users,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| campaign | CampaignResponse | No | |
| users | PagerResponse | No |
TeamUsageStats
Usage statistics for a single team containing all 16 metrics
type TeamUsageStats struct {
ConcurrentConnections MetricStats `json:"concurrent_connections,omitempty"`
ConcurrentUsers MetricStats `json:"concurrent_users,omitempty"`
ImageModerationsDaily MetricStats `json:"image_moderations_daily,omitempty"`
MessagesDaily MetricStats `json:"messages_daily,omitempty"`
MessagesLast24Hours MetricStats `json:"messages_last_24_hours,omitempty"`
MessagesLast30Days MetricStats `json:"messages_last_30_days,omitempty"`
MessagesMonthToDate MetricStats `json:"messages_month_to_date,omitempty"`
MessagesTotal MetricStats `json:"messages_total,omitempty"`
Team string `json:"team,omitempty"`
TranslationsDaily MetricStats `json:"translations_daily,omitempty"`
UsersDaily MetricStats `json:"users_daily,omitempty"`
UsersEngagedLast30Days MetricStats `json:"users_engaged_last_30_days,omitempty"`
UsersEngagedMonthToDate MetricStats `json:"users_engaged_month_to_date,omitempty"`
UsersLast24Hours MetricStats `json:"users_last_24_hours,omitempty"`
UsersLast30Days MetricStats `json:"users_last_30_days,omitempty"`
UsersMonthToDate MetricStats `json:"users_month_to_date,omitempty"`
UsersTotal MetricStats `json:"users_total,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| concurrent_connections | MetricStats | Yes | Peak concurrent connections (total = MAX) |
| concurrent_users | MetricStats | Yes | Peak concurrent users (total = MAX) |
| image_moderations_daily | MetricStats | Yes | Daily image moderations (total = SUM) |
| messages_daily | MetricStats | Yes | Daily messages sent (total = SUM) |
| messages_last_24_hours | MetricStats | Yes | Messages in last 24 hours (total = LATEST) |
| messages_last_30_days | MetricStats | Yes | Messages in last 30 days (total = LATEST) |
| messages_month_to_date | MetricStats | Yes | Messages this month (total = LATEST) |
| messages_total | MetricStats | Yes | Total messages (total = LATEST) |
| team | string | Yes | Team identifier (empty string for users not assigned to any team) |
| translations_daily | MetricStats | Yes | Daily translations (total = SUM) |
| users_daily | MetricStats | Yes | Daily active users (total = SUM) |
| users_engaged_last_30_days | MetricStats | Yes | Engaged MAU (total = LATEST) |
| users_engaged_month_to_date | MetricStats | Yes | Engaged users this month (total = LATEST) |
| users_last_24_hours | MetricStats | Yes | Users active in last 24 hours (total = LATEST) |
| users_last_30_days | MetricStats | Yes | MAU - users active in last 30 days (total = LATEST) |
| users_month_to_date | MetricStats | Yes | Users active this month (total = LATEST) |
| users_total | MetricStats | Yes | Total users (total = LATEST) |
ThreadResponse
type ThreadResponse struct {
ActiveParticipantCount int `json:"active_participant_count,omitempty"`
Channel ChannelResponse `json:"channel,omitempty"`
ChannelCid string `json:"channel_cid,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CreatedBy UserResponse `json:"created_by,omitempty"`
CreatedByUserId string `json:"created_by_user_id,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
LastMessageAt float64 `json:"last_message_at,omitempty"`
ParentMessage MessageResponse `json:"parent_message,omitempty"`
ParentMessageId string `json:"parent_message_id,omitempty"`
ParticipantCount int `json:"participant_count,omitempty"`
ReplyCount int `json:"reply_count,omitempty"`
ThreadParticipants []ThreadParticipant `json:"thread_participants,omitempty"`
Title string `json:"title,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_participant_count | int | Yes | Active Participant Count |
| channel_cid | string | Yes | Channel CID |
| created_at | float64 | Yes | Date/time of creation |
| created_by_user_id | string | Yes | Created By User ID |
| custom | map[string]interface{} | Yes | Custom data for this object |
| parent_message_id | string | Yes | Parent Message ID |
| participant_count | int | Yes | Participant Count |
| title | string | Yes | Title |
| updated_at | float64 | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel |
| created_by | UserResponse | No | Created By User |
| deleted_at | float64 | No | Deleted At |
| last_message_at | float64 | No | Last Message At |
| parent_message | MessageResponse | No | Parent Message |
| reply_count | int | No | Reply Count |
| thread_participants | []ThreadParticipant | No | Thread Participants |
ThreadStateResponse
type ThreadStateResponse struct {
ActiveParticipantCount int `json:"active_participant_count,omitempty"`
Channel ChannelResponse `json:"channel,omitempty"`
ChannelCid string `json:"channel_cid,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CreatedBy UserResponse `json:"created_by,omitempty"`
CreatedByUserId string `json:"created_by_user_id,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
Draft DraftResponse `json:"draft,omitempty"`
LastMessageAt float64 `json:"last_message_at,omitempty"`
LatestReplies []MessageResponse `json:"latest_replies,omitempty"`
ParentMessage MessageResponse `json:"parent_message,omitempty"`
ParentMessageId string `json:"parent_message_id,omitempty"`
ParticipantCount int `json:"participant_count,omitempty"`
Read []ReadStateResponse `json:"read,omitempty"`
ReplyCount int `json:"reply_count,omitempty"`
ThreadParticipants []ThreadParticipant `json:"thread_participants,omitempty"`
Title string `json:"title,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_participant_count | int | Yes | Active Participant Count |
| channel_cid | string | Yes | Channel CID |
| created_at | float64 | Yes | Date/time of creation |
| created_by_user_id | string | Yes | Created By User ID |
| custom | map[string]interface{} | Yes | Custom data for this object |
| latest_replies | []MessageResponse | Yes | |
| parent_message_id | string | Yes | Parent Message ID |
| participant_count | int | Yes | Participant Count |
| title | string | Yes | Title |
| updated_at | float64 | Yes | Date/time of the last update |
| channel | ChannelResponse | No | Channel |
| created_by | UserResponse | No | Created By User |
| deleted_at | float64 | No | Deleted At |
| draft | DraftResponse | No | |
| last_message_at | float64 | No | Last Message At |
| parent_message | MessageResponse | No | Parent Message |
| read | []ReadStateResponse | No | |
| reply_count | int | No | Reply Count |
| thread_participants | []ThreadParticipant | No | Thread Participants |
Thresholds
Sets thresholds for AI moderation
type Thresholds struct {
Explicit LabelThresholds `json:"explicit,omitempty"`
Spam LabelThresholds `json:"spam,omitempty"`
Toxic LabelThresholds `json:"toxic,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| explicit | LabelThresholds | No | Thresholds for explicit messages |
| spam | LabelThresholds | No | Thresholds for spam |
| toxic | LabelThresholds | No | Thresholds for toxic messages |
Time
type Time struct {
}Timestamp
type Timestamp struct {
Time float64 `json:"Time,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| Time | float64 | No |
TruncateChannelResponse
type TruncateChannelResponse struct {
Channel ChannelResponse `json:"channel,omitempty"`
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| channel | ChannelResponse | No | Truncated channel object |
| message | MessageResponse | No | Truncated message object |
UndeleteMessageResponse
Basic response information
type UndeleteMessageResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes |
UnmuteResponse
type UnmuteResponse struct {
Duration string `json:"duration,omitempty"`
NonExistingUsers []string `json:"non_existing_users,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| non_existing_users | []string | No | A list of users that can't be found. Common cause for this is deleted users |
UnreadCountsBatchResponse
Basic response information
type UnreadCountsBatchResponse struct {
CountsByUser map[string]interface{} `json:"counts_by_user,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| counts_by_user | map[string]interface{} | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
UnreadCountsChannel
type UnreadCountsChannel struct {
ChannelId string `json:"channel_id,omitempty"`
LastRead float64 `json:"last_read,omitempty"`
UnreadCount int `json:"unread_count,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_id | string | Yes | |
| last_read | float64 | Yes | |
| unread_count | int | Yes |
UnreadCountsChannelType
type UnreadCountsChannelType struct {
ChannelCount int `json:"channel_count,omitempty"`
ChannelType string `json:"channel_type,omitempty"`
UnreadCount int `json:"unread_count,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_count | int | Yes | |
| channel_type | string | Yes | |
| unread_count | int | Yes |
UnreadCountsThread
type UnreadCountsThread struct {
LastRead float64 `json:"last_read,omitempty"`
LastReadMessageId string `json:"last_read_message_id,omitempty"`
ParentMessageId string `json:"parent_message_id,omitempty"`
UnreadCount int `json:"unread_count,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| last_read | float64 | Yes | |
| last_read_message_id | string | Yes | |
| parent_message_id | string | Yes | |
| unread_count | int | Yes |
UpdateChannelPartialResponse
type UpdateChannelPartialResponse struct {
Channel ChannelResponse `json:"channel,omitempty"`
Duration string `json:"duration,omitempty"`
Members []ChannelMemberResponse `json:"members,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| members | []ChannelMemberResponse | Yes | List of updated members |
| channel | ChannelResponse | No | Updated channel object |
UpdateChannelResponse
type UpdateChannelResponse struct {
Channel ChannelResponse `json:"channel,omitempty"`
Duration string `json:"duration,omitempty"`
Members []ChannelMemberResponse `json:"members,omitempty"`
Message MessageResponse `json:"message,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| members | []ChannelMemberResponse | Yes | List of channel members |
| channel | ChannelResponse | No | Updated channel |
| message | MessageResponse | No | Message sent to the chat |
UpdateChannelTypeResponse
type UpdateChannelTypeResponse struct {
AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"`
Automod string `json:"automod,omitempty"`
AutomodBehavior string `json:"automod_behavior,omitempty"`
AutomodThresholds Thresholds `json:"automod_thresholds,omitempty"`
Blocklist string `json:"blocklist,omitempty"`
BlocklistBehavior string `json:"blocklist_behavior,omitempty"`
Blocklists []BlockListOptions `json:"blocklists,omitempty"`
ChatPreferences ChatPreferences `json:"chat_preferences,omitempty"`
Commands []string `json:"commands,omitempty"`
ConnectEvents bool `json:"connect_events,omitempty"`
CountMessages bool `json:"count_messages,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CustomEvents bool `json:"custom_events,omitempty"`
DeliveryEvents bool `json:"delivery_events,omitempty"`
Duration string `json:"duration,omitempty"`
Grants map[string]interface{} `json:"grants,omitempty"`
MarkMessagesPending bool `json:"mark_messages_pending,omitempty"`
MaxMessageLength int `json:"max_message_length,omitempty"`
Mutes bool `json:"mutes,omitempty"`
Name string `json:"name,omitempty"`
PartitionSize int `json:"partition_size,omitempty"`
PartitionTtl string `json:"partition_ttl,omitempty"`
Permissions []PolicyRequest `json:"permissions,omitempty"`
Polls bool `json:"polls,omitempty"`
PushLevel string `json:"push_level,omitempty"`
PushNotifications bool `json:"push_notifications,omitempty"`
Quotes bool `json:"quotes,omitempty"`
Reactions bool `json:"reactions,omitempty"`
ReadEvents bool `json:"read_events,omitempty"`
Reminders bool `json:"reminders,omitempty"`
Replies bool `json:"replies,omitempty"`
Search bool `json:"search,omitempty"`
SharedLocations bool `json:"shared_locations,omitempty"`
SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs,omitempty"`
TypingEvents bool `json:"typing_events,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
Uploads bool `json:"uploads,omitempty"`
UrlEnrichment bool `json:"url_enrichment,omitempty"`
UserMessageReminders bool `json:"user_message_reminders,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| automod | string | Yes | |
| automod_behavior | string | Yes | |
| commands | []string | Yes | |
| connect_events | bool | Yes | |
| count_messages | bool | Yes | |
| created_at | float64 | Yes | |
| custom_events | bool | Yes | |
| delivery_events | bool | Yes | |
| duration | string | Yes | |
| grants | map[string]interface{} | Yes | |
| mark_messages_pending | bool | Yes | |
| max_message_length | int | Yes | |
| mutes | bool | Yes | |
| name | string | Yes | |
| permissions | []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 | float64 | Yes | |
| uploads | bool | Yes | |
| url_enrichment | bool | Yes | |
| user_message_reminders | bool | Yes | |
| allowed_flag_reasons | []string | No | |
| automod_thresholds | Thresholds | No | |
| blocklist | string | No | |
| blocklist_behavior | string | No | |
| blocklists | []BlockListOptions | No | |
| chat_preferences | ChatPreferences | No | |
| partition_size | int | No | |
| partition_ttl | string | No | |
| push_level | string | No |
UpdateCommandResponse
type UpdateCommandResponse struct {
Command Command `json:"command,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | |
| command | Command | No | Command object |
UpdateMemberPartialResponse
type UpdateMemberPartialResponse struct {
ChannelMember ChannelMemberResponse `json:"channel_member,omitempty"`
Duration string `json:"duration,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| channel_member | ChannelMemberResponse | No | Updated channel member |
UpdateMessagePartialResponse
type UpdateMessagePartialResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
PendingMessageMetadata map[string]interface{} `json:"pending_message_metadata,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | No | Updated message |
| pending_message_metadata | map[string]interface{} | No | Pending message metadata |
UpdateMessageResponse
Basic response information
type UpdateMessageResponse struct {
Duration string `json:"duration,omitempty"`
Message MessageResponse `json:"message,omitempty"`
PendingMessageMetadata map[string]interface{} `json:"pending_message_metadata,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| message | MessageResponse | Yes | |
| pending_message_metadata | map[string]interface{} | No |
UpdateReminderResponse
Basic response information
type UpdateReminderResponse struct {
Duration string `json:"duration,omitempty"`
Reminder ReminderResponseData `json:"reminder,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| reminder | ReminderResponseData | Yes |
UpdateThreadPartialResponse
type UpdateThreadPartialResponse struct {
Duration string `json:"duration,omitempty"`
Thread ThreadResponse `json:"thread,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| thread | ThreadResponse | Yes | Updated thread (not enriched) |
UploadChannelFileResponse
type UploadChannelFileResponse struct {
Duration string `json:"duration,omitempty"`
File string `json:"file,omitempty"`
ModerationAction string `json:"moderation_action,omitempty"`
ThumbUrl string `json:"thumb_url,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| file | string | No | URL to the uploaded asset. Should be used to put to asset_url attachment field |
| moderation_action | string | No | |
| thumb_url | string | No | URL of the file thumbnail for supported file formats. Should be put to `thumb... |
UploadChannelResponse
type UploadChannelResponse struct {
Duration string `json:"duration,omitempty"`
File string `json:"file,omitempty"`
ModerationAction string `json:"moderation_action,omitempty"`
ThumbUrl string `json:"thumb_url,omitempty"`
UploadSizes []ImageSize `json:"upload_sizes,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| file | string | No | |
| moderation_action | string | No | |
| thumb_url | string | No | |
| upload_sizes | []ImageSize | No | Array of image size configurations |
User
type User struct {
Data map[string]interface{} `json:"data,omitempty"`
Id string `json:"id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | |
| data | map[string]interface{} | No |
UserCustomEventRequest
type UserCustomEventRequest struct {
Custom map[string]interface{} `json:"custom,omitempty"`
Type string `json:"type,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | |
| custom | map[string]interface{} | No |
UserRequest
User request object
type UserRequest struct {
Custom map[string]interface{} `json:"custom,omitempty"`
Id string `json:"id,omitempty"`
Image string `json:"image,omitempty"`
Invisible bool `json:"invisible,omitempty"`
Language string `json:"language,omitempty"`
Name string `json:"name,omitempty"`
PrivacySettings PrivacySettingsResponse `json:"privacy_settings,omitempty"`
Role string `json:"role,omitempty"`
Teams []string `json:"teams,omitempty"`
TeamsRole map[string]interface{} `json:"teams_role,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | User ID |
| custom | map[string]interface{} | No | Custom user data |
| image | string | No | User's profile image URL |
| invisible | bool | No | |
| language | string | No | |
| name | string | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No | |
| role | string | No | User's global role |
| teams | []string | No | List of teams the user belongs to |
| teams_role | map[string]interface{} | No | Map of team-specific roles for the user |
UserResponse
User response object
type UserResponse struct {
AvgResponseTime int `json:"avg_response_time,omitempty"`
BanExpires float64 `json:"ban_expires,omitempty"`
Banned bool `json:"banned,omitempty"`
BlockedUserIds []string `json:"blocked_user_ids,omitempty"`
BypassModeration bool `json:"bypass_moderation,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
DeactivatedAt float64 `json:"deactivated_at,omitempty"`
DeletedAt float64 `json:"deleted_at,omitempty"`
Devices []DeviceResponse `json:"devices,omitempty"`
Id string `json:"id,omitempty"`
Image string `json:"image,omitempty"`
Invisible bool `json:"invisible,omitempty"`
Language string `json:"language,omitempty"`
LastActive float64 `json:"last_active,omitempty"`
Name string `json:"name,omitempty"`
Online bool `json:"online,omitempty"`
PrivacySettings PrivacySettingsResponse `json:"privacy_settings,omitempty"`
PushNotifications PushNotificationSettingsResponse `json:"push_notifications,omitempty"`
RevokeTokensIssuedBefore float64 `json:"revoke_tokens_issued_before,omitempty"`
Role string `json:"role,omitempty"`
ShadowBanned bool `json:"shadow_banned,omitempty"`
Teams []string `json:"teams,omitempty"`
TeamsRole map[string]interface{} `json:"teams_role,omitempty"`
UpdatedAt float64 `json:"updated_at,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | bool | Yes | Whether a user is banned or not |
| blocked_user_ids | []string | Yes | |
| created_at | float64 | Yes | Date/time of creation |
| custom | map[string]interface{} | Yes | Custom data for this object |
| id | string | Yes | Unique user identifier |
| invisible | bool | Yes | |
| language | string | Yes | Preferred language of a user |
| online | bool | Yes | Whether a user online or not |
| role | string | Yes | Determines the set of user permissions |
| shadow_banned | bool | Yes | Whether a user is shadow banned |
| teams | []string | Yes | List of teams user is a part of |
| updated_at | float64 | Yes | Date/time of the last update |
| avg_response_time | int | No | |
| ban_expires | float64 | No | Date when ban expires |
| bypass_moderation | bool | No | |
| deactivated_at | float64 | No | Date of deactivation |
| deleted_at | float64 | No | Date/time of deletion |
| devices | []DeviceResponse | No | List of devices user is using |
| image | string | No | |
| last_active | float64 | No | Date of last activity |
| name | string | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No | User privacy settings |
| push_notifications | PushNotificationSettingsResponse | No | User push notification settings |
| revoke_tokens_issued_before | float64 | No | Revocation date for tokens |
| teams_role | map[string]interface{} | No |
VoteData
type VoteData struct {
AnswerText string `json:"answer_text,omitempty"`
OptionId string `json:"option_id,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| answer_text | string | No | |
| option_id | string | No |
WSEvent
Represents an BaseEvent that happened in Stream Chat
type WSEvent struct {
Automoderation bool `json:"automoderation,omitempty"`
AutomoderationScores ModerationResponse `json:"automoderation_scores,omitempty"`
Channel ChannelResponse `json:"channel,omitempty"`
ChannelId string `json:"channel_id,omitempty"`
ChannelLastMessageAt float64 `json:"channel_last_message_at,omitempty"`
ChannelType string `json:"channel_type,omitempty"`
Cid string `json:"cid,omitempty"`
ConnectionId string `json:"connection_id,omitempty"`
CreatedAt float64 `json:"created_at,omitempty"`
CreatedBy UserResponse `json:"created_by,omitempty"`
Custom map[string]interface{} `json:"custom,omitempty"`
Me OwnUserResponse `json:"me,omitempty"`
Member ChannelMemberResponse `json:"member,omitempty"`
Message MessageResponse `json:"message,omitempty"`
MessageUpdate MessageUpdate `json:"message_update,omitempty"`
ParentId string `json:"parent_id,omitempty"`
Poll PollResponseData `json:"poll,omitempty"`
PollVote PollVoteResponseData `json:"poll_vote,omitempty"`
Reaction ReactionResponse `json:"reaction,omitempty"`
Reason string `json:"reason,omitempty"`
Team string `json:"team,omitempty"`
Thread ThreadResponse `json:"thread,omitempty"`
ThreadId string `json:"thread_id,omitempty"`
Type string `json:"type,omitempty"`
User UserResponse `json:"user,omitempty"`
UserId string `json:"user_id,omitempty"`
WatcherCount int `json:"watcher_count,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float64 | Yes | |
| custom | map[string]interface{} | Yes | |
| type | string | Yes | |
| automoderation | bool | No | |
| automoderation_scores | ModerationResponse | No | |
| channel | ChannelResponse | No | |
| channel_id | string | No | |
| channel_last_message_at | float64 | No | |
| channel_type | string | No | |
| cid | string | No | |
| connection_id | string | No | |
| created_by | UserResponse | No | |
| me | OwnUserResponse | No | |
| member | ChannelMemberResponse | No | |
| message | MessageResponse | No | |
| message_update | MessageUpdate | No | |
| parent_id | string | No | |
| poll | PollResponseData | No | |
| poll_vote | PollVoteResponseData | No | |
| reaction | ReactionResponse | No | |
| reason | string | No | |
| team | string | No | |
| thread | ThreadResponse | No | |
| thread_id | string | No | |
| user | UserResponse | No | |
| user_id | string | No | |
| watcher_count | int | No |
WrappedUnreadCountsResponse
Basic response information
type WrappedUnreadCountsResponse struct {
ChannelType []UnreadCountsChannelType `json:"channel_type,omitempty"`
Channels []UnreadCountsChannel `json:"channels,omitempty"`
Duration string `json:"duration,omitempty"`
Threads []UnreadCountsThread `json:"threads,omitempty"`
TotalUnreadCount int `json:"total_unread_count,omitempty"`
TotalUnreadCountByTeam map[string]interface{} `json:"total_unread_count_by_team,omitempty"`
TotalUnreadThreadsCount int `json:"total_unread_threads_count,omitempty"`
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_type | []UnreadCountsChannelType | Yes | |
| channels | []UnreadCountsChannel | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
| threads | []UnreadCountsThread | Yes | |
| total_unread_count | int | Yes | |
| total_unread_threads_count | int | Yes | |
| total_unread_count_by_team | map[string]interface{} | No |