messageThreads Query
Description
Retrieves messages grouped into conversations, most recently updated first. A thread is an order when the messages carry one, and the sender otherwise. Pagination counts threads rather than messages, so a page holds more correspondence than the messages query does. Read a thread's messages with the messages query, passing the thread's orderRef.
query messageThreads($page: Int, $from: FromEnum, $includeEvents: Boolean) {
messageThreads(page: $page, from: $from, includeEvents: $includeEvents) {
threads {
key
orderId
orderIncId
orderRef
subject
participants
messageCount
unreadCount
flagged
via
updated
}
pagination {
limit
count
page
pages
hasMore
}
}
}
Variables
{
"page": 1,
"from": "buyer",
"includeEvents": true
}
Response
{
"messageThreads": {
"threads": [
{
"key": "c0d306b1e735390923863952",
"orderId": "example",
"orderIncId": 42,
"orderRef": "1da5ea3b89e5a0815483d573",
"subject": "example",
"participants": [
"example"
],
"messageCount": 42,
"unreadCount": 42,
"flagged": true,
"via": "example",
"updated": 1747207627145
}
],
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true
}
}
}
Arguments
| Name | Type | Description |
|---|---|---|
page | Int | The requested page number. Defaults to 1 if not specified. |
from | FromEnum | Keep only threads a given side has written in. The thread itself is still summarised in full, so counts and the preview cover both sides of the conversation. |
includeEvents | Boolean | Treat events Discogs generates ("… changed the order status to Shipped", "… sent payment of …") as conversation. Off by default: threads are then judged by what people wrote — one holding only events is not listed, and the preview, date, unread count and side come from written messages. |