Skip to main content
POST
/
:projectId
/
api
/
v7
/
spaces
Create Space
curl --request POST \
  --url https://api.replyke.com/api/v6/:projectId/api/v7/spaces \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "slug": "<string>",
  "description": "<string>",
  "readingPermission": "<string>",
  "postingPermission": "<string>",
  "requireJoinApproval": true,
  "metadata": {},
  "parentSpaceId": "<string>"
}
'
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

name
string
Display name for the space. Must be 3–100 characters.
slug
string
Optional URL slug. Must be unique per project. Supports Unicode letters, numbers, hyphens, and underscores.
description
string
Optional description. Up to 1,000 characters.
readingPermission
string
Who can read content: "anyone" or "members". Defaults to "anyone".
postingPermission
string
Who can post entities: "anyone", "members", or "admins". Defaults to "members".
requireJoinApproval
boolean
Whether new joins require approval. Defaults to true.
metadata
object
Optional arbitrary key-value data. Up to 1 MB.
parentSpaceId
string
Optional UUID of a parent space. The caller must be an admin of the parent space.
avatarFile
file
Optional avatar image. Multipart form field. Requires avatarFile.options when provided.
bannerFile
file
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" }
{ "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