createThreadFromSlackMessage creates a thread from a top-level message in a connected customer Slack channel. The thread includes the replies Plain has already received for that message. It is the trigger for API-only ingestion, and it works in every other ingestion mode too.
For TypeScript, the GraphQL SDK gives you a fully typed client for these operations.
slackChannelId and slackMessageTimestamp. Replies are rejected.
You need an API key with the thread:create permission.
Mutation
Variables
Getting the created thread
Ingestion runs asynchronously. The mutation returnsthread only when that Slack message was already a thread. When the request is accepted and the thread is still being created, thread is null and error is null.
Fetch the thread with threadBySlackPermalink, or subscribe to thread.thread_created. Calling the mutation again for the same message returns the existing thread rather than creating a second one.
Query
Variables
threadBySlackPermalink returns null until the thread exists. The permalink is the Slack link to the top-level message.
Messages the mutation rejects
The mutation returnscannot_create_thread_from_slack_message when:
- The Slack channel is not connected to this workspace
- The connected channel is disabled
- The connected channel is not a customer channel
- The message is a reply rather than a top-level message

