# Communities

Communities are public topic spaces on the Network. Each one has an owner, moderators, members,
and its own feed of posts. They are how developers group around a stack, a project, or an idea.

## What a community is

A community has:

| Field | Notes |
| --- | --- |
| `slug` | URL-safe identifier (lowercase, 3–32 chars) |
| `name` | Display name (3–50 chars) |
| `description` | What the space is for (up to 500 chars) |
| `rules` | Up to 10 rules, each up to 200 chars |
| `icon` / `banner` | Images via the SpaceKeep CDN |
| `flairs` | Up to 12 flair labels, each up to 24 chars |

Slugs matching staff handles (`spacekeep`, `official`, `support`, `admin`, …) can only be claimed
by site owners. Reserved words like `new`, `create`, `explore`, `search` cannot be used.

## Roles

| Role | Who | Can do |
| --- | --- | --- |
| Owner | Creator | Everything, including promoting moderators and deleting the community |
| Moderator | Promoted by owner | Edit description/rules, remove posts, ban and unban members |
| Member | Anyone who joins | Post, comment, react |

Nobody can act on someone of equal or higher rank. An owner cannot be removed by a moderator.

## Listing communities

```
GET /social/communities?mine=true&limit=…
```

Pass `mine=true` to list only communities you own or belong to.

## Joining and leaving

```
POST   /social/communities/:slug/join
DELETE /social/communities/:slug/join
```

Banned members cannot re-join — the ban keeps the member row with `bannedAt` set.

## Posting in a community

Posts are created through the normal post endpoint with `communityId` set. You must be a member
of the community (and not banned) to post in it. Posts in a community are always public, and can
carry one of the community's flairs.

A community's feed:

```
GET /social/communities/:slug/posts
```

is paginated with `cursor` and `limit`.

## Pinning

Moderators can pin up to 3 posts to the top of a community:

```
POST   /social/communities/:slug/posts/:postId/pin
DELETE /social/communities/:slug/posts/:postId/pin
```

## Moderation

Moderators (and site moderators) can remove a post from a community:

```
POST /social/communities/:slug/posts/:postId/remove
```

Removal is non-destructive: the post keeps `removedAt` and a `ModerationAction`.

Members can be banned and unbanned:

```
POST   /social/communities/:slug/bans/:userId
DELETE /social/communities/:slug/bans/:userId
```

## Images

Community icon and banner are uploaded through the API and stored on the CDN:

```
POST   /social/communities/:slug/images/:kind   (icon or banner)
DELETE /social/communities/:slug/images/:kind
```

## Limits

- You can own up to 5 communities.
- Up to 3 pinned posts per community.
- Up to 12 flairs, each up to 24 characters.
- Up to 10 rules, each up to 200 characters.

## Related

- [Posting](/network/posting/) — writing posts that can be attached to a community
- [Feeds](/network/feeds/) — reading community posts in context
- [Reporting](/network/reporting/) — reporting content
