One to One Conversations

Last Edit: Nov 27 2020

Creating Conversations

Channels can be used to create one to one conversations between users as well. In most cases, you want conversations to be unique and make sure that two users have only a channel.

You can achieve this by leaving the channel ID empty and provide channel type, members, and custom data. When you do so, the API will ensure that only one channel for the members you specified exists (the order of the members does not matter).

You cannot add/remove members for channels created this way.

const conversation ='messaging', {
    members: ['thierry', 'tommaso'],

$conversation = $client->Channel('messaging', 'thierry-jenny', ['members'=>['thierry', 'jenny']]);
$state   = $conversation->create('thierry');
            "messaging", extraData: {"members": ["thierry", "tommaso"]});

val members = listOf("thierry", "tomasso")
val channelType = "messaging"
ChatClient.instance().createChannel(channelType, members).enqueue {
    val newChannel =

let john = User(id: "john")
let channel = .messaging, members: [User.current, john])

// Create the channel on backend
channel.create { (result) in
    // handle result

List<String> members = new ArrayList<>();

String channelType = "messaging";

ChatClient.instance().createChannel(channelType, members).enqueue(new Function1<Result<Channel>, Unit>() {
    public Unit invoke(Result<Channel> result) {
        Channel newChannel =;
        return Unit.INSTANCE;