searchActorProjectThreads()
This method performs cursor-based search across threads for one actor.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function example() { const client = await wachtClient(); const actorId: string = 'actorid-123'; const options: { q?: string; limit?: number; cursor?: string } = { q: 'support', limit: 20, }; return client.ai.searchActorProjectThreads(actorId, options);}Signature
function searchActorProjectThreads( actorId: string, options: { q?: string; limit?: number; cursor?: string }, client?: WachtClient,): Promise<CursorPage<AgentThread>>Parameters
›actorId: string;
actorId: string;Actor id used for actor-scoped AI endpoints.
›options: { q?: string; limit?: number; cursor?: string };
options: { q?: string; limit?: number; cursor?: string };Optional query/filter object used to shape list/search behavior.
›q?: string | undefined;
q?: string | undefined;q value used by this request.
›limit?: number | undefined;
limit?: number | undefined;limit value used by this request.
Return value
›data?: AgentThread[] | undefined;
data?: AgentThread[] | undefined;Current page result items.
›next_cursor?: string | undefined;
next_cursor?: string | undefined;Cursor token for the next page.
Examples
AI usage pattern
import { wachtClient } from '@wacht/nextjs/server';export async function loadThreadSlice(actorId: string, projectId: string) { const client = await wachtClient(); const threads = await client.ai.listProjectThreads(projectId, true); const search = await client.ai.searchActorProjectThreads(actorId, { q: 'login issue', limit: 20 }); return { threads, search };}