Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

The "Add Moderators" operation for the Channel resource in this node allows you to assign moderator roles to specified users within a particular chat channel. Moderators typically have elevated permissions such as managing members, messages, and enforcing rules within the channel.

This operation is useful in scenarios where you want to delegate moderation responsibilities to trusted users in group chats, team channels, or livestream broadcast channels. For example, in a team collaboration app, you might add project leads as moderators to manage discussions and maintain order.

Practical example:

  • Add user IDs "john_doe" and "jane_smith" as moderators to the "team-alpha" channel of type "team" to empower them with moderation capabilities.

Properties

Name Meaning
Channel Type The type of the channel. Common options include: "messaging" (1-on-1 chats), "team" (group channels), "livestream" (broadcast channels).
Channel ID Unique identifier for the channel (e.g., "general", "random", "team-alpha"). Combined with Channel Type to form the full channel identifier.
Members Comma-separated list of user IDs to be added as moderators (e.g., "john_doe,jane_smith,admin123"). No spaces around commas.

Output

The output JSON contains the response from the Stream Chat API after attempting to add the specified users as moderators to the given channel. This typically includes details about the updated channel state or confirmation of the successful addition of moderators.

If the operation fails, the output will contain an error message describing the issue.

No binary data is produced by this operation.

Dependencies

  • Requires a valid API key credential for the Stream Chat service configured in n8n.
  • The API credentials must have sufficient permissions to modify channel moderators.
  • Network access to the Stream Chat API endpoint is required.

Troubleshooting

  • Common issues:

    • Invalid or missing Channel Type or Channel ID can cause failures.
    • User IDs provided in the Members field must exist in the Stream Chat system; otherwise, the operation may fail.
    • Insufficient API permissions will result in authorization errors.
    • Formatting errors in the Members string (e.g., spaces around commas) may lead to unexpected behavior.
  • Error messages:

    • "Unsupported operation: channel.addModerators": Indicates the operation is not recognized, possibly due to misconfiguration.
    • API errors related to invalid channel or user IDs will be returned as part of the output JSON error field.
    • Network or authentication errors will cause the node to throw exceptions unless "Continue On Fail" is enabled.

To resolve errors, verify all input parameters, ensure users exist, and confirm API credentials have the necessary rights.

Links and References

Discussion