Create Channel
    • Dark
      Light
    • PDF

    Create Channel

    • Dark
      Light
    • PDF

    Article summary

    Post
    /api/v1/channels.create

    Create a public channel. Optionally, include specified users. The channel creator is included as a member by default. Channel naming has restraints following the regex filter [0-9a-zA-Z-_.]+ by default. See UTF8 Settings to modify regex filter for channel names. Channel names must not allow for any whitespaces.

    Changelog

    VersionDescription
    6.4.1Added excludeSelf param
    0.13.0Added
    Header parameters
    X-Auth-Token
    stringRequired

    The authToken of the authenticated user.

    ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
    X-User-Id
    stringRequired

    The userId of the authenticated user.

    ExamplerbAXPnMktTFbNpwtJ
    Body parameters
    Example
    {
      "name": "channelname",
      "members": [
        "rocket.cat"
      ],
      "readOnly": true,
      "excludeSelf": true,
      "customFields": {
        "type": "default"
      },
      "extraData": {
        "broadcast": true,
        "encrypted": false,
        "teamId": "658441562dd9f928ad9951aa"
      }
    }
    Expand All
    object
    name
    string Required

    The name of the channel.

    members
    Array of string

    An array of the users to be added to the channel when it is created.

    string
    readOnly
    boolean

    Set if the channel is read only or not. It is false by default.

    excludeSelf
    boolean

    If set to true, the user calling the endpoint is not automatically added as a member of the channel. The default value is false.

    customFields
    object

    If you have defined custom fields for your workspace, you can provide them in this object parameter.

    extraData
    object

    Enter the following details for the object:

    • broadcast: Whether the channel should be a broadcast group.
    • encrypted: Whether the channel should be encrypted.
    • teamId: Enter the team ID for which you want to create a group.

    For more information, see Channels.

    Responses
    200

    OK

    Example
    {
      "channel": {
        "_id": "ByehQjC44FwMeiLbX",
        "name": "channelname",
        "t": "c",
        "usernames": [
          "example"
        ],
        "msgs": 0,
        "u": {
          "_id": "aobEdbYhXfu5hkeqG",
          "username": "example"
        },
        "ts": "2016-05-30T13:42:25.304Z"
      },
      "success": true
    }
    Expand All
    object
    channel
    object
    _id
    string
    fname
    string
    _updatedAt
    string
    customFields
    object
    name
    string
    t
    string
    msgs
    integer
    usersCount
    integer
    u
    object
    _id
    string
    username
    string
    name
    string
    ts
    string
    ro
    boolean
    default
    boolean
    sysMes
    boolean
    success
    boolean
    401

    Unauthorized

    Authorization Error
    {
      "status": "error",
      "message": "You must be logged in to do this."
    }
    object
    status
    string
    message
    string

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.