HumHub - Custom Pages API (1.0.0)

Download OpenAPI specification:

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

Welcome to the HumHub custom pages module API reference.

This is a read-only API: only GET endpoints are exposed for reading pages and their rendered content. The CRUD-style requests (create/update/delete) supported by other modules' REST APIs are intentionally disabled here and return 405 Method Not Allowed.

All endpoints enforce the page's own visibility settings (Public / Logged-In Users / Non-Logged-In Users / Administrative Users / Custom group- or language-restricted) - the same rules that apply when viewing the page in the web UI, see the visibility field of the CustomPage schema below. A page returns 403 on /custom-pages/page/{id} when the requesting user is not allowed to view it, and is silently omitted from the list endpoints. Since that visibility check runs in addition to, and after, the regular database pagination, a listing page can come back with fewer results than limit (or, rarely, empty) when restricted pages are mixed into it, and total/pages may be slightly higher than what a given user will actually see across all pages combined.

Custom Pages

Find all custom pages

Returns all custom pages the current user is allowed to view, ordered by creation date descending. Pass contentcontainer_id=0 to only return global custom pages (equivalent to /custom-pages/global), or a specific container id to only return that container's pages (equivalent to /custom-pages/container/{containerId}).

query Parameters
contentcontainer_id
integer

Filter by content container id. Use 0 for global pages.

page
integer >= 0

The number of page of the result set.

limit
integer [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

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

Find all global custom pages

Alias for /custom-pages?contentcontainer_id=0.

query Parameters
page
integer >= 0

The number of page of the result set.

limit
integer [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

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

Find all custom pages by container

path Parameters
containerId
required
integer

ID of content container

query Parameters
page
integer >= 0

The number of page of the result set.

limit
integer [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

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

Custom Page

Get custom page by id

path Parameters
id
required
integer

The id of the custom page

Responses

Response samples

Content type
application/json
{
  • "id": 123,
  • "title": "My custom page",
  • "type": 2,
  • "target": "SpaceMenu",
  • "icon": "fa-file-text-o",
  • "sort_order": 100,
  • "in_new_window": false,
  • "url": "my-custom-page",
  • "abstract": "Short description",
  • "cssClass": "team-page",
  • "page_content": "# Raw content",
  • "rendered_content": "<h1>Rendered content</h1><p>… as displayed…</p>",
  • "text_content": "Rendered content… as displayed…",
  • "visibility": 1,
  • "hide_menu": false,
  • "page_type": "page",
  • "template_id": 0,
  • "content": {
    }
}