const { messages } = await box.messages.search("invoice");
const inInbox = await box.messages.search("invoice", { folder: "inbox", limit: 20 });messages = box.messages.search("invoice")["messages"]
in_inbox = box.messages.search("invoice", folder="inbox", limit=20)querystringrequiredWords to look for.
folderstringOnly that folder. Every folder by default.
limitinteger40How many.
It returns summaries
The same shape as a listing — sender, subject, date, flags, picture. get() for a whole message.
It searches words, not meaning
Semantic search works on documents uploaded to a storage, not on a mailbox. This finds « invoice » in messages that contain the word.
All folders by default
Including trash and spam — which is usually what someone looking for a message wants, and occasionally surprising. Pass folder to narrow it.
There is no cursor here
A search returns its best results up to limit. To go deeper, narrow the query or the folder rather than paging.