Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

The node performs server-side operations on Stream Chat channels, specifically including the ability to mute a channel for a user. Muting a channel prevents notifications or alerts from that channel for the specified user for a given duration. This is useful in scenarios where users want to temporarily silence conversations without leaving or blocking the channel.

Practical examples:

  • A user wants to mute a busy team chat ("team" type channel) during focused work hours.
  • Temporarily muting a livestream channel to avoid distractions during an event.
  • Muting a messaging (1-on-1) chat with a colleague while in a meeting.

Properties

Name Meaning
Channel Type The type of the channel. Common options: "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 type to form CID. Required.
User ID The user ID for whom the mute operation will be applied. Required for mute operation.
Mute Expiration (Minutes) Optional duration in minutes for how long the mute should last. Minimum value is 1 minute. Defaults to 60 minutes if not set.

Output

The output JSON contains the response from the Stream Chat API for the mute operation. It typically includes details about the mute status and any relevant metadata returned by the API.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "channel": {
    "cid": "messaging:general",
    "muted": [
      {
        "user_id": "user123",
        "expires": "2024-06-01T12:00:00Z"
      }
    ]
  }
}

Dependencies

  • Requires an API key credential configured in n8n to authenticate with the Stream Chat service.
  • The node uses the official Stream Chat server-side client library to perform operations.
  • Proper permissions must be granted to the API key to allow muting channels.

Troubleshooting

  • Common issues:

    • Missing or invalid Channel ID or User ID parameters will cause errors.
    • Insufficient API permissions may result in authorization errors.
    • Providing an invalid channel type or non-existent channel ID will cause the operation to fail.
    • Setting mute expiration below 1 minute is disallowed.
  • Error messages:

    • "Unsupported operation: channel.mute": Indicates the operation name or resource was incorrect.
    • API errors related to authentication or permission denied: Check API key credentials and permissions.
    • JSON parsing errors if input parameters are malformed (not applicable here since inputs are simple strings/numbers).
  • Resolution tips:

    • Verify all required fields are correctly filled.
    • Ensure the API key has channel moderation rights.
    • Confirm the channel exists and the user ID is valid in your Stream Chat app.
    • Use the default mute expiration or specify a valid number ≥ 1.

Links and References

Discussion