RealTimeX
Start For Free

RealTimeX

API Documentation

IntroductionAuthenticationBase URLHeadersError codes
ListGet infoAttachmentsAttachments summaryCreate groupGroup adminsGroup permissionsGroup informationGroup participants
Sample requestsSample responsesStatus codesAppendixChangelog

API Reference

Group Permissions

Overview

Update permission flags on a group conversation. Flags control who can send messages, edit group info, modify messages, add or remove members, and whether moderation is enabled — the SDK should read these values to show or hide actions in the group settings and composer.

Send the full groupPermissions object with the desired boolean values. The response returns the updated conversation document.

When to use this endpoint?

Use Group Permissions when:

  • A group admin toggles "Only admins can send messages" in the SDK settings panel.
  • You switch a broadcast-style group to read-only for regular members.
  • You enable or disable member self-service add/remove from the people picker.
  • You turn on moderation for a moderated community channel.

Part of the Chat Conversation APIs for the chat package / SDK — not Platform → Conversations. Requires a chat user Bearer token with admin privileges on the group (subject to onlyAdminCanEditInfo).

Request Fields

FieldTypeRequiredDescription
conversationIdstringRequiredThe group conversation's _id.
groupPermissionsobjectRequiredBoolean flags that define group behavior. See the permission flags table below.

Permission Flags

Each key inside groupPermissions controls a specific capability in the chat SDK:

FlagWhen trueSDK impact
onlyAdminCanSendMessageOnly group admins may send new messages.Hide or disable the message composer for non-admin members; useful for announcement channels.
onlyAdminCanEditInfoOnly admins may change group name, description, image, or permissions.Restrict group settings and permission toggles to admins in the SDK UI.
senderCanEditMessageMessage senders may edit their own messages after sending.Show an edit action on the sender's messages; hide it when false.
allowMemberAddRegular members (not only admins) may add participants.Expose "Add people" in the SDK to all members when true; admin-only when false.
allowMemberRemoveRegular members may remove other participants (within policy).Allow member-initiated removals from the participant list; admins can typically always remove members.
moderationEnabledModeration features are active for this group.Enable moderation workflows (review, flag, or restrict content) according to your SDK implementation.
PATCH{baseUrl}/api/{apiVersion}/conversation/group/permission/update

Authentication

Required (Bearer token)

Tenant-scoped

Yes (tenant DB — requires x-client-id)

Request Headers

HeaderValueDescription
AuthorizationBearer <chat_user_token>Chat user Bearer token for a group admin or owner.
is-tenanttrueTargets the tenant DB ("true", needs x-client-id).
x-client-id{{clientId}}Tenant (client) id. Required when is-tenant=true.
Content-Typeapplication/jsonJSON request body.

Request Payload

Example updating all permission flags for a group conversation:

json
{
  "conversationId": "694b...d8",
  "groupPermissions": {
    "onlyAdminCanSendMessage": false,
    "onlyAdminCanEditInfo": false,
    "senderCanEditMessage": true,
    "allowMemberAdd": true,
    "allowMemberRemove": false,
    "moderationEnabled": false
  }
}

Success Response (HTTP 200 OK)

On success, data.conversation.groupPermissions reflects the new flag values. Sync these in the SDK immediately so composers and settings menus match server state.

json
{
  "success": true,
  "message": "Group conversation permissions updated successfully",
  "data": {
    "conversation": {
      "_id": "694b...d8",
      "conversationType": "group",
      "groupName": "Dev Team",
      "groupDescription": "Sprint coordination",
      "groupImage": null,
      "participants": [
        "694b...a1",
        "694b...a2",
        "694b...a3"
      ],
      "groupAdmins": [
        "694b...a3"
      ],
      "owner": "694b...a3",
      "groupPermissions": {
        "onlyAdminCanSendMessage": false,
        "onlyAdminCanEditInfo": false,
        "senderCanEditMessage": true,
        "allowMemberAdd": true,
        "allowMemberRemove": false,
        "moderationEnabled": false
      },
      "unreadCount": {},
      "pinnedMessage": [],
      "lastMessage": "70a1...c4",
      "metadata": {
        "workspaceId": "c1"
      },
      "createdAt": "2026-07-10T09:00:00.000Z",
      "updatedAt": "2026-07-10T09:00:00.000Z"
    }
  },
  "error": null
}

Common Errors

Permission updates fail when the token is invalid, the conversation is missing, the caller is not an admin, or the payload is incomplete.

HTTP 401 Unauthorized — No token

json
{
  "success": false,
  "message": "No token, authorization denied",
  "data": null,
  "error": "Unauthorized"
}

HTTP 403 Forbidden — Insufficient permissions

json
{
  "success": false,
  "message": "Access denied: insufficient permissions",
  "data": null,
  "error": null
}

HTTP 404 Not Found — Conversation missing

json
{
  "success": false,
  "message": "Conversation not found",
  "data": null,
  "error": null
}

HTTP 400 Bad Request — Missing groupPermissions

json
{
  "success": false,
  "message": "groupPermissions object is required",
  "data": null,
  "error": null
}

HTTP 403 Forbidden - Error: locked by workspace admin

json
{
  "success": false,
  "message": "These permissions are locked by your workspace admin: onlyAdminCanSendMessage",
  "data": null,
  "error": ["onlyAdminCanSendMessage"]
}
CodeReason
401 UnauthorizedChat user token is missing, invalid, or expired.
403 ForbiddenCaller is not a group admin, or onlyAdminCanEditInfo blocks the change.
404 Not FoundNo group conversation matches conversationId.
400 Bad RequestMissing or malformed groupPermissions object.
500 Internal Server ErrorAn unexpected error occurred while updating permissions.

Best Practices

  • Send all six flags in each update so the server state stays predictable — merge current values in your SDK before PATCHing.
  • Reflect onlyAdminCanSendMessage in the composer immediately; do not rely on failed send attempts alone.
  • Pair permission changes with UI copy so members understand why actions were disabled.
  • Set conservative defaults at group create time via Create Group Conversation, then adjust here as needed.

Permissions updated

Re-read groupPermissions from the response and refresh SDK toggles, the message composer, and member management actions accordingly.

PreviousGroup adminsNextGroup information

On this page

OverviewWhen to use this endpoint?Request FieldsPermission FlagsRequest HeadersRequest PayloadSuccess ResponseCommon ErrorsBest Practices