Creates a new space. The authenticated user is automatically added as an admin. Supports optional avatar and banner image upload via multipart form data.
Body Parameters
Display name for the space. Must be 3–100 characters.
Optional URL slug. Must be unique per project. Supports Unicode letters, numbers, hyphens, and underscores.
Optional description. Up to 1,000 characters.
Who can read content: "anyone" or "members". Defaults to "anyone".
Who can post entities: "anyone", "members", or "admins". Defaults to "members".
Whether new joins require approval. Defaults to true.
Optional arbitrary key-value data. Up to 1 MB.
Optional UUID of a parent space. The caller must be an admin of the parent space.
Optional avatar image. Multipart form field. Requires avatarFile.options when provided.
Optional banner image. Multipart form field. Requires bannerFile.options when provided.
Response
Returns the created Space object with membersCount, childSpacesCount, and optional file associations.
Error Responses
{ "error" : "Authentication required to create a space." , "code" : "space/auth-required" }
{ "error" : "A space with this slug already exists." , "code" : "space/slug-taken" }
{ "error" : "Parent space not found." , "code" : "space/parent-not-found" }
Parent Admin Required — 403
{ "error" : "Only admins of the parent space can create child spaces." , "code" : "space/parent-admin-required" }
{ "error" : "Maximum nesting depth (10) exceeded." , "code" : "space/max-depth-exceeded" }
{ "code" : "space/file-too-large" , "message" : "Avatar image exceeds 50MB limit." }
See also: useCreateSpace