# Why can I only create 1 channel?

**URL:** <https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356>\
**Category:** Flutter\
**Tags:** group-channel\
**Created:** [May 18, 2023, 5:27am UTC](https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356 "2023-05-18T05:27:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://community.sendbird.com/u/peter)\
**Post date:** [May 18, 2023, 5:27am UTC](https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356/1 "2023-05-18T05:27:55Z")

</div>

I am trying to create multiple 1:1 channels for private chat within my flutter app. I am creating a GroupChannel with two unique userIds and a unique channelUrl for each channel. The first time I create a channel it works fine and I can see it in my dashboard. Every subsequent attempt the code executes without error but no channel is created in my dashboard. When I delete the one channel that created successfully manually from my dashboard, I am able to create another channel but this is the only way I am able to create more than one channel in total from code. I receive no error and there is no information on why this is happening.

Flutter SDK, current version

Create a channel with the following code and the channel is created successfully and appears in dashboard. Then update the userId’s and channel url and execute the code again. It runs without error but no channel is created in dashboard.

this happens 100% of the time.

Critical impact. The service is obviously useless if this is as designed.

```auto
try {
      final params = sb.GroupChannelParams()
        ..userIds = ['user1', 'user2']
        ..isDistinct = true
        ..channelUrl = 'user1-user2-channel';

      final channel = await sb.GroupChannel.createChannel(params);
      return channel;
    } catch (e) {
      print('createChannel: ERROR: $e');
      rethrow;
    }

```

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [May 18, 2023, 6:56am UTC](https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356/2 "2023-05-18T06:56:46Z")

</div>

Hello @peter,

Welcome to the Sendbird Community.

> **[Create a channel | Chat Flutter SDK | Sendbird Docs](https://sendbird.com/docs/chat/sdk/v3/flutter/channel/creating-a-channel/create-a-channel)**
>
> Guides for quick and easy integration of Sendbird Chat, Calls and Desk for iOS, Android, JavaScript, Unity, .NET and Platform API.

> If you want to create and continue to use a single group channel for a 1-to-1 chat, set the `isDistinct` property of the channel to `true` . If the `isDistinct` property is set to `false` , multiple 1-to-1 channels with their own chat history and data may be created for the same two users even if a channel already exists between them.

What you’re describing is expected behavior. If you set `isDistinct` to false, this will no longer occur.

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://community.sendbird.com/u/peter)\
**Post date:** [May 18, 2023, 10:19pm UTC](https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356/3 "2023-05-18T22:19:35Z")

</div>

Hi @Tyler, thanks for the quick response. I figured this out shortly after I posted my issue. The part that was/is confusing to me is perhaps in the wording…

> If you want to create and continue to use a single group channel for a 1-to-1 chat, set the `isDistinct` property of the channel to `true` .

This is what I want to do however, I do not want this to happen:

> If the `isDistinct` property is set to `false` , multiple 1-to-1 channels with their own chat history and data may be created for the same two users even if a channel already exists between them.

So, I want a 1:1 chat but I don’t want more than one channel for the same two users, which it seemed was possible or likely to happen if isDistinct isn’t true. I guess in order to achieve my goal I need to set isDistinct to false and use a unique channelUrl for every pair of users in order to avoid having multiple channels for the same pair of users, if that makes sense?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [May 18, 2023, 11:47pm UTC](https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356/4 "2023-05-18T23:47:44Z")

</div>

@peter,

I’m not sure I understand your problem. If you are creating channel, with the same two user\_ids, and you’re passing `isDistinct` as `true`, the system will create a channel if no channel exists. If it does exists, it passes back the existing channel. This accurately describes the behavior you outlined in your original post.

In your original post, it sounds like you were expecting multiple channels thus you should set `isDistinct` to `false`. If you don’t want multiple channels for the same 1:1, continue to use `isDistinct` as `true`.

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://community.sendbird.com/u/peter)\
**Post date:** [May 19, 2023, 1:26am UTC](https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356/5 "2023-05-19T01:26:55Z")

</div>

Hi @Tyler ,

The problem I mentioned in the original post was that I couldn’t create more than 1 channel for a single user. If I create a channel where the userIds = [‘user1’, ‘user2’] with isDistinct = true then try and create another channel where userIds = ['user1, ‘user3’] with isDistinct = true it does not create the channel. The only channel that is ever created is the first one.

I am trying to create multiple distinct channels for a specific user. Ex. user1 and user2, user1 and user3, user1 and user4 etc… but I can only ever create the first channel that I attempt. Subsequent channels are not created so long as isDistinct = true.

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://community.sendbird.com/u/peter)\
**Post date:** [May 19, 2023, 1:46am UTC](https://community.sendbird.com/t/why-can-i-only-create-1-channel/7356/6 "2023-05-19T01:46:16Z")

</div>

I think I just figured it out… All the users need to already be created in SendBird. I was trying to create channels for a single user with other users that were not already created within sendbird. Once I created a bunch of test users in the system I am now able to create distinct channels for each pair as I originally wanted. Thank you for all your help @Tyler I would have gone down the wrong path without it. 🙂
