Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
getSchemavalidateSchemauploadSchemareplaceSchemadropSchemalistSchemaslistExtractors
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKSchemagetSchema

getSchema

Read the active schema document, or a specific version of it.

PURPOSE

Read the schema. Without a version, the current one. Nothing in the typed graph can be written outside what this declares.

GET/v1/schemaBearer API keystable
getSchema(query?: SchemaGetQuery): Promise<Schema>
Handshake credentialstable
getSchema(request: SchemaGetRequest): Promise<SchemaGetResponse>

Parameters

ParameterTypeRequired
namespacestringoptional

Which schema namespace. Defaults to the caller's.

versionintegeroptional

A specific version. Omit for the current one.

Returns

FieldTypePresence
namespacestringalways

The namespace.

schemaVersionintegeralways

Its version number.

schemaDocumentstringalways

The document itself.

uploadedAtUnixNanos64-bit integeralways

When it landed.

validatorVersionintegeralways

Which validator accepted it. A document that passed under an older validator is not guaranteed to pass under a newer one.

No schema is a valid state

A space with no active schema still accepts encode and recall — it just derives no statements, entities or relations. The wire encode response's hasActiveSchema is how you tell that apart from an extraction failure.

See also
uploadSchemalistSchemas

Was this page helpful?

tombstoneRelation

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

validateSchema

Check a schema document without storing it — with line, column and span for each error.

On this page

ParametersReturns
Suggest an editOpen in Playground