Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

The "Unban User" operation for the Channel resource in this node allows you to remove a ban on a specific user from a particular chat channel. This is useful when you want to restore a user's access to a channel after they have been previously banned, enabling them to participate again in conversations and activities within that channel.

Common scenarios include:

  • Reinstating a user who was temporarily banned due to inappropriate behavior.
  • Managing user permissions dynamically based on moderation decisions.
  • Automating moderation workflows where bans are lifted after certain conditions or time periods.

For example, if a user was banned from a team chat channel for violating rules, an admin can use this operation to unban the user once the issue is resolved.

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 the full channel ID (CID). Required.
Target User ID The ID of the user to unban from the channel. Required.

Output

The output JSON contains the response from the Stream Chat API's unbanUser method for the specified channel and user. It typically includes details about the unban action, such as confirmation of success or any relevant metadata returned by the API.

No binary data is output by this operation.

Example output structure (simplified):

{
  "channel": {
    "type": "team",
    "id": "team-alpha"
  },
  "unbanned_user_id": "user123",
  "status": "success"
}

(Note: Actual output fields depend on the underlying API response.)

Dependencies

  • Requires an active connection to the Stream Chat service via an API key credential configured in n8n.
  • The API key must have sufficient permissions to perform channel moderation actions, including unbanning users.
  • No additional external dependencies beyond the Stream Chat API.

Troubleshooting

  • Common Issues:

    • Providing an incorrect or non-existent Channel ID or Channel Type will cause the operation to fail.
    • Specifying a Target User ID that is not currently banned or does not exist in the channel may result in errors or no effect.
    • Insufficient API permissions can lead to authorization errors.
  • Error Messages:

    • "Unsupported operation": Indicates the operation or resource combination is invalid; ensure "Channel" resource and "Unban User" operation are selected.
    • API errors related to invalid parameters or permissions will be surfaced with descriptive messages.
  • Resolution Tips:

    • Verify the Channel Type and Channel ID are correct and correspond to an existing channel.
    • Confirm the Target User ID is accurate and that the user was previously banned.
    • Check API credentials and permissions in your n8n credentials configuration.
    • Allow some propagation time after unbanning before the change reflects across all clients.

Links and References

Discussion