Query
query RelatedThreads($threadId: ID!) {
relatedThreads(threadId: $threadId) {
thread {
id
ref
customer {
id
externalId
fullName
shortName
email {
__typename
}
avatarUrl
}
title
description
previewText
}
distance
}
}Variables
{
"threadId": "id"
}Response
{
"data": {
"relatedThreads": [
{
"thread": {
"id": "id",
"ref": "string",
"customer": {
"id": "id",
"externalId": "id",
"fullName": "string",
"shortName": "string",
"email": {
"__typename": "EmailAddress"
},
"avatarUrl": "string"
},
"title": "string",
"description": "string",
"previewText": "string"
},
"distance": 1.5
}
]
}
}Queries
relatedThreads
Find threads that are semantically similar to the given thread, ranked by relevance. Each result includes the thread and a distance score (lower means more similar). Useful for surfacing related support history or finding duplicate issues. Requires the thread:read permission.
QUERY
relatedThreads(threadId: ID!): [ThreadWithDistance!]!Arguments
threadId
ID!
required
Returns
thread
distance
Float!
Semantic distance to the source thread. Lower values indicate greater similarity.
Query
query RelatedThreads($threadId: ID!) {
relatedThreads(threadId: $threadId) {
thread {
id
ref
customer {
id
externalId
fullName
shortName
email {
__typename
}
avatarUrl
}
title
description
previewText
}
distance
}
}Variables
{
"threadId": "id"
}Response
{
"data": {
"relatedThreads": [
{
"thread": {
"id": "id",
"ref": "string",
"customer": {
"id": "id",
"externalId": "id",
"fullName": "string",
"shortName": "string",
"email": {
"__typename": "EmailAddress"
},
"avatarUrl": "string"
},
"title": "string",
"description": "string",
"previewText": "string"
},
"distance": 1.5
}
]
}
}Was this page helpful?

