Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
create_relationget_relationlist_relationstraverse_relationssupersede_relationtombstone_relation
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKRelationssupersede_relation

supersede_relation

Replace a relation with a new version, keeping the chain readable.

PURPOSE

Replace a relation with a new one. The old version stops being current and stays readable; the chain records the order. This is how a single-cardinality relation changes without tripping CardinalityViolation.

POST/v1/relations/:id/supersedeBearer API keystable
supersede_relation(relation_id: str, **new_relation) -> SupersedeRelationResult
Handshake credentialstable
supersede_relation(request: RelationSupersedeRequest) -> RelationSupersedeResponse

Parameters

ParameterTypeRequired
relation_idstringrequired

The relation being replaced. The wire field is oldRelationId.

(new relation)CreateRelationInputrequired

A whole new relation, with the same fields create_relation takes. On the wire this is newRelation.

Returns

FieldTypePresence
new_relation_idstringalways

The replacement.

versionintegeralways

The new version number.

Close the old interval

Superseding does not set the old relation's validToUnixNanos for you. If the point is that someone used to work somewhere, set that bound on the version you are replacing before — or as part of — the supersession.

On the wire

Entity ids are UUID bytes, properties is a propertiesBlob, and evidence is a single reference rather than an array. Every request carries a requestId plus an optional actAs.

See also
get_relationSupersession

Was this page helpful?

traverse_relations

Walk the relation graph outward from an entity and get paths back — with a truncation flag you must check.

tombstone_relation

Retire a relation with no replacement. There is no retract equivalent — and here is why.

On this page

ParametersReturnsOn the wire
Suggest an editOpen in Playground