Skip to content

Creates a space, makes the caller its first admin, and attaches the submitted cover photo, logo and topics.

space[title] and a space[privacy] of public, private or secret are required, and the slug — derived from slug or the title — must be unique. Turning on settings.topic_required without any topic_ids is rejected. Cover photo, logo and OG image URLs must resolve to unclaimed uploaded media, which is then marked permanent. New spaces are appended to the end of their group serial order.

Endpoint ​

  • Method: POST

  • Path: /spaces

  • Edition: Core

  • Controller: SpaceController@create

  • Route source: fluent-community/app/Http/Routes/api.php:9

  • Controller source: fluent-community/app/Http/Controllers/SpaceController.php

  • Requires community-admin access, or the admin role in the space named by space_id.

  • The creator is attached as a space admin automatically.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

POST Create Space​

POST
/spaces

Creates a space, makes the caller its first admin, and attaches the submitted cover photo, logo and topics.

Controller: SpaceController@create
Route source: fluent-community/app/Http/Routes/api.php:9

Authorizations​

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Request Body​

application/json
JSON
{
  
"space": {
  
  
"slug": "string",
  
  
"title": "string",
  
  
"privacy": "string",
  
  
"settings": {
  
  
  
"topic_required": "string",
  
  
  
"og_image": "string"
  
  
},
  
  
"topic_ids": [
  
  
  
"string"
  
  
],
  
  
"description": "string"
  
}
}

Responses​

Successful response

application/json
JSON
{
  
"message": "string",
  
"space": {
  
  
"created_at": "string",
  
  
"created_by": 0,
  
  
"description": "string",
  
  
"id": 0,
  
  
"parent_id": 0,
  
  
"privacy": "string",
  
  
"serial": 0,
  
  
"settings": {
  
  
  
"can_request_join": "string",
  
  
  
"custom_lock_screen": "string",
  
  
  
"default_comment_sort_by": "string",
  
  
  
"default_post_sort_by": "string",
  
  
  
"disable_layout_style": "string",
  
  
  
"disable_post_sort_by": "string",
  
  
  
"document_access": "string",
  
  
  
"document_library": "string",
  
  
  
"document_upload": "string",
  
  
  
"emoji": "string",
  
  
  
"hide_members_count": "string",
  
  
  
"layout_style": "string",
  
  
  
"links": [
  
  
  
  
{
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
],
  
  
  
"media_access": "string",
  
  
  
"media_gallery": "string",
  
  
  
"members_page_status": "string",
  
  
  
"og_image": "string",
  
  
  
"onboard_redirect_url": "string",
  
  
  
"restricted_post_only": "string",
  
  
  
"shape_svg": "string",
  
  
  
"show_paywalls": "string",
  
  
  
"show_sidebar": "string",
  
  
  
"topic_required": "string"
  
  
},
  
  
"slug": "string",
  
  
"title": "string",
  
  
"type": "string",
  
  
"updated_at": "string"
  
}
}

Playground​

Authorization
Body

Samples​

Powered by VitePress OpenAPI

FluentCommunity developer documentation