Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
createSpacelistSpacesdeleteSpacecreateSessionlistSessionsdeleteSession
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKSpaces and sessionslistSpaces

listSpaces

The spaces in the caller's namespace — and the cross-shard completeness flag you must check.

PURPOSE

The spaces in the caller's namespace. Bounded by limit; it does not page.

GET/v1/spacesBearer API keystable
listSpaces(query?: ListSpacesQuery): Promise<ListSpacesResult>
Handshake credentialstable
listSpaces(request: SpaceListRequest): Promise<SpaceListResponse>

Parameters

ParameterTypeRequired
limitintegeroptional

Cap on returned spaces. Required on the wire request type, optional on the HTTP query.

Returns

FieldTypePresence
spacesSpaceSummary[]always

Each with space, createdAtUnixNanos, lastActiveUnixNanos, memoryCount and sessionCount.

crossShardCompletebooleanalways

Whether the listing covered the whole namespace.

Check crossShardComplete

false means the listing covered one shard, not the namespace. Treating a partial listing as complete is how a caller concludes a space is gone and re-provisions over live data. This is a different kind of incompleteness from pagination: there is no cursor to follow, only a flag saying the answer is partial.

You do not choose your space on the HTTP tier

The space comes from the credential. These verbs act on the caller's space. Addressing another space per request is a wire-tier capability — see act_as. Per-end-user isolation is a storage-key prefix inside one space, not a key per user; see Namespaces.

See also
createSpacePagination

Was this page helpful?

createSpace

Provision the caller's space. Idempotent — the created flag says whether this call made it.

deleteSpace

Erase the caller's space and everything under it — hard, immediate and safe to retry.

On this page

ParametersReturns
Suggest an editOpen in Playground