Mutation
mutation ImportThreadMessages($input: ImportThreadMessagesInput!) {
importThreadMessages(input: $input) {
results {
threadMessage {
__typename
... on TimelineEntry {
__typename
}
}
result
error {
message
type
code
fields {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"threadId": "id",
"threadMessages": [
{
"author": {},
"text": "string",
"createdAt": "string",
"type": "INBOUND",
"externalId": "id"
}
]
}
}Response
{
"data": {
"importThreadMessages": {
"results": [
{
"threadMessage": {
"__typename": "TimelineEntry"
},
"result": "UPDATED",
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"__typename": "MutationFieldError"
}
]
}
}
],
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
importThreadMessages
Backfill up to 25 historical messages onto an existing thread. Each message requires an externalId for idempotency — re-importing the same ID returns NOOP for that message. INBOUND messages must be authored by a customer; OUTBOUND and NOTE messages must be authored by a user. Requires the thread:import permission.
MUTATION
importThreadMessages(input: ImportThreadMessagesInput!): ImportThreadMessagesOutput!Arguments
input
required
Returns
results
Per-message results in the same order as the input. Each result contains either the imported message or an error.
error
Mutation
mutation ImportThreadMessages($input: ImportThreadMessagesInput!) {
importThreadMessages(input: $input) {
results {
threadMessage {
__typename
... on TimelineEntry {
__typename
}
}
result
error {
message
type
code
fields {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"threadId": "id",
"threadMessages": [
{
"author": {},
"text": "string",
"createdAt": "string",
"type": "INBOUND",
"externalId": "id"
}
]
}
}Response
{
"data": {
"importThreadMessages": {
"results": [
{
"threadMessage": {
"__typename": "TimelineEntry"
},
"result": "UPDATED",
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"__typename": "MutationFieldError"
}
]
}
}
],
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

