## Search

`$client->search(string query): BeeperDesktopClientServiceSearchResponse`

**get** `/v1/search`

Return matching chats, participant matches in group chats, and the first page of message results in one call. Use the dedicated chat and message search endpoints for pagination.

### Parameters

- `query: string`

  User-typed search text. Uses literal word matching.

### Returns

- `BeeperDesktopClientServiceSearchResponse`

  - `Results results`

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(accessToken: 'My Access Token');

$response = $client->search(query: 'x');

var_dump($response);
```

#### Response

```json
{
  "results": {
    "chats": [
      {
        "id": "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost",
        "accountID": "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
        "network": "WhatsApp",
        "participants": {
          "hasMore": false,
          "items": [
            {
              "id": "@15550101002:local-whatsapp.localhost",
              "cannotMessage": false,
              "email": "email",
              "fullName": "Kishan Bagaria",
              "imgURL": "imgURL",
              "isSelf": false,
              "phoneNumber": "+15550101002",
              "username": "username",
              "isAdmin": true,
              "isNetworkBot": true,
              "isPending": true
            },
            {
              "id": "@ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc:local-whatsapp.localhost",
              "cannotMessage": false,
              "email": "email",
              "fullName": "Batuhan İçöz",
              "imgURL": "imgURL",
              "isSelf": true,
              "phoneNumber": "phoneNumber",
              "username": "username",
              "isAdmin": true,
              "isNetworkBot": true,
              "isPending": true
            }
          ],
          "total": 2
        },
        "title": "Kishan Bagaria",
        "type": "single",
        "unreadCount": 0,
        "capabilities": {
          "allowedReactions": [
            "string"
          ],
          "archive": true,
          "attachments": {
            "foo": {
              "mimeTypes": {
                "foo": -2
              },
              "caption": -2,
              "maxCaptionLength": 0,
              "maxDuration": 0,
              "maxHeight": 0,
              "maxSize": 0,
              "maxWidth": 0,
              "viewOnce": true
            }
          },
          "customEmojiReactions": true,
          "delete": -2,
          "deleteChat": true,
          "deleteChatForEveryone": true,
          "deleteForMe": true,
          "deleteMaxAge": 0,
          "disappearingTimer": {
            "omitEmptyTimer": true,
            "timers": [
              0
            ],
            "types": [
              "afterRead"
            ]
          },
          "edit": -2,
          "editMaxAge": 0,
          "editMaxCount": 0,
          "formatting": {
            "foo": -2
          },
          "locationMessage": -2,
          "markAsUnread": true,
          "maxTextLength": 0,
          "messageRequest": {
            "acceptWithButton": -2,
            "acceptWithMessage": -2
          },
          "participantActions": {
            "ban": -2,
            "invite": -2,
            "kick": -2,
            "leave": -2,
            "revokeInvite": -2
          },
          "poll": -2,
          "reaction": -2,
          "reactionCount": 0,
          "readReceipts": true,
          "reply": -2,
          "state": {
            "avatar": {
              "level": -2
            },
            "description": {
              "level": -2
            },
            "disappearingTimer": {
              "level": -2
            },
            "title": {
              "level": -2
            }
          },
          "thread": -2,
          "typingNotifications": true
        },
        "description": "description",
        "draft": {
          "text": "text",
          "attachments": {
            "foo": {
              "id": "id",
              "type": "file",
              "audioDurationSeconds": 0,
              "fileName": "fileName",
              "filePath": "filePath",
              "fileSize": 0,
              "mimeType": "mimeType",
              "size": {
                "height": 0,
                "width": 0
              },
              "stickerID": "stickerID"
            }
          }
        },
        "imgURL": "imgURL",
        "isArchived": false,
        "isLowPriority": true,
        "isMarkedUnread": true,
        "isMuted": false,
        "isPinned": false,
        "isReadOnly": true,
        "labels": [
          {
            "id": "id",
            "name": "name"
          }
        ],
        "lastActivity": "2026-05-05T20:11:54.000Z",
        "lastReadMessageSortKey": "455171049984",
        "localChatID": "5639",
        "merge": {
          "chatIDs": [
            "!NCdzlIaMjZUmvmvyHU:beeper.com"
          ],
          "defaultChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
        },
        "mergedIntoChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com",
        "messageExpirySeconds": 0,
        "reminder": {
          "dismissOnIncomingMessage": true,
          "remindAt": "2025-08-31T23:30:12.520Z"
        },
        "snooze": {
          "snoozeUntil": "2025-08-31T23:30:12.520Z",
          "userSnoozedAt": "2025-08-31T23:30:12.520Z"
        },
        "unreadMentionsCount": 0
      }
    ],
    "in_groups": [
      {
        "id": "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost",
        "accountID": "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
        "network": "WhatsApp",
        "participants": {
          "hasMore": false,
          "items": [
            {
              "id": "@15550101002:local-whatsapp.localhost",
              "cannotMessage": false,
              "email": "email",
              "fullName": "Kishan Bagaria",
              "imgURL": "imgURL",
              "isSelf": false,
              "phoneNumber": "+15550101002",
              "username": "username",
              "isAdmin": true,
              "isNetworkBot": true,
              "isPending": true
            },
            {
              "id": "@ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc:local-whatsapp.localhost",
              "cannotMessage": false,
              "email": "email",
              "fullName": "Batuhan İçöz",
              "imgURL": "imgURL",
              "isSelf": true,
              "phoneNumber": "phoneNumber",
              "username": "username",
              "isAdmin": true,
              "isNetworkBot": true,
              "isPending": true
            }
          ],
          "total": 2
        },
        "title": "Kishan Bagaria",
        "type": "single",
        "unreadCount": 0,
        "capabilities": {
          "allowedReactions": [
            "string"
          ],
          "archive": true,
          "attachments": {
            "foo": {
              "mimeTypes": {
                "foo": -2
              },
              "caption": -2,
              "maxCaptionLength": 0,
              "maxDuration": 0,
              "maxHeight": 0,
              "maxSize": 0,
              "maxWidth": 0,
              "viewOnce": true
            }
          },
          "customEmojiReactions": true,
          "delete": -2,
          "deleteChat": true,
          "deleteChatForEveryone": true,
          "deleteForMe": true,
          "deleteMaxAge": 0,
          "disappearingTimer": {
            "omitEmptyTimer": true,
            "timers": [
              0
            ],
            "types": [
              "afterRead"
            ]
          },
          "edit": -2,
          "editMaxAge": 0,
          "editMaxCount": 0,
          "formatting": {
            "foo": -2
          },
          "locationMessage": -2,
          "markAsUnread": true,
          "maxTextLength": 0,
          "messageRequest": {
            "acceptWithButton": -2,
            "acceptWithMessage": -2
          },
          "participantActions": {
            "ban": -2,
            "invite": -2,
            "kick": -2,
            "leave": -2,
            "revokeInvite": -2
          },
          "poll": -2,
          "reaction": -2,
          "reactionCount": 0,
          "readReceipts": true,
          "reply": -2,
          "state": {
            "avatar": {
              "level": -2
            },
            "description": {
              "level": -2
            },
            "disappearingTimer": {
              "level": -2
            },
            "title": {
              "level": -2
            }
          },
          "thread": -2,
          "typingNotifications": true
        },
        "description": "description",
        "draft": {
          "text": "text",
          "attachments": {
            "foo": {
              "id": "id",
              "type": "file",
              "audioDurationSeconds": 0,
              "fileName": "fileName",
              "filePath": "filePath",
              "fileSize": 0,
              "mimeType": "mimeType",
              "size": {
                "height": 0,
                "width": 0
              },
              "stickerID": "stickerID"
            }
          }
        },
        "imgURL": "imgURL",
        "isArchived": false,
        "isLowPriority": true,
        "isMarkedUnread": true,
        "isMuted": false,
        "isPinned": false,
        "isReadOnly": true,
        "labels": [
          {
            "id": "id",
            "name": "name"
          }
        ],
        "lastActivity": "2026-05-05T20:11:54.000Z",
        "lastReadMessageSortKey": "455171049984",
        "localChatID": "5639",
        "merge": {
          "chatIDs": [
            "!NCdzlIaMjZUmvmvyHU:beeper.com"
          ],
          "defaultChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
        },
        "mergedIntoChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com",
        "messageExpirySeconds": 0,
        "reminder": {
          "dismissOnIncomingMessage": true,
          "remindAt": "2025-08-31T23:30:12.520Z"
        },
        "snooze": {
          "snoozeUntil": "2025-08-31T23:30:12.520Z",
          "userSnoozedAt": "2025-08-31T23:30:12.520Z"
        },
        "unreadMentionsCount": 0
      }
    ],
    "messages": {
      "chats": {
        "!discord_109876543210987654:beeper.com": {
          "id": "!discord_109876543210987654:beeper.com",
          "accountID": "discordgo",
          "network": "Discord",
          "participants": {
            "hasMore": true,
            "items": [
              {
                "id": "@discord_221590782384013314:beeper.com",
                "cannotMessage": false,
                "email": "email",
                "fullName": "Kishan Bagaria",
                "imgURL": "imgURL",
                "isSelf": false,
                "phoneNumber": "phoneNumber",
                "username": "kishan",
                "isAdmin": true,
                "isNetworkBot": true,
                "isPending": true
              },
              {
                "id": "@discord_337451892017545216:beeper.com",
                "cannotMessage": false,
                "email": "email",
                "fullName": "Batuhan İçöz",
                "imgURL": "imgURL",
                "isSelf": true,
                "phoneNumber": "phoneNumber",
                "username": "batuhanicoz",
                "isAdmin": true,
                "isNetworkBot": true,
                "isPending": true
              }
            ],
            "total": 6
          },
          "title": "Beeper Client API",
          "type": "group",
          "unreadCount": 0,
          "capabilities": {
            "allowedReactions": [
              "string"
            ],
            "archive": true,
            "attachments": {
              "foo": {
                "mimeTypes": {
                  "foo": -2
                },
                "caption": -2,
                "maxCaptionLength": 0,
                "maxDuration": 0,
                "maxHeight": 0,
                "maxSize": 0,
                "maxWidth": 0,
                "viewOnce": true
              }
            },
            "customEmojiReactions": true,
            "delete": -2,
            "deleteChat": true,
            "deleteChatForEveryone": true,
            "deleteForMe": true,
            "deleteMaxAge": 0,
            "disappearingTimer": {
              "omitEmptyTimer": true,
              "timers": [
                0
              ],
              "types": [
                "afterRead"
              ]
            },
            "edit": -2,
            "editMaxAge": 0,
            "editMaxCount": 0,
            "formatting": {
              "foo": -2
            },
            "locationMessage": -2,
            "markAsUnread": true,
            "maxTextLength": 0,
            "messageRequest": {
              "acceptWithButton": -2,
              "acceptWithMessage": -2
            },
            "participantActions": {
              "ban": -2,
              "invite": -2,
              "kick": -2,
              "leave": -2,
              "revokeInvite": -2
            },
            "poll": -2,
            "reaction": -2,
            "reactionCount": 0,
            "readReceipts": true,
            "reply": -2,
            "state": {
              "avatar": {
                "level": -2
              },
              "description": {
                "level": -2
              },
              "disappearingTimer": {
                "level": -2
              },
              "title": {
                "level": -2
              }
            },
            "thread": -2,
            "typingNotifications": true
          },
          "description": "description",
          "draft": {
            "text": "text",
            "attachments": {
              "foo": {
                "id": "id",
                "type": "file",
                "audioDurationSeconds": 0,
                "fileName": "fileName",
                "filePath": "filePath",
                "fileSize": 0,
                "mimeType": "mimeType",
                "size": {
                  "height": 0,
                  "width": 0
                },
                "stickerID": "stickerID"
              }
            }
          },
          "imgURL": "imgURL",
          "isArchived": false,
          "isLowPriority": true,
          "isMarkedUnread": true,
          "isMuted": false,
          "isPinned": true,
          "isReadOnly": true,
          "labels": [
            {
              "id": "id",
              "name": "name"
            }
          ],
          "lastActivity": "2025-08-31T17:38:20.393Z",
          "lastReadMessageSortKey": "455171049984",
          "localChatID": "1229720",
          "merge": {
            "chatIDs": [
              "!NCdzlIaMjZUmvmvyHU:beeper.com"
            ],
            "defaultChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
          },
          "mergedIntoChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com",
          "messageExpirySeconds": 0,
          "reminder": {
            "dismissOnIncomingMessage": true,
            "remindAt": "2025-08-31T23:30:12.520Z"
          },
          "snooze": {
            "snoozeUntil": "2025-08-31T23:30:12.520Z",
            "userSnoozedAt": "2025-08-31T23:30:12.520Z"
          },
          "unreadMentionsCount": 0
        },
        "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost": {
          "id": "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost",
          "accountID": "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
          "network": "WhatsApp",
          "participants": {
            "hasMore": false,
            "items": [
              {
                "id": "@15550101002:local-whatsapp.localhost",
                "cannotMessage": false,
                "email": "email",
                "fullName": "Adam Van Ymeren",
                "imgURL": "imgURL",
                "isSelf": false,
                "phoneNumber": "+15550101002",
                "username": "username",
                "isAdmin": true,
                "isNetworkBot": true,
                "isPending": true
              },
              {
                "id": "@ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc:local-whatsapp.localhost",
                "cannotMessage": false,
                "email": "email",
                "fullName": "Batuhan İçöz",
                "imgURL": "imgURL",
                "isSelf": true,
                "phoneNumber": "phoneNumber",
                "username": "username",
                "isAdmin": true,
                "isNetworkBot": true,
                "isPending": true
              }
            ],
            "total": 2
          },
          "title": "Adam Van Ymeren",
          "type": "single",
          "unreadCount": 2,
          "capabilities": {
            "allowedReactions": [
              "string"
            ],
            "archive": true,
            "attachments": {
              "foo": {
                "mimeTypes": {
                  "foo": -2
                },
                "caption": -2,
                "maxCaptionLength": 0,
                "maxDuration": 0,
                "maxHeight": 0,
                "maxSize": 0,
                "maxWidth": 0,
                "viewOnce": true
              }
            },
            "customEmojiReactions": true,
            "delete": -2,
            "deleteChat": true,
            "deleteChatForEveryone": true,
            "deleteForMe": true,
            "deleteMaxAge": 0,
            "disappearingTimer": {
              "omitEmptyTimer": true,
              "timers": [
                0
              ],
              "types": [
                "afterRead"
              ]
            },
            "edit": -2,
            "editMaxAge": 0,
            "editMaxCount": 0,
            "formatting": {
              "foo": -2
            },
            "locationMessage": -2,
            "markAsUnread": true,
            "maxTextLength": 0,
            "messageRequest": {
              "acceptWithButton": -2,
              "acceptWithMessage": -2
            },
            "participantActions": {
              "ban": -2,
              "invite": -2,
              "kick": -2,
              "leave": -2,
              "revokeInvite": -2
            },
            "poll": -2,
            "reaction": -2,
            "reactionCount": 0,
            "readReceipts": true,
            "reply": -2,
            "state": {
              "avatar": {
                "level": -2
              },
              "description": {
                "level": -2
              },
              "disappearingTimer": {
                "level": -2
              },
              "title": {
                "level": -2
              }
            },
            "thread": -2,
            "typingNotifications": true
          },
          "description": "description",
          "draft": {
            "text": "text",
            "attachments": {
              "foo": {
                "id": "id",
                "type": "file",
                "audioDurationSeconds": 0,
                "fileName": "fileName",
                "filePath": "filePath",
                "fileSize": 0,
                "mimeType": "mimeType",
                "size": {
                  "height": 0,
                  "width": 0
                },
                "stickerID": "stickerID"
              }
            }
          },
          "imgURL": "imgURL",
          "isArchived": false,
          "isLowPriority": true,
          "isMarkedUnread": true,
          "isMuted": true,
          "isPinned": false,
          "isReadOnly": true,
          "labels": [
            {
              "id": "id",
              "name": "name"
            }
          ],
          "lastActivity": "2025-08-31T16:45:10.123Z",
          "lastReadMessageSortKey": "455171049984",
          "localChatID": "1229721",
          "merge": {
            "chatIDs": [
              "!NCdzlIaMjZUmvmvyHU:beeper.com"
            ],
            "defaultChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
          },
          "mergedIntoChatID": "!NCdzlIaMjZUmvmvyHU:beeper.com",
          "messageExpirySeconds": 0,
          "reminder": {
            "dismissOnIncomingMessage": true,
            "remindAt": "2025-08-31T23:30:12.520Z"
          },
          "snooze": {
            "snoozeUntil": "2025-08-31T23:30:12.520Z",
            "userSnoozedAt": "2025-08-31T23:30:12.520Z"
          },
          "unreadMentionsCount": 0
        }
      },
      "hasMore": true,
      "items": [
        {
          "id": "241392",
          "accountID": "discordgo",
          "chatID": "!discord_109876543210987654:beeper.com",
          "senderID": "@discord_221590782384013314:beeper.com",
          "sortKey": "455171049984",
          "timestamp": "2025-08-28T11:04:29.621Z",
          "attachments": [
            {
              "type": "unknown",
              "id": "id",
              "duration": 0,
              "fileName": "fileName",
              "fileSize": 0,
              "isGif": true,
              "isSticker": true,
              "isVoiceNote": true,
              "mimeType": "mimeType",
              "posterImg": "posterImg",
              "size": {
                "height": 0,
                "width": 0
              },
              "srcURL": "srcURL",
              "transcription": {
                "engine": "engine",
                "transcription": "transcription",
                "language": "language"
              }
            }
          ],
          "editedTimestamp": "2025-08-31T23:30:12.520Z",
          "isDeleted": false,
          "isHidden": true,
          "isSender": false,
          "isUnread": false,
          "linkedMessageID": "1343993",
          "links": [
            {
              "title": "title",
              "url": "url",
              "favicon": "favicon",
              "img": "img",
              "imgSize": {
                "height": 0,
                "width": 0
              },
              "originalURL": "originalURL",
              "summary": "summary"
            }
          ],
          "mentions": [
            "@discord_337451892017545216:beeper.com"
          ],
          "reactions": [
            {
              "id": "id",
              "participantID": "participantID",
              "reactionKey": "reactionKey",
              "emoji": true,
              "imgURL": "imgURL"
            }
          ],
          "seen": true,
          "senderName": "Kishan Bagaria",
          "sendStatus": {
            "status": "SUCCESS",
            "timestamp": "2025-08-31T23:30:12.520Z",
            "deliveredToUsers": [
              "string"
            ],
            "internalError": "internalError",
            "message": "message",
            "reason": "reason"
          },
          "text": "The OAuth fix is deployed. Can you verify the desktop flow?",
          "type": "TEXT"
        },
        {
          "id": "241393",
          "accountID": "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
          "chatID": "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost",
          "senderID": "@15550101002:local-whatsapp.localhost",
          "sortKey": "455171050240",
          "timestamp": "2025-08-28T14:22:15.432Z",
          "attachments": [
            {
              "type": "unknown",
              "id": "id",
              "duration": 0,
              "fileName": "fileName",
              "fileSize": 0,
              "isGif": true,
              "isSticker": true,
              "isVoiceNote": true,
              "mimeType": "mimeType",
              "posterImg": "posterImg",
              "size": {
                "height": 0,
                "width": 0
              },
              "srcURL": "srcURL",
              "transcription": {
                "engine": "engine",
                "transcription": "transcription",
                "language": "language"
              }
            }
          ],
          "editedTimestamp": "2025-08-31T23:30:12.520Z",
          "isDeleted": false,
          "isHidden": true,
          "isSender": false,
          "isUnread": true,
          "linkedMessageID": "1343993",
          "links": [
            {
              "title": "title",
              "url": "url",
              "favicon": "favicon",
              "img": "img",
              "imgSize": {
                "height": 0,
                "width": 0
              },
              "originalURL": "originalURL",
              "summary": "summary"
            }
          ],
          "mentions": [
            "@discord_337451892017545216:beeper.com"
          ],
          "reactions": [
            {
              "id": "id",
              "participantID": "participantID",
              "reactionKey": "reactionKey",
              "emoji": true,
              "imgURL": "imgURL"
            }
          ],
          "seen": true,
          "senderName": "Adam Van Ymeren",
          "sendStatus": {
            "status": "SUCCESS",
            "timestamp": "2025-08-31T23:30:12.520Z",
            "deliveredToUsers": [
              "string"
            ],
            "internalError": "internalError",
            "message": "message",
            "reason": "reason"
          },
          "text": "Dinner at 7 still works for me.",
          "type": "TEXT"
        }
      ],
      "newestCursor": null,
      "oldestCursor": "1756379069621"
    }
  }
}
```
