setMembership

abstract fun setMembership(membershipId: String, classVersion: Int, status: String? = null, payload: Any? = null, ifMatch: String? = null): SetMembership

Replaces a membership in full.

Every mutable field is overwritten. Omitting status or payload clears the stored value rather than preserving it, so a read-modify-write must send back every field it wants to keep. This cannot re-point or reclassify a membership — the linked channel/user and the relationship class are immutable. Use updateMembership to change part of a membership.

Parameters

membershipId

Identifier of the membership to replace.

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.

status

Optional status to store with the membership.

payload

Optional replacement membership fields (arbitrary JSON object).

ifMatch

Optional eTag last read, to fail the request when the membership changed since (If-Match header).