Brain Docs

Reference

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

getRelation

Read one relation, including its symmetry flag and its place in the supersession chain.

PURPOSE

Read one relation by id, optionally following its supersession chain.

GET/v1/relations/:idBearer API keystable
getRelation(relationId: string, query?: GetRelationQuery): Promise<RelationDetail>
Handshake credentialstable
getRelation(request: RelationGetRequest): Promise<RelationGetResponse>

Parameters

ParameterTypeRequired
relationIdstringrequired

The relation to read.

followSupersessionbooleanoptional

Follow the chain to its head. Defaults to true — so the id you get back may not be the one you asked for.

Returns

FieldTypePresence
relationId / relationType / fromEntity / toEntity—always

The edge.

confidencefloatalways

Confidence in [0, 1].

validFromUnixNanos / validToUnixNanos64-bit integeralways

The interval it holds over.

isSymmetricbooleanalways

Whether the schema declares the type symmetric — in which case the reverse direction holds without a second relation.

version / supersedes / supersededBy / chainRoot—always

Position in the chain. Store chainRoot when you mean the relationship rather than one version of it.

propertiesstring

The opaque blob, when set.

The wire RelationView additionally exposes flags, extractedAtUnixNanos and tombstonedAtUnixNanos, which the HTTP RelationDetail omits.

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
listRelationssupersedeRelation

Was this page helpful?

createRelation

Assert a typed, directed, time-bounded edge between two entities — and the cardinality rule that can reject it.

listRelations

List an entity's relations in either direction — one HTTP verb, two wire verbs.

On this page

ParametersReturnsOn the wire
Suggest an editOpen in Playground