createConversation

abstract suspend fun createConversation(remoteConfiguration: RemoteConfiguration? = null, modality: Modality = Modality.Messaging): Result<Conversation>

Explicitly creates a conversation on the server without sending a message.

This is useful when the deployment is connected to a Chatbot or Agentforce Agent and you want the user to be placed directly into an active conversation without requiring them to send an initial message. The bot/agent can greet the user immediately once the conversation is created.

In other cases, calling sendMessage or submitRemoteConfiguration with createConversationOnSubmit = true will create the conversation automatically.

Return

Result.Success with the created Conversation, or Result.Error on failure.

Parameters

remoteConfiguration

Optional RemoteConfiguration for routing data. Pass null if no pre-chat fields are required.

modality

The Modality for the conversation. Defaults to Modality.Messaging.

See also