Mutation
mutation AddGeneratedReply($input: AddGeneratedReplyInput!) {
addGeneratedReply(input: $input) {
generatedReply {
id
markdown
timelineEntryId
text
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"threadId": "id",
"timelineEntryId": "id",
"markdown": "string"
}
}Response
{
"data": {
"addGeneratedReply": {
"generatedReply": {
"id": "id",
"markdown": "string",
"timelineEntryId": "id",
"text": "string",
"createdAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"createdBy": {
"__typename": "UserActor"
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
addGeneratedReply
Programmatically add a suggested reply to a thread. The reply is surfaced to teammates in Plain so they can review, edit, and send it — the customer sees nothing until a teammate explicitly sends it. The timelineEntryId must reference a customer message on the thread. The markdown field is capped at 5,000 characters. Requires the generatedReply:create permission.
MUTATION
addGeneratedReply(input: AddGeneratedReplyInput!): AddGeneratedReplyOutput!Arguments
input
required
Returns
generatedReply
error
Mutation
mutation AddGeneratedReply($input: AddGeneratedReplyInput!) {
addGeneratedReply(input: $input) {
generatedReply {
id
markdown
timelineEntryId
text
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"threadId": "id",
"timelineEntryId": "id",
"markdown": "string"
}
}Response
{
"data": {
"addGeneratedReply": {
"generatedReply": {
"id": "id",
"markdown": "string",
"timelineEntryId": "id",
"text": "string",
"createdAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"createdBy": {
"__typename": "UserActor"
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

