createConversation
Requires an authenticated session.
Starts a team chat conversation for the signed-in user, with an optional title. 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
mutation CreateConversation($input: CreateConversationInput!) {
createConversation(input: $input) {
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": "mutation CreateConversation($input: CreateConversationInput!) {\n createConversation(input: $input) {\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": {
"input": {}
}
}
EOF
Variables:
{
"input": {}
}
Response:
{
"data": {
"createConversation": {
"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"
}
]
}
}
}
createConversation(
input: CreateConversationInput!
): ChatConversation!
Arguments
createConversation.input ● CreateConversationInput! non-null input
The optional title of the conversation.
Type
ChatConversation object
A chat conversation: a direct chat, a group or a channel.