chatConversation
Requires an authenticated session.
Returns one conversation: its title, type, message count and last message time. It is available to the conversation's owner, to members of its channel, and in the default channel. A conversation of another organization reads as missing. Needs a signed-in user.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query ChatConversation($id: String!) {
chatConversation(id: $id) {
id
title
type
createdAt
channelId
isGroup
messages {
id
createdAt
content
conversationId
metadata
role
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query ChatConversation($id: String!) {\n chatConversation(id: $id) {\n id\n title\n type\n createdAt\n channelId\n isGroup\n messages {\n id\n createdAt\n content\n conversationId\n metadata\n role\n }\n }\n}",
"variables": {
"id": "string"
}
}
EOF
Variables:
{
"id": "string"
}
Response:
{
"data": {
"chatConversation": {
"id": "id",
"title": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"channelId": "string",
"isGroup": true,
"messages": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"content": "string",
"conversationId": "string",
"metadata": {},
"role": "string"
}
]
}
}
}
chatConversation(
id: String!
): ChatConversation!
Arguments
chatConversation.id ● String! non-null scalar
The ID of the conversation.
Type
ChatConversation object
A chat conversation: a direct chat, a group or a channel.