Skip to main content
Spaces are containers — communities for organizing content. The spaces module covers the space lifecycle and navigation: creating spaces, looking them up by ID, slug, or short ID, updating settings, and traversing parent-child hierarchies. For membership management see Space Members, and for moderation, rules, and digest configuration see Space Moderation.

createSpace

Creates a new space.
string
required
Display name for the space.
string
URL-friendly identifier. Must be unique within the project. Generated from name if omitted.
string
Short description of the space.
string
Who can read content: "anyone" or "members".
string
Who can post content: "anyone", "members", or "admins".
boolean
When true, join requests must be manually approved.
string
Makes this space a child of the specified parent space.
Record<string, any>
Arbitrary metadata attached to the space.
ReturnsPromise<Space>

fetchSpace

Fetches a single space, including detailed information, by its ID.
string
required
The Sublay space ID.
ReturnsPromise<SpaceDetailed>

fetchManySpaces

Fetches a paginated, filterable list of spaces.
number
The page number to fetch.
number
The number of spaces to return per page.
string
Sort order: "alphabetical", "newest", or "members".
string
Filter by matching slug.
string
Filter by matching name.
string
Filter by matching description.
string
Filter by matching across slug, name, and description.
string
Pass "true" to return only spaces you belong to.
string
Filter by parent space. Pass "null" for top-level spaces.
string
Comma-separated related resources to include in the response.
ReturnsPromise<PaginatedResponse<Space>>

fetchSpaceBySlug

Fetches a detailed space by its slug.
string
required
The space slug.
ReturnsPromise<SpaceDetailed>

fetchSpaceByShortId

Fetches a detailed space by its short ID.
string
required
The space short ID.
ReturnsPromise<SpaceDetailed>

fetchUserSpaces

Fetches the spaces the logged-in user belongs to.
number
The page number to fetch.
number
The number of spaces to return per page.
string
Sort order: "alphabetical", "newest", or "members".
string
Comma-separated related resources to include in the response.
string
Filter by role. A single role or a comma-separated list, e.g. "admin,moderator".
string
Pass "true" or "false".
ReturnsPromise<UserSpacesResponse>

fetchMutualSpaces

Fetches the spaces the logged-in user shares with another user — the spaces both are active members of.
string
required
The other user’s ID. Mutual spaces are computed between this user and the logged-in user.
number
The page number to fetch.
number
The number of spaces to return per page. Max 100.
string
Comma-separated related resources to include (e.g. "files").
ReturnsPromise<PaginatedResponse<Space>>

updateSpace

Updates a space’s settings.
string
required
The Sublay space ID.
string
New display name for the space.
string
New URL-friendly identifier.
string
New description of the space.
string
Who can read content: "anyone" or "members".
string
Who can post content: "anyone", "members", or "admins".
Record<string, any>
Arbitrary metadata attached to the space.
ReturnsPromise<Space>

deleteSpace

Deletes a space.
string
required
The Sublay space ID.
ReturnsPromise<DeleteSpaceResponse>

checkSlugAvailability

Checks whether a space slug is available.
string
required
The slug to check.
ReturnsPromise<{ available: boolean }>

fetchChildSpaces

Fetches a paginated list of child spaces under a parent.
string
required
The parent space ID.
number
The page number to fetch.
number
The number of spaces to return per page.
string
Sort order: "alphabetical", "newest", or "members".
string
Comma-separated related resources to include in the response.
ReturnsPromise<PaginatedResponse<Space>>

fetchSpaceBreadcrumb

Fetches the ancestor breadcrumb chain for a space.
string
required
The Sublay space ID.
ReturnsPromise<SpaceBreadcrumb>

getSpaceConversation

Gets the chat conversation object associated with a space.
string
required
The Sublay space ID.
ReturnsPromise<Conversation>
Space chat messages are sent and read via the chat module.