Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
createRelationgetRelationlistRelationstraverseRelationssupersedeRelationtombstoneRelation
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKRelationssupersedeRelation

supersedeRelation

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
supersedeRelation(relationId: string, input: CreateRelationInput): Promise<SupersedeRelationResult>
Handshake credentialstable
supersedeRelation(request: RelationSupersedeRequest): Promise<RelationSupersedeResponse>

Parameters

ParameterTypeRequired
relationIdstringrequired

The relation being replaced. The wire field is oldRelationId.

(new relation)CreateRelationInputrequired

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

Returns

FieldTypePresence
newRelationIdstringalways

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
getRelationSupersession

Was this page helpful?

traverseRelations

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

tombstoneRelation

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