Skip to main content

createMessage

Requires an authenticated session.

Posts a message to a conversation the caller has access to, and delivers it live to the people who can see that conversation. 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:

mutation CreateMessage($input: CreateMessageInput!) {
createMessage(input: $input) {
id
createdAt
content
conversationId
metadata
role
sender {
id
postalCode
name
firstName
lastName
status
}
}
}

Variables:

{
"input": {
"content": "string",
"conversationId": "string",
"role": "string"
}
}

Response:

{
"data": {
"createMessage": {
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"content": "string",
"conversationId": "string",
"metadata": {},
"role": "string",
"sender": {
"id": "id",
"postalCode": "string",
"name": "string",
"firstName": "string",
"lastName": "string",
"status": "ACTIVE"
}
}
}
}
createMessage(
input: CreateMessageInput!
): ChatMessage!

Arguments​

createMessage.input ● CreateMessageInput! non-null input​

The conversation, the sender role, the text and optional metadata.

Type​

ChatMessage object​

One message in a chat conversation.