## Search `client.Search(ctx, query) (*SearchResponse, error)` **get** `/v1/search` Returns matching chats, participant name matches in groups, and the first page of messages in one call. Paginate messages via search-messages. Paginate chats via search-chats. ### Parameters - `query SearchParams` - `Query param.Field[string]` User-typed search text. Literal word matching (non-semantic). ### Returns - `type SearchResponse struct{…}` - `Results SearchResponseResults` - `Chats []Chat` Top chat results. - `ID string` Unique identifier of the chat across Beeper. - `AccountID string` Account ID this chat belongs to. - `Participants ChatParticipants` Chat participants information. - `HasMore bool` True if there are more participants than included in items. - `Items []User` Participants returned for this chat (limited by the request; may be a subset). - `ID string` Stable Beeper user ID. Use as the primary key when referencing a person. - `CannotMessage bool` True if Beeper cannot initiate messages to this user (e.g., blocked, network restriction, or no DM path). The user may still message you. - `Email string` Email address if known. Not guaranteed verified. - `FullName string` Display name as shown in clients (e.g., 'Alice Example'). May include emojis. - `ImgURL string` Avatar image URL if available. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSelf bool` True if this user represents the authenticated account's own identity. - `PhoneNumber string` User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown. - `Username string` Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique. - `Total int64` Total number of participants in the chat. - `Title string` Display title of the chat as computed by the client/server. - `Type ChatType` Chat type: 'single' for direct messages, 'group' for group chats. - `const ChatTypeSingle ChatType = "single"` - `const ChatTypeGroup ChatType = "group"` - `UnreadCount int64` Number of unread messages. - `IsArchived bool` True if chat is archived. - `IsMuted bool` True if chat notifications are muted. - `IsPinned bool` True if chat is pinned. - `LastActivity Time` Timestamp of last activity. - `LastReadMessageSortKey string` Last read message sortKey. - `LocalChatID string` Local chat ID specific to this Beeper Desktop installation. - `InGroups []Chat` Top group results by participant matches. - `ID string` Unique identifier of the chat across Beeper. - `AccountID string` Account ID this chat belongs to. - `Participants ChatParticipants` Chat participants information. - `HasMore bool` True if there are more participants than included in items. - `Items []User` Participants returned for this chat (limited by the request; may be a subset). - `ID string` Stable Beeper user ID. Use as the primary key when referencing a person. - `CannotMessage bool` True if Beeper cannot initiate messages to this user (e.g., blocked, network restriction, or no DM path). The user may still message you. - `Email string` Email address if known. Not guaranteed verified. - `FullName string` Display name as shown in clients (e.g., 'Alice Example'). May include emojis. - `ImgURL string` Avatar image URL if available. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSelf bool` True if this user represents the authenticated account's own identity. - `PhoneNumber string` User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown. - `Username string` Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique. - `Total int64` Total number of participants in the chat. - `Title string` Display title of the chat as computed by the client/server. - `Type ChatType` Chat type: 'single' for direct messages, 'group' for group chats. - `const ChatTypeSingle ChatType = "single"` - `const ChatTypeGroup ChatType = "group"` - `UnreadCount int64` Number of unread messages. - `IsArchived bool` True if chat is archived. - `IsMuted bool` True if chat notifications are muted. - `IsPinned bool` True if chat is pinned. - `LastActivity Time` Timestamp of last activity. - `LastReadMessageSortKey string` Last read message sortKey. - `LocalChatID string` Local chat ID specific to this Beeper Desktop installation. - `Messages SearchResponseResultsMessages` - `Chats map[string, Chat]` Map of chatID -> chat details for chats referenced in items. - `ID string` Unique identifier of the chat across Beeper. - `AccountID string` Account ID this chat belongs to. - `Participants ChatParticipants` Chat participants information. - `HasMore bool` True if there are more participants than included in items. - `Items []User` Participants returned for this chat (limited by the request; may be a subset). - `ID string` Stable Beeper user ID. Use as the primary key when referencing a person. - `CannotMessage bool` True if Beeper cannot initiate messages to this user (e.g., blocked, network restriction, or no DM path). The user may still message you. - `Email string` Email address if known. Not guaranteed verified. - `FullName string` Display name as shown in clients (e.g., 'Alice Example'). May include emojis. - `ImgURL string` Avatar image URL if available. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSelf bool` True if this user represents the authenticated account's own identity. - `PhoneNumber string` User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown. - `Username string` Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique. - `Total int64` Total number of participants in the chat. - `Title string` Display title of the chat as computed by the client/server. - `Type ChatType` Chat type: 'single' for direct messages, 'group' for group chats. - `const ChatTypeSingle ChatType = "single"` - `const ChatTypeGroup ChatType = "group"` - `UnreadCount int64` Number of unread messages. - `IsArchived bool` True if chat is archived. - `IsMuted bool` True if chat notifications are muted. - `IsPinned bool` True if chat is pinned. - `LastActivity Time` Timestamp of last activity. - `LastReadMessageSortKey string` Last read message sortKey. - `LocalChatID string` Local chat ID specific to this Beeper Desktop installation. - `HasMore bool` True if additional results can be fetched using the provided cursors. - `Items []Message` Messages matching the query and filters. - `ID string` Message ID. - `AccountID string` Beeper account ID the message belongs to. - `ChatID string` Unique identifier of the chat. - `SenderID string` Sender user ID. - `SortKey string` A unique, sortable key used to sort messages. - `Timestamp Time` Message timestamp. - `Attachments []Attachment` Attachments included with this message, if any. - `Type AttachmentType` Attachment type. - `const AttachmentTypeUnknown AttachmentType = "unknown"` - `const AttachmentTypeImg AttachmentType = "img"` - `const AttachmentTypeVideo AttachmentType = "video"` - `const AttachmentTypeAudio AttachmentType = "audio"` - `ID string` Attachment identifier (typically an mxc:// URL). Use with /v1/assets/download to get a local file path. - `Duration float64` Duration in seconds (audio/video). - `FileName string` Original filename if available. - `FileSize float64` File size in bytes if known. - `IsGif bool` True if the attachment is a GIF. - `IsSticker bool` True if the attachment is a sticker. - `IsVoiceNote bool` True if the attachment is a voice note. - `MimeType string` MIME type if known (e.g., 'image/png'). - `PosterImg string` Preview image URL for video attachments (poster frame). May be temporary or local-only to this device; download promptly if durable access is needed. - `Size AttachmentSize` Pixel dimensions of the attachment: width/height in px. - `Height float64` - `Width float64` - `SrcURL string` Public URL or local file path to fetch the asset. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSender bool` True if the authenticated user sent the message. - `IsUnread bool` True if the message is unread for the authenticated user. May be omitted. - `LinkedMessageID string` ID of the message this is a reply to, if any. - `Reactions []Reaction` Reactions to the message, if any. - `ID string` Reaction ID, typically ${participantID}${reactionKey} if multiple reactions allowed, or just participantID otherwise. - `ParticipantID string` User ID of the participant who reacted. - `ReactionKey string` The reaction key: an emoji (😄), a network-specific key, or a shortcode like "smiling-face". - `Emoji bool` True if the reactionKey is an emoji. - `ImgURL string` URL to the reaction's image. May be temporary or local-only to this device; download promptly if durable access is needed. - `SenderName string` Resolved sender display name (impersonator/full name/username/participant name). - `Text string` Plain-text body if present. May include a JSON fallback with text entities for rich messages. - `Type MessageType` Message content type. Useful for distinguishing reactions, media messages, and state events from regular text messages. - `const MessageTypeText MessageType = "TEXT"` - `const MessageTypeNotice MessageType = "NOTICE"` - `const MessageTypeImage MessageType = "IMAGE"` - `const MessageTypeVideo MessageType = "VIDEO"` - `const MessageTypeVoice MessageType = "VOICE"` - `const MessageTypeAudio MessageType = "AUDIO"` - `const MessageTypeFile MessageType = "FILE"` - `const MessageTypeSticker MessageType = "STICKER"` - `const MessageTypeLocation MessageType = "LOCATION"` - `const MessageTypeReaction MessageType = "REACTION"` - `NewestCursor string` Cursor for fetching newer results (use with direction='after'). Opaque string; do not inspect. - `OldestCursor string` Cursor for fetching older results (use with direction='before'). Opaque string; do not inspect. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" ) func main() { client := beeperdesktopapi.NewClient( ) response, err := client.Search(context.TODO(), beeperdesktopapi.SearchParams{ Query: "x", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Results) } ```