Mutation
mutation SendCustomerChat($input: SendCustomerChatInput!) {
sendCustomerChat(input: $input) {
chat {
id
text
customerReadAt {
unixTimestamp
iso8601
}
attachments {
id
fileName
fileSize {
__typename
}
fileExtension
fileMimeType
type
}
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"threadId": "id"
}
}Response
{
"data": {
"sendCustomerChat": {
"chat": {
"id": "id",
"text": "string",
"customerReadAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"attachments": [
{
"id": "id",
"fileName": "string",
"fileSize": {
"__typename": "FileSize"
},
"fileExtension": "string",
"fileMimeType": "string",
"type": "EMAIL"
}
],
"createdAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"createdBy": {
"__typename": "UserActor"
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
sendCustomerChat
Send a chat message on behalf of a customer into an existing CHAT-channel thread. Use this in a
headless portal integration to forward messages written by the customer in your own UI into Plain.
Unlike sendChat, threadId is required and the caller must be authenticated as a machine user.
An optional timestamp (ISO 8601, must be in the past) allows backdating messages when backfilling.
Requires the chat:create permission and the headless-portal billing entitlement.
MUTATION
sendCustomerChat(input: SendCustomerChatInput!): SendCustomerChatOutput!Arguments
input
required
Returns
chat
error
Mutation
mutation SendCustomerChat($input: SendCustomerChatInput!) {
sendCustomerChat(input: $input) {
chat {
id
text
customerReadAt {
unixTimestamp
iso8601
}
attachments {
id
fileName
fileSize {
__typename
}
fileExtension
fileMimeType
type
}
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"threadId": "id"
}
}Response
{
"data": {
"sendCustomerChat": {
"chat": {
"id": "id",
"text": "string",
"customerReadAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"attachments": [
{
"id": "id",
"fileName": "string",
"fileSize": {
"__typename": "FileSize"
},
"fileExtension": "string",
"fileMimeType": "string",
"type": "EMAIL"
}
],
"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?

