Mutation
mutation CreateThreadDiscussion($input: CreateThreadDiscussionInput!) {
createThreadDiscussion(input: $input) {
threadDiscussion {
id
threadId
thread {
id
ref
customer {
__typename
}
title
description
previewText
}
title
messages {
edges {
__typename
}
pageInfo {
__typename
}
}
status
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"threadId": "id",
"markdownContent": "string",
"type": "EMAIL"
}
}Response
{
"data": {
"createThreadDiscussion": {
"threadDiscussion": {
"id": "id",
"threadId": "id",
"thread": {
"id": "id",
"ref": "string",
"customer": {
"__typename": "Customer"
},
"title": "string",
"description": "string",
"previewText": "string"
},
"title": "string",
"messages": {
"edges": [
{
"__typename": "ThreadDiscussionMessageEdge"
}
],
"pageInfo": {
"__typename": "PageInfo"
}
},
"status": "OPEN"
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
createThreadDiscussion
Start a new discussion on a Plain thread. Supports Slack (posts a new thread in a connected Slack channel), Email (sends an outbound email chain), and Cursor workspace background agent discussions. The markdownContent field is sent as the opening message; for Slack discussions you may also supply slackBlocks (JSON-encoded Block Kit array) for rich Slack formatting while markdownContent serves as the Plain UI fallback. Prefer createDiscussion for new integrations.
MUTATION
createThreadDiscussion(input: CreateThreadDiscussionInput!): CreateThreadDiscussionOutput!Arguments
input
required
Returns
threadDiscussion
error
Mutation
mutation CreateThreadDiscussion($input: CreateThreadDiscussionInput!) {
createThreadDiscussion(input: $input) {
threadDiscussion {
id
threadId
thread {
id
ref
customer {
__typename
}
title
description
previewText
}
title
messages {
edges {
__typename
}
pageInfo {
__typename
}
}
status
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"threadId": "id",
"markdownContent": "string",
"type": "EMAIL"
}
}Response
{
"data": {
"createThreadDiscussion": {
"threadDiscussion": {
"id": "id",
"threadId": "id",
"thread": {
"id": "id",
"ref": "string",
"customer": {
"__typename": "Customer"
},
"title": "string",
"description": "string",
"previewText": "string"
},
"title": "string",
"messages": {
"edges": [
{
"__typename": "ThreadDiscussionMessageEdge"
}
],
"pageInfo": {
"__typename": "PageInfo"
}
},
"status": "OPEN"
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

