Palbase Messaging · API
/messaging/searchFind messages by their words, or what they mean
The messages the reader sees that say every word of q — a word's beginning finds it ("toplanti" finds "Toplantıda": capitals, accents and the Turkish i's are one) — in what they say or their files' names, the newest first, a page at a time: in one conversation of theirs (conversation_id), or across their conversations (the 2,000 they spoke in last). A word of one letter finds that word alone. Messages seen a limited number of times and those of vanish mode are never found; one changed is found by what it says now. The words are kept as marks the conversation's key makes, never readable in the database. With by=meaning, the messages nearest what q means instead — in none of its words, perhaps: "uçuş saati" finds "THY 14:30'da kalkıyor" — the nearest first, one page (no cursor), each with how near (score); the project's setting search_by_meaning on (409 search_by_meaning_off otherwise). Each message's text is embedded by the project's embedding model (billed to the project as its AI use; 402 ai_payment_required when that use is spent) and its vector kept sealed with the conversation's key, opened only in the server's memory. A person asks by meaning 30 questions at once and one more a minute (429 too_many_searches, with Retry-After); a question asked again within ten minutes is not asked of the model again.
Called by a signed-in user of your app, with their token and the publishable key.
Query
qstring · requiredWhat to find: up to 200 characters; its words (up to 8), each a word's beginning.by"words" | "meaning" · optionalwords (the default): the messages that say every word of q. meaning: those nearest what q means (the project's search_by_meaning on): one page, the nearest first; cursor is not taken.conversation_idstring (uuid) · optionalSearch one conversation of the reader's only.limitinteger · optionalHow many (1 to 50; 20 when absent).cursorstring · optionalThe cursor a page handed out (next_cursor).spacestring[] · optionalSearch only the conversations of these spaces: one space a parameter, repeated for more, at most 20.curl -X GET "https://<your-ref>.palbase.studio/messaging/search" \
-H "apikey: $PALBASE_PUBLISHABLE_KEY" \
-H "authorization: Bearer $USER_ACCESS_TOKEN"Responses
200A page of what was found
400q has no word, or is longer than 200 characters (`invalid_query`); by is neither words nor meaning (`invalid_by`); a cursor with by=meaning (`invalid_cursor`); a malformed parameter
401No key, a key of no project, a token not valid (the edge's answer), or no person's session (`user_required`)
402by=meaning: the project's use of Palbase's models is spent for the month (`ai_payment_required`); search by its words meanwhile
404No such conversation of yours (`conversation_not_found`)
409by=meaning: the project searches its messages by their words alone — its setting search_by_meaning is off (`search_by_meaning_off`)
429Over the project's request limit; Retry-After says when to try again
503Temporarily unavailable; retrying is safe after Retry-After
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation SearchMessages of messaging's contract.