action stream_io_api_search { label: "Search messages" description: "Search messages across channels" provider: stream_io_api method: GET path: "/search" encoding: json input: { type: "object" properties: { payload: { type: "string" } } additionalProperties: false } output: { type: "object" required: ["duration", "results"] properties: { duration: { type: "string" } next: { type: "string" description: "Value to pass to the next search query in order to paginate" } previous: { type: "string" description: "Value that points to the previous page. Pass as the next value in a search query to paginate backwards" } results: { type: "array" description: "Search results" items: { type: "object" properties: { message: { type: "object" required: ["id", "text", "html", "type", "attachments", "latest_reactions", "own_reactions", "reaction_counts", "reaction_scores", "reply_count", "cid", "created_at", "updated_at", "shadowed", "mentioned_users", "silent", "pinned"] properties: { attachments: { type: "array" items: { type: "object" properties: { actions: { type: "array" items: { type: "object" required: ["name", "text", "type"] properties: { name: { type: "object" additionalProperties: true } style: { type: "object" additionalProperties: true } text: { type: "object" additionalProperties: true } type: { type: "object" additionalProperties: true } value: { type: "object" additionalProperties: true } } } } asset_url: { type: "string" } author_icon: { type: "string" } author_link: { type: "string" } author_name: { type: "string" } color: { type: "string" } fallback: { type: "string" } fields: { type: "array" items: { type: "object" required: ["title", "value", "short"] properties: { short: { type: "object" additionalProperties: true } title: { type: "object" additionalProperties: true } value: { type: "object" additionalProperties: true } } } } footer: { type: "string" } footer_icon: { type: "string" } giphy: { type: "object" required: ["original", "fixed_height", "fixed_height_still", "fixed_height_downsampled", "fixed_width", "fixed_width_still", "fixed_width_downsampled"] properties: { fixed_height: { type: "object" required: ["url", "width", "height", "size", "frames"] properties: { frames: { type: "object" additionalProperties: true } height: { type: "object" additionalProperties: true } size: { type: "object" additionalProperties: true } url: { type: "object" additionalProperties: true } width: { type: "object" additionalProperties: true } } } fixed_height_downsampled: { type: "object" additionalProperties: true } fixed_height_still: { type: "object" additionalProperties: true } fixed_width: { type: "object" additionalProperties: true } fixed_width_downsampled: { type: "object" additionalProperties: true } fixed_width_still: { type: "object" additionalProperties: true } original: { type: "object" additionalProperties: true } } } image_url: { type: "string" } og_scrape_url: { type: "string" } original_height: { type: "number" } original_width: { type: "number" } pretext: { type: "string" } text: { type: "string" } thumb_url: { type: "string" } title: { type: "string" } title_link: { type: "string" } type: { type: "string" description: "Attachment type (e.g. image, video, url)" } } } } before_message_send_failed: { type: "boolean" } channel: { type: "object" description: "Represents channel in chat" required: ["id", "type", "cid", "frozen", "disabled"] properties: { auto_translation_enabled: { type: "boolean" description: "Whether auto translation is enabled or not" } auto_translation_language: { type: "string" description: "Language to translate to when auto translation is active" } cid: { type: "string" description: "Channel CID (:)" } config: { type: "object" required: ["created_at", "updated_at", "name", "typing_events", "read_events", "connect_events", "search", "reactions", "replies", "quotes", "mutes", "uploads", "url_enrichment", "custom_events", "push_notifications", "reminders", "message_retention", "max_message_length", "automod", "automod_behavior", "commands"] properties: { automod: { type: "string" enum: ["disabled", "simple", "AI"] } automod_behavior: { type: "string" enum: ["flag", "block"] } automod_thresholds: { type: "object" description: "Sets thresholds for AI moderation" properties: { explicit: { type: "object" properties: { block: { type: "object" additionalProperties: true } flag: { type: "object" additionalProperties: true } } } spam: { type: "object" additionalProperties: true } toxic: { type: "object" additionalProperties: true } } } blocklist: { type: "string" } blocklist_behavior: { type: "string" enum: ["flag", "block"] } commands: { type: "array" items: { type: "object" description: "Represents custom chat command" required: ["name", "description", "args", "set"] properties: { args: { type: "object" additionalProperties: true } created_at: { type: "object" additionalProperties: true } description: { type: "object" additionalProperties: true } name: { type: "object" additionalProperties: true } set: { type: "object" additionalProperties: true } updated_at: { type: "object" additionalProperties: true } } } } connect_events: { type: "boolean" } created_at: { type: "string" format: "date-time" } custom_events: { type: "boolean" } grants: { type: "object" } max_message_length: { type: "number" } message_retention: { type: "string" } mutes: { type: "boolean" } name: { type: "string" } push_notifications: { type: "boolean" } quotes: { type: "boolean" } reactions: { type: "boolean" } read_events: { type: "boolean" } reminders: { type: "boolean" } replies: { type: "boolean" } search: { type: "boolean" } typing_events: { type: "boolean" } updated_at: { type: "string" format: "date-time" } uploads: { type: "boolean" } url_enrichment: { type: "boolean" } } } cooldown: { type: "number" description: "Cooldown period after sending each message" } created_at: { type: "string" format: "date-time" description: "Date/time of creation" } created_by: { type: "object" description: "Represents chat user" required: ["id", "role", "banned", "online"] properties: { ban_expires: { type: "string" format: "date-time" description: "Expiration date of the ban" } banned: { type: "boolean" description: "Whether a user is banned or not" } created_at: { type: "string" format: "date-time" description: "Date/time of creation" } deactivated_at: { type: "string" format: "date-time" description: "Date of deactivation" } deleted_at: { type: "string" format: "date-time" description: "Date/time of deletion" } id: { type: "string" description: "Unique user identifier" } invisible: { type: "boolean" } language: { type: "string" description: "Preferred language of a user" } last_active: { type: "string" format: "date-time" description: "Date of last activity" } online: { type: "boolean" description: "Whether a user online or not" } push_notifications: { type: "object" properties: { disabled: { type: "boolean" } disabled_until: { type: "string" format: "date-time" } } } revoke_tokens_issued_before: { type: "string" format: "date-time" description: "Revocation date for tokens" } role: { type: "string" description: "Determines the set of user permissions" } teams: { type: "array" description: "List of teams user is a part of" items: { type: "string" } } updated_at: { type: "string" format: "date-time" description: "Date/time of the last update" } } } deleted_at: { type: "string" format: "date-time" description: "Date/time of deletion" } disabled: { type: "boolean" } frozen: { type: "boolean" description: "Whether channel is frozen or not" } hidden: { type: "boolean" description: "Whether this channel is hidden by current user or not" } hide_messages_before: { type: "string" format: "date-time" description: "Date since when the message history is accessible" } id: { type: "string" description: "Channel unique ID" } last_message_at: { type: "string" format: "date-time" description: "Date of the last message sent" } member_count: { type: "number" description: "Number of members in the channel" } members: { type: "array" description: "List of channel members (max 100)" items: { type: "object" required: ["created_at", "updated_at", "banned", "shadow_banned", "channel_role"] properties: { ban_expires: { type: "string" format: "date-time" description: "Expiration date of the ban" } banned: { type: "boolean" description: "Whether member is banned this channel or not" } channel_role: { type: "string" description: "Role of the member in the channel" } created_at: { type: "string" format: "date-time" description: "Date/time of creation" } deleted_at: { type: "string" format: "date-time" } invite_accepted_at: { type: "string" format: "date-time" description: "Date when invite was accepted" } invite_rejected_at: { type: "string" format: "date-time" description: "Date when invite was rejected" } invited: { type: "boolean" description: "Whether member was invited or not" } is_moderator: { type: "boolean" description: "Whether member is channel moderator or not" } role: { type: "string" description: "Permission level of the member in the channel (DEPRECATED: use channel_role instead)" enum: ["member", "moderator", "admin", "owner"] } shadow_banned: { type: "boolean" description: "Whether member is shadow banned in this channel or not" } updated_at: { type: "string" format: "date-time" description: "Date/time of the last update" } user: { type: "object" additionalProperties: true } user_id: { type: "string" } } } } mute_expires_at: { type: "string" format: "date-time" description: "Date of mute expiration" } muted: { type: "boolean" description: "Whether this channel is muted or not" } own_capabilities: { type: "array" description: "List of channel capabilities of authenticated user" items: { type: "string" } } team: { type: "string" description: "Team the channel belongs to (multi-tenant only)" } truncated_at: { type: "string" format: "date-time" description: "Date of the latest truncation of the channel" } truncated_by: { type: "object" additionalProperties: true } type: { type: "string" description: "Type of the channel" } updated_at: { type: "string" format: "date-time" description: "Date/time of the last update" } } } cid: { type: "string" } command: { type: "string" } created_at: { type: "string" format: "date-time" } deleted_at: { type: "string" format: "date-time" } html: { type: "string" } i18n: { type: "object" } id: { type: "string" } image_labels: { type: "object" } latest_reactions: { type: "array" items: { type: "object" description: "Represents user reaction to a message" required: ["message_id", "type", "score", "created_at", "updated_at"] properties: { created_at: { type: "string" format: "date-time" description: "Date/time of creation" } message_id: { type: "string" description: "ID of a message user reacted to" } score: { type: "number" description: "Reaction score. If not specified reaction has score of 1" } type: { type: "string" description: "The type of reaction (e.g. 'like', 'laugh', 'wow')" } updated_at: { type: "string" format: "date-time" description: "Date/time of the last update" } user: { type: "object" additionalProperties: true } user_id: { type: "string" description: "ID of a user who reacted to a message" } } } } mentioned_users: { type: "array" items: { type: "object" additionalProperties: true } } mml: { type: "string" } own_reactions: { type: "array" items: { type: "object" additionalProperties: true } } parent_id: { type: "string" } pin_expires: { type: "string" format: "date-time" } pinned: { type: "boolean" } pinned_at: { type: "string" format: "date-time" } pinned_by: { type: "object" additionalProperties: true } quoted_message: { type: "object" description: "Represents any chat message" required: ["id", "text", "html", "type", "attachments", "latest_reactions", "own_reactions", "reaction_counts", "reaction_scores", "reply_count", "cid", "created_at", "updated_at", "shadowed", "mentioned_users", "silent", "pinned"] properties: { attachments: { type: "array" description: "Array of message attachments" items: { type: "object" additionalProperties: true } } before_message_send_failed: { type: "boolean" description: "Whether `before_message_send webhook` failed or not. Field is only accessible in push webhook" } cid: { type: "string" description: "Channel unique identifier in : format" } command: { type: "string" description: "Contains provided slash command" } created_at: { type: "string" format: "date-time" description: "Date/time of creation" } deleted_at: { type: "string" format: "date-time" description: "Date/time of deletion" } html: { type: "string" description: "Contains HTML markup of the message. Can only be set when using server-side API" } i18n: { type: "object" description: "Object with translations. Key `language` contains the original language key. Other keys contain translations" } id: { type: "string" description: "Message ID is unique string identifier of the message" } image_labels: { type: "object" description: "Contains image moderation information" } latest_reactions: { type: "array" description: "List of 10 latest reactions to this message" items: { type: "object" additionalProperties: true } } mentioned_users: { type: "array" description: "List of mentioned users" items: { type: "object" additionalProperties: true } } mml: { type: "string" description: "Should be empty if `text` is provided. Can only be set when using server-side API" } own_reactions: { type: "array" description: "List of 10 latest reactions of authenticated user to this message" items: { type: "object" additionalProperties: true } } parent_id: { type: "string" description: "ID of parent message (thread)" } pin_expires: { type: "string" format: "date-time" description: "Date when pinned message expires" } pinned: { type: "boolean" description: "Whether message is pinned or not" } pinned_at: { type: "string" format: "date-time" description: "Date when message got pinned" } pinned_by: { type: "object" additionalProperties: true } quoted_message: { type: "object" additionalProperties: true } quoted_message_id: { type: "string" } reaction_counts: { type: "object" description: "An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int)" } reaction_scores: { type: "object" description: "An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int)" } reply_count: { type: "number" description: "Number of replies to this message" } shadowed: { type: "boolean" description: "Whether the message was shadowed or not" } show_in_channel: { type: "boolean" description: "Whether thread reply should be shown in the channel as well" } silent: { type: "boolean" description: "Whether message is silent or not" } text: { type: "string" description: "Text of the message. Should be empty if `mml` is provided" } thread_participants: { type: "array" description: "List of users who participate in thread" items: { type: "object" additionalProperties: true } } type: { type: "string" description: "Contains type of the message" enum: ["regular", "ephemeral", "error", "reply", "system", "deleted"] } updated_at: { type: "string" format: "date-time" description: "Date/time of the last update" } user: { type: "object" additionalProperties: true } } } quoted_message_id: { type: "string" } reaction_counts: { type: "object" } reaction_scores: { type: "object" } reply_count: { type: "number" } shadowed: { type: "boolean" } show_in_channel: { type: "boolean" } silent: { type: "boolean" } text: { type: "string" } thread_participants: { type: "array" items: { type: "object" additionalProperties: true } } type: { type: "string" } updated_at: { type: "string" format: "date-time" } user: { type: "object" additionalProperties: true } } } } } } results_warning: { type: "object" required: ["warning_code", "warning_description"] properties: { channel_search_cids: { type: "array" description: "Channel CIDs for the searched channels" items: { type: "string" } } channel_search_count: { type: "number" description: "Number of channels searched" } warning_code: { type: "number" description: "Code corresponding to the warning" } warning_description: { type: "string" description: "Description of the warning" } } } } } }