Brain Docs

Reference

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

listRelations

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

PURPOSE

An entity's relations, filtered by direction and type. The HTTP tier takes one entity plus a direction; the wire tier has two separate verbs instead.

GET/v1/entities/:id/relationsBearer API keystable
listRelations(entityId: string, query?: ListRelationsQuery): Promise<ListRelationsResult>
Handshake credentialstable
listRelationsFrom(request: RelationListFromRequest): Promise<RelationView[]>
listRelationsFromFrames(request: RelationListFromRequest): Promise<RelationListFromResponseFrame[]>
listRelationsTo(request: RelationListToRequest): Promise<RelationView[]>
listRelationsToFrames(request: RelationListToRequest): Promise<RelationListToResponseFrame[]>

Parameters

ParameterTypeRequired
entityIdstringrequired

The entity whose relations to list. Positional on the HTTP tier.

directionstringoptional

Which way the edges point. The wire tier splits this into two verbs.

typestringoptional

Restrict to one relation type. The wire field is relationTypeFilter.

includeSupersededbooleanoptional

Include non-head versions. Defaults to false.

includeTombstonedbooleanoptional

Defaults to false.

limitintegeroptional

Page size.

cursorstring (wire: bytes)optional

Cursor from the previous page.

Returns

FieldTypePresence
relationsRelationDetail[]always

The page.

nextCursorstring

Absent on the last page.

Both wire verbs have a frame-level form — listRelationsFromFrames and listRelationsToFrames — and both add timeRangeStartUnixNanos / timeRangeEndUnixNanos, which the HTTP tier does not expose.

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
traverseRelationsPagination

Was this page helpful?

getRelation

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

traverseRelations

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

On this page

ParametersReturnsOn the wire
Suggest an editOpen in Playground