createMembership

abstract fun createMembership(channelId: String, userId: String, classVersion: Int): CreateMembership

Create a DataSync membership linking a Channel and a User. Optional fields are set via the returned builder.

This API always targets the built-in Membership relationship class — there is no class-name parameter; the SDK fixes the class to Membership. Creating a Membership subclass is not supported here; that is served by the general /relationships API.

Parameters

channelId

Identifier of the Channel side of the membership. Must reference an existing Channel entity — a missing or wrong-class entity is rejected.

userId

Identifier of the User side of the membership. Must reference an existing User entity — a missing or wrong-class entity is rejected.

classVersion

Version of the Membership class the payload conforms to. Currently only version 1 exists — pass 1. New versions may be introduced in the future; when one is, opt in by passing its number.