spaces module covers core space lifecycle management: creating spaces, fetching them by various identifiers, updating settings, navigating parent-child hierarchies, and checking slug availability.
For membership management see Space Members, and for moderation and rules see Space Moderation.
createSpace
Creates a new space.Who may read content, for your app to enforce:
"anyone" (default) or "members". The v7 API reports it in memberPermissions.canRead but doesn’t hide the content inside the space; see Content inside a space and the v8 rules.Who may post entities, for your app to enforce:
"anyone", "members" (default), or "admins". The v7 API reports it in memberPermissions.canPost but doesn’t refuse entities that don’t match it; see Content inside a space and the v8 rules.Listing/discoverability:
"public" (default), "unlisted", or "private". Independent of readingPermission. "unlisted" hides the space from discovery and search but keeps it reachable by direct link; "private" hides the space, and the spaces under it, from everyone except its active members — it answers 404 like a nonexistent space and can’t be joined. The content inside it stays readable in v7; see Content inside a space and the v8 rules.The space’s own NSFW flag. Defaults to
false. A space created under an NSFW parent is effectively NSFW regardless of this value. See Space NSFW flagging.Makes this space a child of the specified parent space. The user the space is created for (
userId) must be an active admin of the parent space, or the request is refused with 403 space/parent-admin-required.Promise<Space>
fetchSpace
Fetches a space by its Sublay ID, including member counts and permission details.Promise<SpaceDetailed>
fetchManySpaces
Fetches a paginated list of top-level spaces, with optional text search.Filter by each space’s
nsfwEffective (own flag OR any ancestor). "include-all" (default) adds no predicate; "exclude" drops effective-NSFW spaces; "only" returns only them. "only" may return an NSFW child whose safe parent is omitted. See Space NSFW flagging.Promise<PaginatedResponse<Space>>
fetchSpaceBySlug
Fetches a space by its unique slug.Promise<SpaceDetailed>
fetchSpaceByShortId
Fetches a space by its short, human-readable ID (used in share URLs).Promise<SpaceDetailed>
fetchUserSpaces
Fetches the spaces a specific user is a member of.Filter by the user’s role in the space. A single role or comma-separated list, e.g.
"admin,moderator".Membership status to list:
"active" (default), "pending", or "banned". Use "pending" to find join requests still awaiting approval.Promise<UserSpacesResponse>
fetchMutualSpaces
Fetches the spaces shared between two users — the spaces both are active members of.The other user’s Sublay ID. Mutual spaces are computed between this user and
actingUserId.The user to act as. Because the SDK authenticates with a service key, you must name the acting user explicitly.
Promise<PaginatedResponse<Space>>
updateSpace
Updates settings on an existing space.Updated visibility:
"public", "unlisted", or "private". Controls listing/discoverability, independent of readingPermission.Updated NSFW own-flag. Toggling it recomputes this space’s effective NSFW and cascades it top-down to every descendant space (and, live, to their entities). See Space NSFW flagging.
Promise<Space>
deleteSpace
Permanently deletes a space and all its content.Promise<DeleteSpaceResponse>
checkSlugAvailability
Checks whether a slug is available for use.Promise<{ available: boolean }>
fetchChildSpaces
Fetches the direct child spaces of a given parent space.Promise<PaginatedResponse<Space>>
fetchSpaceBreadcrumb
Returns the full ancestor chain from the root down to the specified space. Useful for rendering breadcrumb navigation.Promise<SpaceBreadcrumb>
