Search chats and messages
searchFind matching chats and messages across connected WhatsApp accounts with word or phrase queries and filters for date, sender, media, links, unread status, chat, or account.
Instructions
Search like WhatsApp's search bar, across all your connected accounts (or one, or one chat): chats whose name (or number) matches, and messages whose text matches, newest first. Every word in query must appear, in any order, case-insensitively and anywhere in a word ("inv" finds "invoice"); put a "quoted phrase" in quotes to keep it whole. A photo, video or document's caption counts as its text, and a document without one matches on its file name. Narrow it by date (after, before), by who sent it (from_me), to attachments (media), to messages with links (links), or to ones not yet read (only_new); filters work without a query too (e.g. every document in a chat last week). It searches what Parley has stored: everything in the chats the account holder didn't ignore since the account was linked, plus the history WhatsApp sent at linking and anything load_history fetched. Older messages that are only on the phone aren't found; load_history fetches a chat's older ones. Searching never marks anything read or sends read receipts. To read the conversation around a match, read_inbox with its chat_id and before (page back to it), or load_history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Only messages sent on or after this: a date ("2026-10-01", that whole day included, UTC) or an ISO time. | |
| limit | No | How many messages (default 25). | |
| links | No | Only messages with a link in them. | |
| media | No | Only messages with an attachment: "any", or one kind (image = photos, audio = voice notes and audio). | |
| query | No | Words to find (all of them must appear). "Quoted phrases" match whole. A phone number finds that person's chat. | |
| before | No | Only messages sent before this: a date ("2026-10-31", that whole day included, UTC) or an ISO time. To page back, pass the `at` of the oldest match you have. | |
| channel | No | Only this channel, e.g. "whatsapp". Omit for every connected channel. | |
| chat_id | No | Only in this chat (chat_id from list_chats or an earlier result). | |
| from_me | No | true: only what the account holder sent. false: only what others sent. Omit for both. | |
| only_new | No | Only messages from the other side not yet read. | |
| connection_id | No | Only this account: a connection id from list_connections, or its number (e.g. "+65 9136 3557"). |