Skip to main content
QUERY
threadDiscussion(threadDiscussionId: ID!): ThreadDiscussion

Arguments

threadDiscussionId
ID!
required
id
ID!
threadId
ID

The ID of the Plain thread this discussion is attached to. Null for global Sidekick agent sessions that were not started from a thread.

thread

The support thread when threadId is set. Null when the discussion has no thread (e.g. some global Sidekick sessions).

title
String!
Arguments
first
Int
after
String
last
Int
before
String

Lifecycle of the discussion: OPEN until it is resolved, RESOLVED when resolvedAt is set. What the agent is doing is reported separately by agentStatus.

What the agent working on this discussion is doing. UNKNOWN when no agent is involved. Prefer this over status for anything agent-related: status is narrowing to OPEN / RESOLVED.

The agent that was asked. Null means Plain's Sidekick.

resolvedAt
lastActivityAt

Timestamp of the most recent message in the discussion. Null when no messages have been posted yet.

isUnread
Boolean!

True when the discussion has an unread agent response (set when a Sidekick agent session settles into IDLE, cleared when the session is opened / marked read).

createdAt
createdBy
updatedAt
updatedBy

Channel-specific details for the discussion (Slack channel info, email recipients, or agent session ID). The concrete type depends on the discussion type.

agentSessionId
ID

The Sidekick agent session backing this discussion, when it has one. Set for AGENT_SESSION discussions and for SLACK discussions started by a Sidekick mention, whose session is linked to the discussion rather than carried in channelDetails. Null for discussions with no agent session.

Who can see this discussion. WORKSPACE means visible to all workspace members, USER means visible only to the creator. Null when not yet set.

sourceEntityId
ID

When the discussion was started from an entity page (company, tenant, etc.). Null when source is thread-only, a plain link, or absent.

The type of entity for sourceEntityId (e.g. COMPANY, TENANT). Null when sourceEntityId is not set.

What kind of source this discussion was started from (THREAD | PAGE | ENTITY | CHART). Null for older rows with no source.

The page path where this discussion was started (e.g. '/workspace/ws_xxx/insights'). Set for PAGE and CHART sources; null otherwise (older rows, or thread/entity-only context).

sourcePageAnchor
String

The page-fragment anchor (no '#') identifying the element the discussion was started from, e.g. a specific reporting chart. Kept separate from sourcePageLink, which is matched exactly as a page-scope key and must stay hash-free. Set only for PAGE and CHART sources; null otherwise.

type
Use channelDetails instead
slackTeamId
String
deprecated
Use channelDetails.slackTeamId instead
slackChannelId
String
deprecated
Use channelDetails.slackChannelId instead
slackChannelName
String
deprecated
Use channelDetails.slackChannelName instead
Use channelDetails.slackMessageLink instead
emailRecipients
[String!]!
deprecated
Use channelDetails.emailRecipients instead
queuedAgentSessionMessages

User-authored messages that the user has submitted but the agent has not picked up yet because it was mid-turn. Empty for non-AGENT_SESSION discussions. Frontend can render these as greyed-out preview bubbles pinned to the bottom of the chat; they disappear when the agent picks them up (a real ThreadDiscussionMessage is created at that point with a correctly-ordered timestamp) or when the queue is cleared by error / timeout / manual stop.

Query
Variables
Response