Actions60
- User Actions
- Channel Actions
- Accept Invite
- Add Members
- Add Moderators
- Archive
- Ban User
- Create
- Delete
- Delete File
- Delete Image
- Demote Moderators
- Disable Slow Mode
- Enable Slow Mode
- Get Config
- Hide
- Invite Members
- Mark Read
- Mark Unread
- Mute
- Mute Status
- Pin
- Query Channels
- Query Members
- Reject Invite
- Remove Members
- Send Action
- Send File
- Send Image
- Show
- Stop Watching
- Truncate
- Unarchive
- Unban User
- Unmute
- Unpin
- Update
- Watch
- Message Actions
- Moderation Actions
Overview
The node provides server-side operations for managing users in a Stream Chat application. Specifically, the User Upsert operation allows you to create or update a user by specifying a unique user ID and associated user data. This is useful when you want to ensure a user exists with certain properties, such as name, email, role, or custom fields, without needing to check if the user already exists.
Common scenarios include:
- Creating new users dynamically when they sign up on your platform.
- Updating existing user profiles with new information.
- Synchronizing user data from an external system into Stream Chat.
Example: You can upsert a user with ID "john_doe" and provide JSON data like {"name": "John Doe", "role": "admin", "image": "https://example.com/avatar.jpg"} to create or update that user's profile in Stream Chat.
Properties
| Name | Meaning |
|---|---|
| User ID | A unique identifier for the user. Can be any string (e.g., "john_doe", "user123"). |
| User Data | User data as a JSON object including properties like name, email, image URL, role, and custom fields. The "id" field is set automatically based on User ID. Example: {"name": "John", "role": "admin"} |
Output
The output is a JSON object representing the created or updated user as returned by the Stream Chat API. It includes all user properties after the upsert operation, such as the user ID, name, role, image, and any other custom fields provided.
No binary data is output by this operation.
Dependencies
- Requires an API key credential configured in n8n to authenticate with the Stream Chat service.
- The node uses the Stream Chat server-side client library to perform operations.
- Ensure the API credentials have permissions to create or update users.
Troubleshooting
- Invalid JSON in User Data: If the "User Data" property contains malformed JSON, the node will throw a parsing error. Make sure the JSON is valid.
- Missing User ID: The "User ID" property is required. Omitting it will cause an error.
- API Authentication Errors: If the API key credential is missing or invalid, the node will fail to connect to Stream Chat.
- Unsupported Operation Error: If the resource or operation parameters are incorrect or unsupported, the node will throw an error indicating the unsupported operation.
- Continue On Fail: If enabled, the node will continue processing subsequent items even if one fails, returning error details in the output JSON.