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 and rules see Space Moderation.
createSpace
Creates a new space.Display name for the space: 3–100 characters after trimming. Every space has a name; without one the server returns
400 space/invalid-body.URL-friendly identifier. Must be unique within the project. Left out or
null, the space has no slug.Who can post content:
"anyone", "members", or "team" (the space’s active admins and moderators).Who can find and see the space:
"public" (default), "unlisted", or "private". Independent of readingPermission (which governs content). "unlisted" keeps the space out of the directory and search, and out of sub-space lists for non-members, but reachable by id, short id or slug; "private" makes it seen only by its active members (everyone else gets 404), and it can’t be joined: members are added by its moderators and admins. See Space visibility.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 signed-in user must be an active admin of the parent space, or the request is refused with
403 space/parent-admin-required. Left out or null, the space is top-level.An avatar image to upload, up to 50 MB.
options says how to process it and must include mode (see Upload Image). With an image, the request is sent as multipart/form-data.Promise<SpaceWithPermissions>: the created space plus memberPermissions, what the creator may do in it.
fetchSpace
Fetches a single space, including detailed information, by its ID.A single value or an array. The only value is
"files", which populates the avatar and banner file objects.Promise<SpaceDetailed>. Its memberPermissions is always present, also for a user with no membership (isMember: false, status: null); a signed-out user gets the anonymous view. See How permissions are calculated.
fetchManySpaces
Fetches a paginated, filterable list of public spaces (the space directory). For the spaces the logged-in user belongs to, whatever their visibility, use fetchMySpaces.The number of spaces to return per page: a whole number from
1 to 100. Defaults to 20. A larger value is rejected with 400 space/invalid-query, never lowered to 100.Sort order:
"createdAt" (when the space was created), "alphabetical" (by name) or "members" (by active member count). Defaults to "members".Direction,
"asc" or "desc", for any sortBy. Left out: A–Z for "alphabetical", otherwise newest / most first.Free-text search term, matched as a case-insensitive substring. Trimmed; a blank value returns
400 space/invalid-query.The one field
query is matched against. Leave it out to match the slug, the name or the description.Which level of the space tree to return. Left out or
"none": top-level spaces only (the default). A space id returns that space’s direct sub-spaces the viewer can see that are public or that the viewer is an active member of — the same ones its childSpaces preview shows and its childSpacesCount counts; this is how to page through a space’s sub-spaces (add sortBy: "alphabetical" to order them A–Z by name). An id that matches no space returns an empty page, not a 404. "any" returns spaces at every level.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.A single value or an array. The only value is
"files", which populates the avatar and banner file objects.Promise<PaginatedResponse<Space>>
fetchSpaceBySlug
Fetches a detailed space by its slug.A single value or an array. The only value is
"files", which populates the avatar and banner file objects.Promise<SpaceDetailed>. Its memberPermissions is always present, also for a user with no membership (isMember: false, status: null); a signed-out user gets the anonymous view. See How permissions are calculated.
fetchSpaceByShortId
Fetches a detailed space by its short ID.A single value or an array. The only value is
"files", which populates the avatar and banner file objects.Promise<SpaceDetailed>. Its memberPermissions is always present, also for a user with no membership (isMember: false, status: null); a signed-out user gets the anonymous view. See How permissions are calculated.
fetchMySpaces
Fetches the spaces the logged-in user belongs to (GET /spaces/mine), with the user’s membership on each. Every space the user is an active member of is listed, whatever its visibility; a pending, banned or rejected membership of a space the user can’t see (a private space, or one under it) is left out. It can search within them and sort them.
The number of spaces to return per page: a whole number from
1 to 100. Defaults to 20. A larger value is rejected with 400 space/invalid-query (param: "limit"), never lowered to 100. See Pagination.Free-text search term within the user’s spaces, matched as a case-insensitive substring. Trimmed; a blank value returns
400 space/invalid-query.The one field
query is matched against. Leave it out to match the slug, the name or the description.Sort order:
"joinedAt" (when the user joined), "createdAt" (when the space was created), "alphabetical" (by name) or "members" (by active member count). Defaults to "joinedAt".Direction,
"asc" or "desc", for any sortBy. Left out: A–Z for "alphabetical", otherwise newest / most first.Narrows the list by where each space sits in the tree.
"none" returns the user’s memberships in top-level spaces only. A space id returns their memberships in that space’s direct sub-spaces; an id that matches no space returns an empty page, not a 404. "any" or left out: memberships at every level (the default).A membership in a sub-space whose parent the user isn’t a member of is not top-level, so "none" leaves it out.A single value or an array. The only value is
"files", which populates the avatar and banner file objects.Membership status to list:
"active" (default), "pending", or "banned". Use "pending" to find join requests still awaiting approval.Promise<MySpacesResponse>
The list is always paged. To load every space the user is in, fetch page after page until pagination.hasMore is false; add role: "admin,moderator" to list only the spaces they moderate:
fetchMutualSpaces
Fetches the spaces the logged-in user shares with another user — the spaces both are active members of.The other user’s ID. Mutual spaces are computed between this user and the logged-in user.
The number of spaces to return per page: a whole number from
1 to 100. Defaults to 20. A larger value is rejected with 400 space/invalid-query, never lowered to 100.A single value or an array. The only value is
"files", which populates the avatar and banner file objects.Promise<PaginatedResponse<Space>>
updateSpace
Updates a space’s settings.New display name (3–100 characters after trimming). Leave it out to keep the current name; a name can’t be cleared.
Who can post content:
"anyone", "members", or "team" (the space’s active admins and moderators).Updated visibility:
"public", "unlisted", or "private". Controls who can find and see the space, independent of readingPermission. See Space visibility.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.
A new avatar image, replacing the current one (up to 50 MB).
options must include mode. With an image, the request is sent as multipart/form-data. A field set to null can’t travel with an image: the call throws before sending anything, so clear it in a separate call without one.A new banner image, replacing the current one; same shape as
avatarFile.Files to remove: the space’s
avatarFileId and/or bannerFileId, nothing else. Removing one clears that image. Works alone or with uploads. Any other id throws a 400 (space/invalid-remove-file-ids, with invalidIds).Promise<SpaceWithPermissions>: the updated space plus memberPermissions, what the user may do in it after the update (no parentSpace or childSpaces).
deleteSpace
Deletes a space. Only the space’s owner can delete it: itsuserId, which is the creator of a top-level space and the root space’s creator for a sub-space. The reputation users earned in the space and its sub-spaces is removed from their totals (see Reputation).
Promise<void>. It resolves with no value once the space is deleted.
checkSlugAvailability
Checks whether a space slug is available.Promise<{ available: boolean }>
fetchSpaceBreadcrumb
Fetches the path from the top-level space down to and including a space, root first, as the logged-in user may see it. A space the user can’t see is answered404 space/not-found. Each entry carries hidden: a space above that the user can’t see (a private space they aren’t an active member of, or a space under one) is exactly { hidden: true }, with no other field. Apps can skip those entries, show ”…”, or start after the last hidden one. See Fetch Space Breadcrumb.
Promise<SpaceBreadcrumb>: { breadcrumb, depth }, where each breadcrumb entry is either a visible space (id, shortId, name, slug, avatarFileId, visibility, parentSpaceId, depth, hidden: false) or { hidden: true }.
getSpaceConversation
Gets the chat conversation object associated with a space.Promise<Conversation>
Space chat messages are sent and read via the chat module.

