Docs / built-apps / listThreads

listThreads

utilitysince 0.2.2

Client function: list the caller's DM threads (counterpart key, last message, unread count).

import { listThreads } from 'flowstack-sdk'

Non-React client function backing useThreads. Lists the caller's threads from the server-owned, ACL'd DM store. config must carry an appScope (built-app context) or the call throws before any request.

Signature

listThreads(credentials, config?): Promise<ApiResponse<{ threads: DmThread[]; count: number }>>

Parameters

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequired, since 0.2.2The authenticated caller's credentials.
configFlowstackClientConfigrequired, since 0.2.2Client config. Must include appScope; baseUrl/tenantId as needed.

Returns

FieldTypeDescription
Promise<ApiResponse<{ threads: DmThread[]; count: number }>>{ ok, data: { threads, count }, error }. ACL'd server-side to the caller's threads.

Examples

List threads
const res = await listThreads(credentials, { appScope });
if (res.ok) console.log(res.data.threads);
WarningThrows Private messaging requires an app scope if config.appScope is missing.

See also

useThreads · listMessages · DmThread

Source: README.md#private-messaging-dms · Also available in llms-full.txt and registry.json.