SWIRLS_
ReferenceSDKClient

apps

SDK reference for apps —

listAppsForMember

List every app the calling member can open, across all organizations they belong to

GET

Usage:

const result = await swirls.client.apps.listAppsForMember()

listApps

List apps declared by the project, one row per app name (snapshot from the pinned deployment, else the latest)

GET

Usage:

const result = await swirls.client.apps.listApps({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes

getApp

Resolve one app into the surface payload: brand, shell, nav, and pages with OpenUI source

GET

Usage:

const result = await swirls.client.apps.getApp({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes

Output:

FieldTypeDescription
namestring
labelstring
descriptionstring | null
iconstring | null
deploymentIdstring
brandobject | null
shellobject | null
navobject | null
pagesobject[]
exposeobject

getAppLanding

Public marketing-safe landing payload for app-targeted Surface sign-in (no auth required)

GET

Usage:

const result = await swirls.client.apps.getAppLanding({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes

Output:

FieldTypeDescription
projectIdstring
appNamestring
layout"centered" | "split" | "cover"
titlestring
subtitlestring | null
logostring | null
iconstring | null
imagestring | null
signInTitlestring
signInHintstring
footerstring | null
brandobject
discoverobject | null
audienceAuthobject | null
hostedUrlstring | null

resolveHostedApp

Resolve a hosted slug to its project/app identity and public audience auth hints

GET

Usage:

const result = await swirls.client.apps.resolveHostedApp({
  hostedSlug: '...',
})

Input:

ParameterTypeRequiredDescription
hostedSlugstringYes

Output:

FieldTypeDescription
projectIdstring
appNamestring
appLabelstring
hostedUrlstring
audienceAuthobject | null

getAudiencePolicy

Read the active audience policy and hosting metadata for a builder-administered app

GET

Usage:

const result = await swirls.client.apps.getAudiencePolicy({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes

Output:

FieldTypeDescription
audienceEnabledboolean
hostedSlugstring | null
hostedUrlstring | null
policyobject | null
canManageboolean

createAudienceInvitation

Invite an external user to a hosted app audience

POST

Usage:

const result = await swirls.client.apps.createAudienceInvitation({
  projectId: '...',
  appName: '...',
  email: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
emailstringYes

Output:

FieldTypeDescription
idstring
emailstring
status"pending" | "accepted" | "revoked"
effectiveStatus"pending" | "accepted" | "revoked" | "expired"
expiresAtstring
createdAtstring
acceptedAtstring | null
lastSentAtstring
sendCountnumber

listAudienceInvitations

List pending and historical app audience invitations

GET

Usage:

const result = await swirls.client.apps.listAudienceInvitations({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
status"pending" | "accepted" | "revoked" | "expired"No
searchstringNo

Output:

FieldTypeDescription
invitationsobject[]

resendAudienceInvitation

Resend a pending app audience invitation

POST

Usage:

const result = await swirls.client.apps.resendAudienceInvitation({
  projectId: '...',
  appName: '...',
  invitationId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
invitationIdstringYes

Output:

FieldTypeDescription
idstring
emailstring
status"pending" | "accepted" | "revoked"
effectiveStatus"pending" | "accepted" | "revoked" | "expired"
expiresAtstring
createdAtstring
acceptedAtstring | null
lastSentAtstring
sendCountnumber

revokeAudienceInvitation

Cancel a pending app audience invitation

POST

Usage:

const result = await swirls.client.apps.revokeAudienceInvitation({
  projectId: '...',
  appName: '...',
  invitationId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
invitationIdstringYes

Output:

FieldTypeDescription
oktrue

listAudienceUsers

List external app audience users and their status

GET

Usage:

const result = await swirls.client.apps.listAudienceUsers({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
status"active" | "revoked"No
authSource"email_otp" | "oidc"No
searchstringNo

Output:

FieldTypeDescription
usersobject[]

revokeAudienceUser

Revoke an external app user and their sessions

POST

Usage:

const result = await swirls.client.apps.revokeAudienceUser({
  projectId: '...',
  appName: '...',
  appUserId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
appUserIdstringYes

Output:

FieldTypeDescription
oktrue

reactivateAudienceUser

Reactivate a revoked external app user

POST

Usage:

const result = await swirls.client.apps.reactivateAudienceUser({
  projectId: '...',
  appName: '...',
  appUserId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
appUserIdstringYes

Output:

FieldTypeDescription
oktrue

listAudienceUserSessions

List sessions for an external app user

GET

Usage:

const result = await swirls.client.apps.listAudienceUserSessions({
  projectId: '...',
  appName: '...',
  appUserId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
appUserIdstringYes

Output:

FieldTypeDescription
sessionsobject[]

revokeAudienceUserSession

Revoke one external app user session

POST

Usage:

const result = await swirls.client.apps.revokeAudienceUserSession({
  projectId: '...',
  appName: '...',
  sessionId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
sessionIdstringYes

Output:

FieldTypeDescription
oktrue

revokeAllAudienceUserSessions

Revoke every session for an external app user

POST

Usage:

const result = await swirls.client.apps.revokeAllAudienceUserSessions({
  projectId: '...',
  appName: '...',
  appUserId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
appUserIdstringYes

Output:

FieldTypeDescription
oktrue

getAudienceOverview

Live roster counts plus range metrics for a hosted app audience

GET

Usage:

const result = await swirls.client.apps.getAudienceOverview({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
range"24h" | "7d" | "30d"No

Output:

FieldTypeDescription
canManageboolean
activeUsersnumber
pendingInvitesnumber
activeSessionsnumber
signInsnumber
workflowLaunchesnumber

listAudienceActivity

App-scoped audience activity feed

GET

Usage:

const result = await swirls.client.apps.listAudienceActivity({
  projectId: '...',
  appName: '...',
  limit: 1,
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
range"24h" | "7d" | "30d"No
outcome"success" | "failure" | "denied"No
subjectstringNo
limitnumberYes
cursorstringNo

Output:

FieldTypeDescription
dataobject[]
nextCursorstring

listAudienceIdpBindings

GET

Usage:

const result = await swirls.client.apps.listAudienceIdpBindings({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes

Output:

FieldTypeDescription
bindingsobject[]

upsertAudienceIdpBinding

POST

Usage:

const result = await swirls.client.apps.upsertAudienceIdpBinding({
  projectId: '...',
  appName: '...',
  alias: '...',
  provider: '...',
  instanceIdentifier: '...',
  clientId: '...',
  clientSecret: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
aliasstringYes
provider"clerk" | "supabase" | "okta"Yes
instanceIdentifierstringYes
clientIdstringYes
clientSecretstringYes

Output:

FieldTypeDescription
oktrue

deleteAudienceIdpBinding

POST

Usage:

const result = await swirls.client.apps.deleteAudienceIdpBinding({
  projectId: '...',
  appName: '...',
  alias: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
aliasstringYes

Output:

FieldTypeDescription
oktrue

listChatThreads

List chat threads for inbox, participant Mine, Public discovery, or accessible (mine ∪ public)

GET

Usage:

const result = await swirls.client.apps.listChatThreads({
  projectId: '...',
  appName: '...',
  limit: 1,
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
channelNamestringNo
channelNamesstring[]No
filter"inbox" | "mine" | "public" | "accessible"No
membershipKind"started" | "invited" | "joined"No
limitnumberYes
cursorstringNo

Output:

FieldTypeDescription
dataobject[]
nextCursorstring

getChatThread

Thread metadata, participant summary, and attention snapshot

GET

Usage:

const result = await swirls.client.apps.getChatThread({
  projectId: '...',
  appName: '...',
  threadId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes

Output:

FieldTypeDescription
threadobject
participantIdsstring[]
participantsobject[]

createChatThread

Create a standalone thread; seeds creator as participant

POST

Usage:

const result = await swirls.client.apps.createChatThread({
  projectId: '...',
  appName: '...',
  channelName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
channelNamestringYes
threadIdstringNo
titlestringNo
visibility"private" | "public"No

Output:

FieldTypeDescription
idstring
channelNamestring
titlestring | null
visibility"private" | "public"
createdBystring
creatorDisplayNamestring | null
archivedAtstring | unknown | null
sequencenumber
createdAtstring | unknown
updatedAtstring | unknown
participantCountnumber
lastMessagePreviewstring | null
lastMessageAuthorDisplayNamestring | null
unreadCountnumber
mentionUnreadboolean
isParticipantboolean
membershipKind"started" | "invited" | "joined" | null

updateChatThread

Update title, visibility, or archive state (creator controls)

POST

Usage:

const result = await swirls.client.apps.updateChatThread({
  projectId: '...',
  appName: '...',
  threadId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes
titlestringNo
visibility"private" | "public"No
archivedbooleanNo

Output:

FieldTypeDescription
idstring
channelNamestring
titlestring | null
visibility"private" | "public"
createdBystring
creatorDisplayNamestring | null
archivedAtstring | unknown | null
sequencenumber
createdAtstring | unknown
updatedAtstring | unknown
participantCountnumber
lastMessagePreviewstring | null
lastMessageAuthorDisplayNamestring | null
unreadCountnumber
mentionUnreadboolean
isParticipantboolean
membershipKind"started" | "invited" | "joined" | null

listChatMessages

Paginated thread transcript from app_messages

GET

Usage:

const result = await swirls.client.apps.listChatMessages({
  projectId: '...',
  appName: '...',
  threadId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes
afterSequencenumberNo
beforeSequencenumberNo
limitnumberNo

Output:

FieldTypeDescription
messagesobject[]
hasMoreboolean

postChatMessage

Post a human message; may enqueue agent turn when agent is addressed

POST

Usage:

const result = await swirls.client.apps.postChatMessage({
  projectId: '...',
  appName: '...',
  threadId: '...',
  body: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes
bodystringYes
attachmentsobject[]No
mentionsobject[]No
controlsobjectNo
messageIdstringNo
channelNamestringNo
idempotencyKeystringNo

Output:

FieldTypeDescription
messageobject
agentTurnPendingboolean
threadobject

listChatMentionCandidates

Roster for @-typeahead: owning-org members, app audience users, channel agents

GET

Usage:

const result = await swirls.client.apps.listChatMentionCandidates({
  projectId: '...',
  appName: '...',
  channelName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
channelNamestringYes
querystringNo

Output:

FieldTypeDescription
candidatesobject[]

markChatThreadRead

Mark thread read up to current sequence; returns updated attention

POST

Usage:

const result = await swirls.client.apps.markChatThreadRead({
  projectId: '...',
  appName: '...',
  threadId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes

Output:

FieldTypeDescription
threadobject

joinChatThread

Join a public thread as a participant and initialize read cursor

POST

Usage:

const result = await swirls.client.apps.joinChatThread({
  projectId: '...',
  appName: '...',
  threadId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes

Output:

FieldTypeDescription
idstring
channelNamestring
titlestring | null
visibility"private" | "public"
createdBystring
creatorDisplayNamestring | null
archivedAtstring | unknown | null
sequencenumber
createdAtstring | unknown
updatedAtstring | unknown
participantCountnumber
lastMessagePreviewstring | null
lastMessageAuthorDisplayNamestring | null
unreadCountnumber
mentionUnreadboolean
isParticipantboolean
membershipKind"started" | "invited" | "joined" | null

leaveChatThread

Leave a joined thread; creators retain ownership without membership

POST

Usage:

const result = await swirls.client.apps.leaveChatThread({
  projectId: '...',
  appName: '...',
  threadId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes

Output:

FieldTypeDescription
idstring
channelNamestring
titlestring | null
visibility"private" | "public"
createdBystring
creatorDisplayNamestring | null
archivedAtstring | unknown | null
sequencenumber
createdAtstring | unknown
updatedAtstring | unknown
participantCountnumber
lastMessagePreviewstring | null
lastMessageAuthorDisplayNamestring | null
unreadCountnumber
mentionUnreadboolean
isParticipantboolean
membershipKind"started" | "invited" | "joined" | null

getChatAttention

App-wide and per-channel unread and mention-unread counts for shell nav

GET

Usage:

const result = await swirls.client.apps.getChatAttention({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes

Output:

FieldTypeDescription
appobject
channelsobject[]

mintActorDirectoryGrant

Mint a short-lived WebSocket grant for the app directory Durable Object

POST

Usage:

const result = await swirls.client.apps.mintActorDirectoryGrant({
  projectId: '...',
  appName: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes

Output:

FieldTypeDescription
actor"directory" | "project" | "session" | "execution"
grantstring
websocketUrlstring
expiresAtstring
appIdstring
projectIdstring
sessionIdstring
threadIdstring
runIdstring
executionIdstring

mintActorSessionGrant

Mint a short-lived WebSocket grant for an authorized agent-session Durable Object

POST

Usage:

const result = await swirls.client.apps.mintActorSessionGrant({
  projectId: '...',
  appName: '...',
  threadId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringYes
threadIdstringYes
runIdstringNo

Output:

FieldTypeDescription
actor"directory" | "project" | "session" | "execution"
grantstring
websocketUrlstring
expiresAtstring
appIdstring
projectIdstring
sessionIdstring
threadIdstring
runIdstring
executionIdstring

mintActorExecutionGrant

Mint a short-lived WebSocket grant for a workflow-execution Durable Object harness

POST

Usage:

const result = await swirls.client.apps.mintActorExecutionGrant({
  projectId: '...',
  executionId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
executionIdstringYes
appNamestringNo

Output:

FieldTypeDescription
actor"directory" | "project" | "session" | "execution"
grantstring
websocketUrlstring
expiresAtstring
appIdstring
projectIdstring
sessionIdstring
threadIdstring
runIdstring
executionIdstring

On this page