# com.getorbyt.community.defs

> Published by [getorbyt.com](https://lexicon.garden/identity/did:plc:2xrqztnmzlckb3xfuuukupso)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.defs/examples)

## Definitions

### `com.getorbyt.community.defs#rule`

**Type**: `object`

One Community rule. An object rather than a bare string so a title, an ordinal or a createdAt can be added later without a schema break.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `text` | `string` | Yes |  |

### `com.getorbyt.community.defs#view`

**Type**: `object`

A hydrated Community. Only the fields that identify the Community are required; counts and viewer state are optional so a cheaper view can omit them without a schema break.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |
| `name` | `string` | Yes |  |
| `rules` | `array` | No |  |
| `avatar` | `string` (uri) | No |  |
| `labels` | `array` | No | Labels applied to this Community. Clients moderate against these exactly as they do app.bsky.feed.defs#postView labels. |
| `viewer` | `ref` → `#viewerState` | No |  |
| `ownerDid` | `string` (did) | Yes | The account whose repository holds the Community declaration record. Clients hydrate it to a profile through their authenticated Bluesky AppView. |
| `createdAt` | `string` (datetime) | Yes |  |
| `postCount` | `integer` | No |  |
| `updatedAt` | `string` (datetime) | No |  |
| `postPolicy` | `string` | No | The raw value its owner wrote, not the value this service resolved. Absent means anyone, which is also how a server that predates this field behaves. |
| `accentColor` | `string` | No |  |
| `description` | `string` | No |  |
| `memberCount` | `integer` | No |  |

### `com.getorbyt.community.defs#feedItem`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `post` | `string` (at-uri) | Yes | The linked app.bsky.feed.post URI. Clients hydrate it through their authenticated Bluesky AppView. |
| `pinned` | `boolean` | No |  |
| `status` | `string` | No | Community-level state; absent means visible. `removed` is a moderator removal scoped to this Community; the underlying app.bsky.feed.post remains live on the network. Only the author and Community moderators receive removed items. |
| `removedAt` | `string` (datetime) | No |  |
| `removedBy` | `string` (did) | No |  |
| `removedReason` | `string` | No | Present only for the post author and Community moderators. |

### `com.getorbyt.community.defs#memberView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `role` | `string` | No | Absent means member. |
| `status` | `string` | No | Absent means active. |
| `joinedAt` | `string` (datetime) | No |  |
| `membershipUri` | `string` (at-uri) | No |  |

### `com.getorbyt.community.defs#viewerState`

**Type**: `object`

The requesting account's relationship to a Community. Every field is optional; an absent field means the viewer holds no membership and no privilege.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `role` | `string` | No |  |
| `canPost` | `boolean` | No |  |
| `canManage` | `boolean` | No |  |
| `canModerate` | `boolean` | No |  |
| `membershipUri` | `string` (at-uri) | No |  |
| `membershipStatus` | `string` | No | Absent means none. |

### `com.getorbyt.community.defs#writeStatus`

**Type**: `object`

The fate of one record the caller wrote to their own repository.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `error` | `string` | No | Why the record was rejected. Present only for `rejected`. |
| `status` | `string` | Yes | `pending` means the record has not reached this service yet, which is the normal state for a few seconds after a write. `rejected` means it will never be indexed as written. |
| `indexedAt` | `string` (datetime) | No |  |

## Raw Schema

```json
{
  "id": "com.getorbyt.community.defs",
  "defs": {
    "rule": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "maxLength": 500
        }
      },
      "description": "One Community rule. An object rather than a bare string so a title, an ordinal or a createdAt can be added later without a schema break."
    },
    "view": {
      "type": "object",
      "required": [
        "uri",
        "cid",
        "name",
        "ownerDid",
        "createdAt"
      ],
      "properties": {
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "name": {
          "type": "string",
          "maxLength": 63,
          "minLength": 2
        },
        "rules": {
          "type": "array",
          "items": {
            "ref": "#rule",
            "type": "ref"
          },
          "maxLength": 20
        },
        "avatar": {
          "type": "string",
          "format": "uri"
        },
        "labels": {
          "type": "array",
          "items": {
            "ref": "com.atproto.label.defs#label",
            "type": "ref"
          },
          "description": "Labels applied to this Community. Clients moderate against these exactly as they do app.bsky.feed.defs#postView labels."
        },
        "viewer": {
          "ref": "#viewerState",
          "type": "ref"
        },
        "ownerDid": {
          "type": "string",
          "format": "did",
          "description": "The account whose repository holds the Community declaration record. Clients hydrate it to a profile through their authenticated Bluesky AppView."
        },
        "createdAt": {
          "type": "string",
          "format": "datetime"
        },
        "postCount": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAt": {
          "type": "string",
          "format": "datetime"
        },
        "postPolicy": {
          "type": "string",
          "description": "The raw value its owner wrote, not the value this service resolved. Absent means anyone, which is also how a server that predates this field behaves.",
          "knownValues": [
            "anyone",
            "members",
            "moderators"
          ]
        },
        "accentColor": {
          "type": "string",
          "maxLength": 32
        },
        "description": {
          "type": "string",
          "maxLength": 2000
        },
        "memberCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "description": "A hydrated Community. Only the fields that identify the Community are required; counts and viewer state are optional so a cheaper view can omit them without a schema break."
    },
    "feedItem": {
      "type": "object",
      "required": [
        "post"
      ],
      "properties": {
        "post": {
          "type": "string",
          "format": "at-uri",
          "description": "The linked app.bsky.feed.post URI. Clients hydrate it through their authenticated Bluesky AppView."
        },
        "pinned": {
          "type": "boolean",
          "default": false
        },
        "status": {
          "type": "string",
          "description": "Community-level state; absent means visible. `removed` is a moderator removal scoped to this Community; the underlying app.bsky.feed.post remains live on the network. Only the author and Community moderators receive removed items.",
          "knownValues": [
            "visible",
            "removed"
          ]
        },
        "removedAt": {
          "type": "string",
          "format": "datetime"
        },
        "removedBy": {
          "type": "string",
          "format": "did"
        },
        "removedReason": {
          "type": "string",
          "maxLength": 1000,
          "description": "Present only for the post author and Community moderators."
        }
      }
    },
    "memberView": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        },
        "role": {
          "type": "string",
          "description": "Absent means member.",
          "knownValues": [
            "owner",
            "moderator",
            "member"
          ]
        },
        "status": {
          "type": "string",
          "description": "Absent means active.",
          "knownValues": [
            "active",
            "muted",
            "banned"
          ]
        },
        "joinedAt": {
          "type": "string",
          "format": "datetime"
        },
        "membershipUri": {
          "type": "string",
          "format": "at-uri"
        }
      }
    },
    "viewerState": {
      "type": "object",
      "properties": {
        "role": {
          "type": "string",
          "knownValues": [
            "owner",
            "moderator",
            "member"
          ]
        },
        "canPost": {
          "type": "boolean",
          "default": false
        },
        "canManage": {
          "type": "boolean",
          "default": false
        },
        "canModerate": {
          "type": "boolean",
          "default": false
        },
        "membershipUri": {
          "type": "string",
          "format": "at-uri"
        },
        "membershipStatus": {
          "type": "string",
          "description": "Absent means none.",
          "knownValues": [
            "none",
            "active",
            "muted",
            "banned"
          ]
        }
      },
      "description": "The requesting account's relationship to a Community. Every field is optional; an absent field means the viewer holds no membership and no privilege."
    },
    "writeStatus": {
      "type": "object",
      "required": [
        "uri",
        "status"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "error": {
          "type": "string",
          "maxLength": 1000,
          "description": "Why the record was rejected. Present only for `rejected`."
        },
        "status": {
          "type": "string",
          "description": "`pending` means the record has not reached this service yet, which is the normal state for a few seconds after a write. `rejected` means it will never be indexed as written.",
          "knownValues": [
            "indexed",
            "pending",
            "rejected",
            "deleted"
          ]
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        }
      },
      "description": "The fate of one record the caller wrote to their own repository."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
