setRelationship

abstract fun setRelationship(relationshipId: String, classVersion: Int, status: String? = null, payload: Any? = null, ifMatch: String? = null): SetRelationship

Replaces a relationship 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 relationship — the two linked entities (entityAId / entityBId) and the relationship class are immutable. Use updateRelationship to change part of a relationship.

Parameters

relationshipId

Identifier of the relationship to replace.

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.

status

Optional status to store with the relationship.

payload

Optional replacement relationship fields (arbitrary JSON object).

ifMatch

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