Community management endpoints
9 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/communities | Get all communities |
POST | /api/communities | Create a new community (Super Admin only) |
GET | /api/communities/{communityId}/external-sections | External sections of the community sidebar |
PUT | /api/communities/{communityId}/external-sections | Replace the external sections |
DELETE | /api/communities/{id} | Delete community (Super Admin only) |
GET | /api/communities/{id} | Get a single community by ID |
PUT | /api/communities/{id} | Update community (Community Admin or Super Admin) |
PATCH | /api/communities/{id}/archive | Archive (hide) a community - Community Admin only |
PATCH | /api/communities/{id}/unarchive | Unarchive (restore) a community - Community Admin only |
GET /api/communitiesAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
page | query | no | integer | — |
limit | query | no | integer | — |
search | query | no | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Communities list with pagination | — |
POST /api/communitiesAuth: Bearer JWT required.
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | — |
nameArabic | string | yes | — |
slug | string | yes | — |
description | string | no | — |
descriptionArabic | string | no | — |
logo | string | no | — |
type | enum: PUBLIC, PRIVATE | no | Community visibility (preferred — single source of truth). |
isPublic | boolean | no | Deprecated — pass type instead. Still accepted as input for back-compat; the underlying column was removed in the Community.isPublic removal plan, commit 4. |
Responses
| Status | Description | Body |
|---|---|---|
201 | Community created successfully | — |
403 | Only Super Admins can create communities | — |
GET /api/communities/{communityId}/external-sectionsSections an admin added to the sidebar that open a page on another site in a new tab (the «External Sections» App Store app). The member arrives on that site through its own sign-in; Gurb sends no token. A member gets the sections that are shown; a caller with homepage:customize or settings:manage also gets the hidden ones, and canManage is true. Each section follows the built-in section named by afterId (null = above every built-in section).
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string | Community id. The caller must be an approved member. |
Responses
| Status | Description | Body |
|---|---|---|
200 | The sections, in the order they were saved. | ExternalSectionsResponse |
401 | No valid token. | — |
403 | Not a member of this community (NOT_A_COMMUNITY_MEMBER), or the app is not on for it (FEATURE_NOT_AVAILABLE, featureKey external_sections). | — |
PUT /api/communities/{communityId}/external-sectionsSends the WHOLE list; sections left out are removed. A section without an id is new and gets one. At most 10 sections; names 1-20 characters; url must be an absolute http or https address with no user name or password; icon is one of the sidebar icons.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
items | ExternalSection[] | yes | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | The stored list. | ExternalSectionsResponse |
400 | INVALID_EXTERNAL_SECTIONS — the message names the field, e.g. "items[0].url: url must start with http:// or https://". | — |
403 | NOT_A_COMMUNITY_MEMBER, "Missing one of permissions: homepage:customize, settings:manage", or FEATURE_NOT_AVAILABLE (featureKey external_sections). | — |
DELETE /api/communities/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Community deleted | — |
403 | Only Super Admins can delete communities | — |
GET /api/communities/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Community details | — |
404 | Community not found | — |
PUT /api/communities/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Community updated | — |
PATCH /api/communities/{id}/archiveChanges community status to ARCHIVED, hiding it from listings while preserving all data Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | Community ID |
Responses
| Status | Description | Body |
|---|---|---|
200 | Community archived successfully | — |
401 | Authentication required | — |
403 | Only Community Admins can archive their community | — |
404 | Community not found | — |
PATCH /api/communities/{id}/unarchiveChanges community status from ARCHIVED back to ACTIVE, making it visible again Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | Community ID |
Responses
| Status | Description | Body |
|---|---|---|
200 | Community restored successfully | — |
401 | Authentication required | — |
403 | Only Community Admins can restore their community | — |
404 | Community not found | — |