Overview
useCreateSpace returns a callable function for creating a new space. The request can include an avatar and a banner image (avatarFile, bannerFile). The creator is automatically added as an admin. A sub-space’s owner (its userId) is the root space’s creator, not whoever created the sub-space: they are its admin, not its owner.
Usage Example
Parameters
Display name for the space: 3–100 characters after trimming. Every space has a name; without one the server returns
400 space/invalid-body.Optional URL slug. Must be unique per project. Supports letters, numbers, hyphens, and underscores (Unicode allowed).
null is the same as leaving it out.Optional avatar image to upload, up to 50 MB.
file is a File or Blob, or a React Native file { uri, name, type? }. options controls how the image is processed and must include mode (see Upload Image). With an image, the request is sent as multipart/form-data.Optional banner image to upload; same shape as
avatarFile.Who can post entities:
"anyone", "members" (active members), or "team" (the space’s active admins and moderators). Defaults to "members".Who can find and see the space. Defaults to
"public". 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. If the space is created under an NSFW parent, its effective NSFW status is true regardless of this value (a live rollup — see Space NSFW flagging). Sublay labels and filters NSFW content; it does not blur or age-gate it.Optional UUID of a parent space. The creator must be an admin of the parent space.
null or left out: a top-level space.avatarFile or bannerFile, the request is multipart/form-data, which can’t carry null, so null fields are left out of it (the same result as on a JSON request).
Returns
Returns the created Space object plusmemberPermissions: what the creator may do in the new space (see SpaceMemberPermissions).
When creating a child space, all admins and moderators of the parent space are automatically added to the new child space with their same roles.

