Stream Chat icon

Stream Chat

Server-side Stream Chat operations

User → Upsert

AI-generated

Summary

Upsert a user in Stream Chat by specifying a unique User ID and optional additional user data to create or update that user's record.

Inputs

  • User ID (required) — A unique identifier for the user. Can be any string (e.g., "john_doe", "user123").
  • User Data — A JSON object containing user properties such as name, email, image, role, and custom fields. The "id" field is set automatically based on the User ID.

Output shape

a single JSON object representing the created or updated user

The operation returns the full user object after upsert. If an error occurs, it may return an error object; consider enabling 'Continue On Fail' in node settings for bulk operations.

Examples

Example 1: Creating or updating a user named John with role admin

Set User ID to 'john_doe' and User Data to '{"name": "John", "role": "admin"}'.

Discussion