createRelationship

abstract fun createRelationship(entityAId: String, entityBId: String, className: String, classVersion: Int, relationshipId: String? = null, status: String? = null, payload: Any? = null): CreateRelationship

Create a DataSync relationship linking two entities under a relationship class.

Unlike createMembership, className is required — this API targets the caller-supplied relationship class rather than a fixed built-in one, and the two ends are the generic entityAId / entityBId rather than a Channel/User pair.

Parameters

entityAId

Identifier of entity A to link. Must reference an existing entity — a missing or wrong-class entity is rejected.

entityBId

Identifier of entity B to link. Must reference an existing entity — a missing or wrong-class entity is rejected.

className

Relationship class identifier.

classVersion

Version of the relationship class the payload conforms to. Relationship classes are versioned (an integer >= 1); pass the version of the class you are targeting.

relationshipId

Optional relationship identifier. When null the server generates one.

status

Optional relationship status.

payload

Optional arbitrary JSON object payload.