You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, `user_id_1` was promoted to channel admin and `user_id_2` was demoted.
7773
+
When `channel_admins` is omitted, existing admin roles are preserved.
7774
+
7775
+
__Minimum server version__: 11.7
7776
+
##### Permissions
7777
+
Must have `manage_system` permission (system admin only).
7778
+
operationId: SetChannelMembers
7779
+
parameters:
7780
+
- name: channel_id
7781
+
in: path
7782
+
description: Channel GUID
7783
+
required: true
7784
+
schema:
7785
+
type: string
7786
+
- name: batch_size
7787
+
in: query
7788
+
description: Number of add/remove operations per batch.
7789
+
schema:
7790
+
type: integer
7791
+
default: 100
7792
+
minimum: !!float 1
7793
+
maximum: !!float 1000
7794
+
- name: batch_delay_ms
7795
+
in: query
7796
+
description: Milliseconds to pause between batches, giving the server time to process websocket events and plugin hooks.
7797
+
schema:
7798
+
type: integer
7799
+
default: 500
7800
+
maximum: !!float 10000
7801
+
requestBody:
7802
+
description: JSON object specifying the complete desired membership and optional channel admin designations. Request body is limited to 12 MB.
7803
+
content:
7804
+
application/json:
7805
+
schema:
7806
+
type: object
7807
+
required:
7808
+
- members
7809
+
properties:
7810
+
members:
7811
+
type: array
7812
+
items:
7813
+
type: string
7814
+
description: User IDs for the desired channel membership. The final membership is the union of `members` and `channel_admins`.
7815
+
channel_admins:
7816
+
type: array
7817
+
nullable: true
7818
+
items:
7819
+
type: string
7820
+
description: User IDs that should have the channel admin role. Users listed here are automatically included in the desired membership (they do not need to also appear in `members`). When null or omitted, existing admin roles are preserved for members who remain in the channel. When present (including empty array), admin roles are set declaratively.
7821
+
required: true
7822
+
responses:
7823
+
"200":
7824
+
description: |
7825
+
Streamed NDJSON response. Each line is a JSON object representing one batch of results.
7826
+
7827
+
If the operation is interrupted (e.g. context cancellation), a final NDJSON line
7828
+
with an `error` field is emitted so the client can distinguish partial from full
7829
+
success: `{"error":"The set channel members operation was cancelled."}`
7830
+
content:
7831
+
application/x-ndjson:
7832
+
schema:
7833
+
oneOf:
7834
+
- type: object
7835
+
description: A batch of results from the set channel members operation.
7836
+
properties:
7837
+
added:
7838
+
type: array
7839
+
items:
7840
+
type: string
7841
+
description: User IDs successfully added to the channel in this batch.
7842
+
removed:
7843
+
type: array
7844
+
items:
7845
+
type: string
7846
+
description: User IDs successfully removed from the channel in this batch.
7847
+
promoted:
7848
+
type: array
7849
+
items:
7850
+
type: string
7851
+
description: User IDs promoted to channel admin in this batch.
7852
+
demoted:
7853
+
type: array
7854
+
items:
7855
+
type: string
7856
+
description: User IDs demoted from channel admin in this batch.
0 commit comments