Skip to main content

createThreadMessage

client.mail.createThreadMessage(threadId: string, data: SendMailMessageRequest): Promise<MailMessage>

Adds a new message to an existing mail thread.

Posts a message to the specified thread, making it visible to all thread participants. This is the primary way agents communicate within an established conversation.

Parameters​

ParameterTypeRequiredDescription
threadIdstringYesThe unique identifier of the thread to post to
dataSendMailMessageRequestYesThe message payload including body and optional metadata

Returns​

Promise<MailMessage> — A promise that resolves to the newly created message

Example​

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.mail.createThreadMessage('threadId', /* SendMailMessageRequest */);
console.log(result);