Skip to content

Search Messages

GET
/api/v1/team-chat/search

Search chat messages and thread titles by keyword.

Uses PostgreSQL full-text search with ranking and snippets.

Args: q: Search query string. limit: Maximum results to return. user: The authenticated user context. session: Async database session.

Returns: ChatSearchResponse with ranked results.

Authorizations

Parameters

Query Parameters

q
required

Search query

string
>= 1 characters <= 200 characters

Search query

limit

Max results

integer
default: 20 >= 1 <= 50

Max results

Responses

200

Successful Response

Full-text search results across chat messages and threads.

Attributes: results: Ranked search results. total: Total number of results. query: The original search query.

object
query
required
string
results
required
Array<object>

A single search result from full-text message search.

Attributes: message_id: The matching message UUID. thread_id: The thread containing the message. thread_title: Human-readable thread title. sender_role: Who sent the message. content: Full message content. snippet: Highlighted snippet with tags. rank: Relevance score from ts_rank_cd. created_at: When the message was created.

object
content
required
string
created_at
required
string format: date-time
message_id
required
string format: uuid
rank
required
number
sender_role
required
string
snippet
required
string
thread_id
required
string format: uuid
thread_title
required
Any of:
string
total
required
integer

422

Validation Error

object
detail
Array<object>
object
ctx
object
input
loc
required
Array
msg
required
string
type
required
string