HumHub - Space API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub space module API reference.

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Space

API to access and manage space information.

Find all spaces

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Create new space

Request Body schema: application/json

Space base info and visibility settings

name
required
string
description
string
visibility
required
integer <int64>
join_policy
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "name": "Welcome space",
  • "description": "Your first sample space to discover the platform.",
  • "visibility": 1,
  • "join_policy": 1
}

Response samples

Content type
{
  • "id": 1,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "name": "Welcome Space",
  • "description": "Your first sample space to discover the platform.",
  • "contentcontainer_id": 1,
  • "visibility": 1,
  • "join_policy": 1,
  • "status": 1,
  • "tags": [
    ],
  • "owner": {}
}

Get space by id

path Parameters
id
required
integer

The id of space

Responses

Response samples

Content type
{
  • "id": 1,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "name": "Welcome Space",
  • "description": "Your first sample space to discover the platform.",
  • "contentcontainer_id": 1,
  • "visibility": 1,
  • "join_policy": 1,
  • "status": 1,
  • "tags": [
    ],
  • "owner": {}
}

Update existing space

path Parameters
id
required
integer

The id of space

Request Body schema: application/json

Space base info and settings

name
string
description
string
tagsField
Array of strings
color
string
url
string
indexUrl
string
indexGuestUrl
string
visibility
integer <int64>
join_policy
integer <int64>
default_content_visibility
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "name": "Welcome space",
  • "description": "Your first sample space to discover the platform.",
  • "tagsField": [
    ],
  • "color": "#eeeeee",
  • "url": "welcome-space",
  • "indexUrl": "/s/welcome-space/space/space/home",
  • "indexGuestUrl": "/s/welcome-space/space/space/home",
  • "visibility": 1,
  • "join_policy": 1,
  • "default_content_visibility": 1
}

Response samples

Content type
{
  • "id": 1,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "name": "Welcome Space",
  • "description": "Your first sample space to discover the platform.",
  • "contentcontainer_id": 1,
  • "visibility": 1,
  • "join_policy": 1,
  • "status": 1,
  • "tags": [
    ],
  • "owner": {}
}

Delete space by id

path Parameters
id
required
integer

The id of space

Responses

Response samples

Content type
{
  • "code": 200,
  • "message": "Space successfully deleted!"
}

Archive space

API to archive or unarchive the space.

Archive the space by id

path Parameters
id
required
integer

The id of space

Responses

Response samples

Content type
{
  • "code": 200,
  • "message": "Space successfully archived!"
}

Unarchive the space by id

path Parameters
id
required
integer

The id of space

Responses

Response samples

Content type
{
  • "code": 200,
  • "message": "Space successfully unarchived!"
}

Membership

List all memberships by given space id

path Parameters
id
required
integer

The id of space

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Add a new user to the space

path Parameters
id
required
integer

The id of space

userId
required
integer

The id of user

query Parameters
silent
boolean
Default: false

Send added notification to the user

Responses

Delete a space membership of a user

path Parameters
id
required
integer

The id of space

userId
required
integer

The id of user

Responses

Set the user membership role

path Parameters
id
required
integer

The id of space

userId
required
integer

The id of user

Request Body schema: application/json

Space membership role

role
string

admin, member or moderator

Responses

Request samples

Content type
application/json
{
  • "role": "admin"
}

Response samples

Content type
{
  • "code": 200,
  • "message": "Member updated!"
}