Skip to main content

Create a group channel

Create a group channel. The creator is automatically set as the channel owner and joins the group.

Request

POST: https://[Base URL](/platform-chat-api/base-url)/v4/group-channel/create

Rate limit: 100 per second

Signature: Required. See API request signature.

Request body

Content type: application/json

ParameterTypeRequiredDescription
channelIdStringYesGroup channel ID. Max 64 characters. Supports uppercase and lowercase letters and numbers.
nameStringYesGroup name. Max 64 characters. Duplicate names are allowed.
ownerStringYesUser ID of the channel owner. The group creator is set as the channel owner and automatically joins the group.
userIdsArrayNoArray of user IDs to invite to the group. Max 30 users per request.
groupProfileJSONNoGroup basic information in JSON format. See the key descriptions below.
permissionsJSONNoGroup permission settings in JSON format. See the key descriptions below.
groupExtProfileJSONNoGroup extended information in JSON format. Keys must be prefixed with ext_ and cannot exceed 32 characters. Values cannot exceed 256 characters. Up to 10 key-value pairs are supported by default.

groupProfile keys:

KeyTypeDescription
introductionStringGroup introduction. Max 512 characters.
announcementStringGroup announcement. Max 1024 characters.
portraitUrlStringGroup avatar URL. Max 128 characters.

permissions keys:

KeyTypeDescription
joinPermNumberPermission to join the group. 0: Owner approval required (default). 1: No approval needed. 2: Approved by owner or admin. 3: No one can join.
removePermNumberPermission to remove members. 0: Owner only (default). 1: Owner and admins. 2: All members.
memInvitePermNumberPermission to invite others. 0: Owner only (default). 1: Owner and admins. 2: All members.
invitePermNumberInvitation handling. 0: Invitee consent not required (default). 1: Invitee consent required.
profilePermNumberPermission to modify group profile. 0: Owner only (default). 1: Owner and admins. 2: All members.
memProfilePermNumberPermission to set member profile. 0: Owner, admins, and self (default). 1: Owner and self. 2: Self only.

Request example

HTTP
POST /v4/group-channel/create HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json

{
"channelId": "2222334444",
"name": "testGName",
"owner": "userId",
"userIds": ["userA", "userB"]
}

Response

FieldTypeDescription
codeNumberReturn code. 0 indicates success. See Status codes.

Response example

HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"code":0}