Create conversation message

createConversationMessage(conversationId: ID!, input: CreateConversationMessageInput!): Message!

Arguments

ArgumentTypeRequired
conversationIdID!Yes
inputCreateConversationMessageInput!Yes

Input fields

input

CreateConversationMessageInput

FieldTypeRequiredDescription
roleString!YesMessage role; only user is accepted.
partsJSON!YesMessage parts (1 to 200).
parentIdIDNoParent message; defaults to the selected branch.
composingUserIdIDNoMust equal the authenticated user when set.
idempotencyKeyStringNoRetry key (up to 255 characters): the same key returns the same message.
metadataJSONNoJSON object under 64 KB.

Response

Returns Message!. Open the type for its fields and nested types.

FieldTypeDescription
idID!
conversationIdID!
parentIdID
seqInt!
roleString!
createdByID
senderTypeString!Sender kind: user, webhook, service_account, integration, agent or system.
senderIdIDIdentifier of the sender: the participant or agent for an agent message, otherwise the author.

All fields of Message.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation CreateConversationMessage($conversationId: ID!, $input: CreateConversationMessageInput!) {
  createConversationMessage(conversationId: $conversationId, input: $input) {
    id
    status
    createdAt
    updatedAt
    conversationId
  }
}
json
{
  "conversationId": "00000000-0000-4000-8000-000000000001",
  "input": {
    "role": "user",
    "parts": [
      {
        "type": "text",
        "text": "Hello"
      }
    ]
  }
}