Struktura społeczności
Endpointy „Struktura społeczności” Zanfia Workspace API — ze schematami i przykładami kodu.
Zarządzanie kanałami i grupami. Treści społeczności — posty, komentarze, czat — obsługuje Community API. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.
Utwórz kanał
/communities/{communityId}/channelsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Community id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/communities/string/channels" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "type": "feed" }'{ "channel": { "id": "string", "name": "string", "type": "feed", "groupId": "string", "description": "string", "readonly": true, "access": "inherit" }}{ "error": "string", "message": "string"}Utwórz grupę kanałów
/communities/{communityId}/groupsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Community id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/communities/string/groups" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{ "group": { "id": "string", "name": "string", "description": "string" }}{ "error": "string", "message": "string"}Aktualizuj kanał
/communities/{communityId}/channels/{channelId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Community id
Channel id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PATCH "https://example.com/communities/string/channels/string" \ -H "Content-Type: application/json" \ -d '{}'{ "channel": { "id": "string", "name": "string", "type": "feed", "groupId": "string", "description": "string", "readonly": true, "access": "inherit" }}{ "error": "string", "message": "string"}Usuń kanał
/communities/{communityId}/channels/{channelId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Community id
Channel id
Response Body
application/json
application/json
curl -X DELETE "https://example.com/communities/string/channels/string"{ "channelId": "string"}{ "error": "string", "message": "string"}Aktualizuj grupę
/communities/{communityId}/groups/{groupId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Community id
Channel group id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PATCH "https://example.com/communities/string/groups/string" \ -H "Content-Type: application/json" \ -d '{}'{ "group": { "id": "string", "name": "string", "description": "string" }}{ "error": "string", "message": "string"}Usuń grupę
/communities/{communityId}/groups/{groupId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Community id
Channel group id
Response Body
application/json
application/json
curl -X DELETE "https://example.com/communities/string/groups/string"{ "groupId": "string"}{ "error": "string", "message": "string"}Zmień kolejność lub położenie kanału/grupy
/communities/{communityId}/move-nodeAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Community id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Flat mirror of the MoveContentNode intent (one node + one target per call).
Response Body
application/json
application/json
curl -X POST "https://example.com/communities/string/move-node" \ -H "Content-Type: application/json" \ -d '{ "nodeType": "channel", "nodeId": "string", "positionMode": "into-group" }'{ "communityId": "string"}{ "error": "string", "message": "string"}Community API (endpointy zarządzania)
Członkowie, role, ustawienia, wydarzenia w kalendarzu i kolejka moderacji działają w Community API — bazowy adres https://api.zanfia.com/community, poniższe ścieżki są względem niego. Nie są częścią specyfikacji Workspace API powyżej. Klucze workspace potrzebują uprawnień communities:read / communities:write i działają jako zespół; klucze członkowskie przechodzą przez guard, ale każda grupa wymaga wskazanego obok uprawnienia społeczności, więc zwykły klucz członka dostaje 403 insufficient-permissions. Id w ścieżce: communityId z GET /v1/communities; memberId to id dokumentu członka z listy członków.
Członkowie (manageMembers; wyciszenie wymaga muteMembers)
| Metoda | Endpoint | Body / query |
|---|---|---|
| GET | /v1/communities/{communityId}/members | ?roleId / ?disabled=true|false / ?emailPrefix (wzajemnie wykluczające się — 400 filter-conflict), ?cursor, ?limit ≤ 100 |
| POST | /v1/communities/{communityId}/members/{memberId}/roles | { "roleIds": [] } — pełny zestaw ról własnych członka (wbudowana rola Właściciel jest niezmienna) |
| POST | /v1/communities/{communityId}/members/{memberId}/status | { "disabled": true } wyłącza (miękki ban), false przywraca; z kontrolą hierarchii (403 hierarchy-violation) |
| POST | /v1/communities/{communityId}/members/{memberId}/mute | { "durationMinutes": 60 } wycisza członka; null cofa wyciszenie (maks. 28 dni) |
Role (manageRoles)
| Metoda | Endpoint | Body |
|---|---|---|
| GET | /v1/communities/{communityId}/roles | — |
| POST | /v1/communities/{communityId}/roles | { "name", "color", "icon"?, "position"?, "systemPermissions"?, "contentAccess"? } |
| POST | /v1/communities/{communityId}/roles/reorder | { "orderedRoleIds": [] } — pełna lista |
| PATCH | /v1/communities/{communityId}/roles/{roleId} | dowolny podzbiór pól z tworzenia |
| DELETE | /v1/communities/{communityId}/roles/{roleId} | ról wbudowanych nie da się usunąć; członkowie z tą rolą wracają do roli Członek |
Ustawienia (manageCommunity)
| Metoda | Endpoint | Body |
|---|---|---|
| GET | /v1/communities/{communityId}/settings | — (settings to null, jeśli nigdy nie zapisano) |
| PATCH | /v1/communities/{communityId}/settings | { "patch": { … } } — typowana biała lista, 400 empty-patch, gdy nic nie zostaje |
Akceptowane klucze patch: uploadVideo, membersDisplay, viewStyle, displayName, icon, hiddenWhenUnavailable, voiceMessages, enableMemberApiAccess, publicAccess, publicAccessTermsUrl, contentVisibleFromJoinDate, eventsEnabled, directMessagesEnabled, gamification, moderation, assistant, digest. Bloki zagnieżdżone zastępują cały swój podobiekt:
{
"patch": {
"eventsEnabled": true,
"directMessagesEnabled": true,
"contentVisibleFromJoinDate": false,
"gamification": { "enabled": true },
"moderation": { "autoHideAfterReports": 3 }
}
}
Wydarzenia w kalendarzu (manageCommunity)
| Metoda | Endpoint | Body / query |
|---|---|---|
| GET | /v1/communities/{communityId}/events | ?from / ?to (ISO; zakres domknięty po startAt, domyślnie teraz ± 365 dni), ?excludeCancelled=true, ?limit ≤ 500 (domyślnie 100). Najbliższe najpierw. |
| POST | /v1/communities/{communityId}/events | { "title", "startAt", "endAt", "timezone", "location": { "type": "online" | "inPerson", "url"?, "address"? }, "description"?, "type"?, "allDay"?, "coverImage"? } → 201 { event } |
| PATCH | /v1/communities/{communityId}/events/{eventId} | dowolny podzbiór pól z tworzenia plus "status": "scheduled" | "cancelled" |
| DELETE | /v1/communities/{communityId}/events/{eventId} | trwałe usunięcie → 200 {} |
startAt / endAt to chwile ISO 8601; timezone to strefa IANA, w której utworzono wydarzenie (Europe/Warsaw). type to jedno z liveCall, workshop, meetup, conference, retreat, other (domyślne). Koniec musi być po początku, a wydarzenie może trwać maksymalnie 31 dni — 400 invalid-time-range. Nieznane wydarzenie → 404 event-not-found. Wydarzenia są widoczne dla członków tylko przy włączonym eventsEnabled w ustawieniach.
Kolejka moderacji (moderatePosts lub moderateComments)
| Metoda | Endpoint | Body |
|---|---|---|
| GET | /v1/communities/{communityId}/moderation/reports | — → { "pending": [], "resolved": [] } (≤ 100 oczekujących, 25 ostatnich rozstrzygnięć) |
| POST | /v1/communities/{communityId}/moderation/reports/{reportId}/resolve | { "action": "remove" | "dismiss", "note"? } → 200 {} |
Jedno zgłoszenie na zgłoszony element (id to {targetType}_{targetId}); reporters pokazuje, kto i dlaczego zgłosił, a autoHidden — czy próg zgłoszeń już ukrył treść. remove miękko usuwa post/komentarz i powiadamia autora (z dołączoną notatką); dismiss zachowuje treść i przywraca element ukryty automatycznie. Rozstrzygnięcie zgłoszenia posta wymaga moderatePosts, komentarza — moderateComments. 404 report-not-found, 409 report-already-resolved przy drugim werdykcie.
Czy ten artykuł był pomocny?

