Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
create_spacelist_spacesdelete_spacecreate_sessionlist_sessionsdelete_session
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKSpaces and sessionscreate_space

create_space

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

PURPOSE

Provision the caller's space. Idempotent: calling it against a space that already exists succeeds and tells you so. The body is optional — a call with no arguments is the normal one.

POST/v1/spacesBearer API keystable
async fn create_space(&self, input: &CreateSpaceInput) -> Result<SpaceProvision, BrainHttpError>
Handshake credentialstable
async fn create_space(&self, request: &SpaceCreateRequest) -> Result<SpaceCreateResponse>

Parameters

ParameterTypeRequired
metadatastring (wire: bytes | null)optional

Opaque metadata to attach at provision time. Brain stores it and never interprets it.

Returns

FieldTypePresence
spacestringalways

The space's id.

createdbooleanalways

true when this call made it, false when it was already there. The rest of the body is identical either way, so this flag is the only way to tell. The edge also answers 201 versus 200.

created_at_unix_nanos / last_active_unix_nanos64-bit integeralways

Provisioning time and last write.

memory_count / session_countintegeralways

What is already in it.

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
list_spacesNamespaces

Was this page helpful?

unlink

Remove a memory-to-memory edge. Removing one that is not there is a success, not an error.

list_spaces

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

On this page

ParametersReturns
Suggest an editOpen in Playground