<!-- https://headless-lms.dev/docs/api/communities -->

# Communities

Communities, their spaces, topics, and direct-message settings

- [List communities (staff)](https://headless-lms.dev/docs/api/communities/listCommunities): Staff only (owner, admin, instructor). Pages every community in the organization, drafts included, filtered by `status` and searched by title.
- [Create a community (staff)](https://headless-lms.dev/docs/api/communities/createCommunity): Owner or admin only. The community starts as a draft with the default direct-message settings and no spaces. Members see it once it is published and they hold it.
- [Get a community (staff)](https://headless-lms.dev/docs/api/communities/getCommunity): Staff only (owner, admin, instructor). Any community of the organization, drafts included.
- [Update a community (staff)](https://headless-lms.dev/docs/api/communities/updateCommunity): Owner or admin only. Changes only the fields sent. `thumbnailAssetId` must be a ready library image (409 otherwise); null clears it.
- [Delete a community (staff)](https://headless-lms.dev/docs/api/communities/deleteCommunity): Owner or admin only. Links to the community from other spaces are removed with it.
- [Change direct-message settings for a community (staff)](https://headless-lms.dev/docs/api/communities/patchCommunityDmSettings): Owner or admin only. Changes only the settings sent; the rest keep their values. They decide who may message whom from then on.
- [Publish a community (staff)](https://headless-lms.dev/docs/api/communities/publishCommunity): Owner or admin only. Makes the community visible to the people who hold it.
- [Unpublish a community (staff)](https://headless-lms.dev/docs/api/communities/unpublishCommunity): Owner or admin only. Hides the community from members again; nothing in it is deleted.
- [Staff analytics for a community](https://headless-lms.dev/docs/api/communities/getCommunityAnalytics): Staff only (owner, admin, instructor). Membership, activity and moderation counts for one community.
- [Open message flags in a community (staff)](https://headless-lms.dev/docs/api/communities/getCommunityMessageQueue): Staff only (owner, admin, instructor). The messages in the community's chats with open flags, with the flags and the chat each is in. Holds at most the 100 oldest open flags; working the queue brings in the next ones.
- [List the spaces in a community (staff)](https://headless-lms.dev/docs/api/communities/listCommunitySpaces): Staff only (owner, admin, instructor). Every space in order, with its topics and links.
- [Create a space (staff)](https://headless-lms.dev/docs/api/communities/createSpace): Owner or admin only. The space is added last. An `all_members` space cannot have a capacity (409).
- [Reorder the spaces in a community (staff)](https://headless-lms.dev/docs/api/communities/reorderSpaces): Owner or admin only. Send every space id of the community exactly once (409 otherwise).
- [Get a space (staff)](https://headless-lms.dev/docs/api/communities/getSpace): Staff only (owner, admin, instructor). The space with its topics and links.
- [Update a space (staff)](https://headless-lms.dev/docs/api/communities/updateSpace): Owner or admin only. Changes only the fields sent; `settings` merges into the current settings. An `all_members` space cannot have a capacity (409).
- [Delete a space (staff)](https://headless-lms.dev/docs/api/communities/deleteSpace): Owner or admin only. The space and everything in it go.
- [Replace the topics on a space (staff)](https://headless-lms.dev/docs/api/communities/setSpaceTopics): Owner or admin only. The list replaces the current topics: an entry with an `id` keeps and renames that topic, one without adds a topic, and a topic left out is deleted. Names must be unique (409), and a topic that posts use cannot be deleted (409).
- [Link a course, download, or community into a space (staff)](https://headless-lms.dev/docs/api/communities/addSpaceLink): Owner or admin only. The link is added last. Linking the same content twice is a 409.
- [Remove a link from a space (staff)](https://headless-lms.dev/docs/api/communities/removeSpaceLink): Owner or admin only. The linked content itself is untouched.
- [Reorder the links in a space (staff)](https://headless-lms.dev/docs/api/communities/reorderSpaceLinks): Owner or admin only. Send every link id of the space exactly once (409 otherwise).
- [List the people who hold a community (staff)](https://headless-lms.dev/docs/api/communities/listCommunityMembers): Staff only (owner, admin, instructor). Everyone with active access to the community, granted directly or through a bundle, paged and searched by name or email.
- [List the members, requests and invitations of a space (staff)](https://headless-lms.dev/docs/api/communities/listCommunitySpaceMembers): Staff only (owner, admin, instructor). The space's members, its open requests to join and its open invitations.
- [Add a person to a space (staff)](https://headless-lms.dev/docs/api/communities/addCommunitySpaceMember): Staff only (owner, admin, instructor). Places a member of the community straight into the space, with no request or invitation. 409 when the space is open to all members, the person is already placed, or the space is full.
- [Invite a person into a space (staff)](https://headless-lms.dev/docs/api/communities/inviteCommunitySpaceMember): Staff only (owner, admin, instructor). Invites a member of the community into a `by_invite` space; they join when they accept. 403 when the person is staff or does not hold the community; 409 when the space is not invite-only or the person is already placed.
- [Approve a person's request to join a space (staff)](https://headless-lms.dev/docs/api/communities/approveCommunitySpaceRequest): Staff only (owner, admin, instructor). Makes the requester an active member. 404 when the person has no open request; 409 when the space is full or they are already a member.
- [Decline a person's request to join a space (staff)](https://headless-lms.dev/docs/api/communities/declineCommunitySpaceRequest): Staff only (owner, admin, instructor). Closes the open request. 404 when the person has no open request; 409 when they are already a member.
- [Remove a person from a space (staff)](https://headless-lms.dev/docs/api/communities/removeCommunitySpaceMember): Staff only (owner, admin, instructor). Revokes the placement, whether it is a membership, a request or an invitation. 409 when the space is open to all members or the placement is already revoked.
- [The moderation queue of a space (staff)](https://headless-lms.dev/docs/api/communities/getCommunitySpaceQueue): Staff only (owner, admin, instructor). Posts awaiting review, and the open flags on posts and on comments in the space. Each list holds at most the 100 oldest entries: pending posts by creation, flags by when they were raised; working the queue brings in the next ones.
- [Publish a post that is awaiting review (staff)](https://headless-lms.dev/docs/api/communities/approveCommunityPost): Staff only (owner, admin, instructor). 409 when the post is not awaiting review.
- [Remove a post (staff)](https://headless-lms.dev/docs/api/communities/removeCommunityPost): Staff only (owner, admin, instructor). Takes a published or pending post down and resolves its open flags as `removed`. 409 when it is already removed or was never submitted.
- [Restore a removed post (staff)](https://headless-lms.dev/docs/api/communities/restoreCommunityPost): Staff only (owner, admin, instructor). 409 when the post is not removed.
- [Dismiss the open flags on a post (staff)](https://headless-lms.dev/docs/api/communities/resolveCommunityPostFlags): Staff only (owner, admin, instructor). Closes every open flag on the post and leaves it up.
- [Remove a comment on a post (staff)](https://headless-lms.dev/docs/api/communities/removeCommunityComment): Staff only (owner, admin, instructor). Hides the comment and resolves its open flags as `removed`. Removing a removed comment returns it unchanged.
- [Restore a removed comment on a post (staff)](https://headless-lms.dev/docs/api/communities/restoreCommunityComment): Staff only (owner, admin, instructor). Publishes the comment again. Restoring a comment that is not removed returns it unchanged.
- [Dismiss the open flags on a comment (staff)](https://headless-lms.dev/docs/api/communities/resolveCommunityCommentFlags): Staff only (owner, admin, instructor). Closes every open flag on the comment and leaves it up.
- [Dismiss the open flags on a message (staff)](https://headless-lms.dev/docs/api/communities/resolveCommunityMessageFlags): Staff only (owner, admin, instructor). Closes every open flag on the message and leaves it up.
- [Lock a chat (staff)](https://headless-lms.dev/docs/api/communities/lockCommunityChat): Staff only (owner, admin, instructor). Nobody can send or edit messages until it is unlocked; its open message flags are resolved as `locked`. Locking a locked chat returns it unchanged.
- [Unlock a chat (staff)](https://headless-lms.dev/docs/api/communities/unlockCommunityChat): Staff only (owner, admin, instructor). Lets participants send messages again. Unlocking an unlocked chat returns it unchanged.
- [The spaces a member can see in a community](https://headless-lms.dev/docs/api/communities/getMemberCommunityHome): For a member of the community. Lists its spaces in order. Spaces the viewer can open come back in full; spaces they can see but not open come back locked, with only their name, count, rule and the viewer's standing. A by-invite space the viewer is not invited to or a member of is left out. 404 when the viewer is not a member.
- [One space as a member sees it](https://headless-lms.dev/docs/api/communities/getMemberSpace): For a member of the community: the space with its topics, links, settings and where the viewer stands. A space the viewer cannot open comes back locked, without its content. 404 when the viewer is not a member, the space is not in the community, or it is a by-invite space the viewer is not invited to or a member of.
- [People in a community](https://headless-lms.dev/docs/api/communities/getMemberCommunityDirectory): For a member of the community: everyone who holds it, with their public profile. 404 when the viewer is not a member.
- [List the members of a space](https://headless-lms.dev/docs/api/communities/listSpaceMembers): For anyone who can open the space. Members see the active members; moderators also see open requests and invitations.
- [Add a person to a space you moderate](https://headless-lms.dev/docs/api/communities/addSpaceMember): For a moderator who is a member of the community. Places another member straight into the space, with no request or invitation. 409 when the space is open to all members, the person is already placed, or the space is full.
- [Ask to join a space](https://headless-lms.dev/docs/api/communities/requestSpaceMembership): For a member of the community who is not staff. Opens a request on a `by_request` space for a moderator to approve. 409 when the space is not `by_request` or you are already placed in it.
- [Invite a person into a space you moderate](https://headless-lms.dev/docs/api/communities/inviteSpaceMember): For a moderator who is a member of the community. Invites another member into a `by_invite` space; they join when they accept. 403 when the person is staff or does not hold the community; 409 when the space is not invite-only or the person is already placed.
- [Accept your invitation to a space](https://headless-lms.dev/docs/api/communities/acceptSpaceInvite): For a member of the community who is not staff. Makes you an active member. 409 when you have no open invitation, are already a member, or the space is full.
- [Approve a person's request to join a space you moderate](https://headless-lms.dev/docs/api/communities/approveSpaceRequest): For a moderator who is a member of the community. Makes the requester an active member. 404 when the person has no open request; 409 when the space is full or they are already a member.
- [Decline a person's request to join a space you moderate](https://headless-lms.dev/docs/api/communities/declineSpaceRequest): For a moderator who is a member of the community. Closes the open request. 404 when the person has no open request; 409 when they are already a member.
- [Refuse your invitation to a space](https://headless-lms.dev/docs/api/communities/refuseSpaceInvite): For a member of the community who is not staff. 409 when you have no open invitation or are already a member.
- [Leave a space](https://headless-lms.dev/docs/api/communities/leaveSpace): For a member of the community who is not staff. 409 when you are not a member of the space.
- [Remove a person from a space you moderate](https://headless-lms.dev/docs/api/communities/removeSpaceMember): For a moderator who is a member of the community. Revokes the placement, whether it is a membership, a request or an invitation. 409 when the space is open to all members or the placement is already revoked.
