Skip to main content

Overview

useCreateSpace returns a callable function for creating a new space. The request can include avatar and banner image uploads. The creator is automatically added as an admin.

Usage Example

Parameters

string
required
Display name for the space. 3–100 characters.
string
Optional URL slug. Must be unique per project. Supports letters, numbers, hyphens, and underscores (Unicode allowed).
string
Optional description. Up to 1,000 characters.
{ file: File | Blob; options: UploadImageOptions }
Optional avatar image to upload. The options object controls format, quality, dimensions, and variants.
{ file: File | Blob; options: UploadImageOptions }
Optional banner image to upload.
"anyone" | "members"
Who can read content. Defaults to "anyone".
"anyone" | "members" | "admins"
Who can post entities. Defaults to "members".
boolean
Whether new members must be approved. Defaults to true.
Record<string, any>
Optional custom metadata. Up to 1 MB.
string
Optional UUID of a parent space. The creator must be an admin of the parent space.

Returns

Returns the created Space object.
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.