# tools.umbrae.community.getCommunity

> A community's details and the caller's standing in it. Served by the community's managing app, at the service its ref's app names, with atproto service auth (iss the caller, aud the app, lxm this method); clients call through their PDS with atproto-proxy set to the ref's app. Any managing app may serve it: a serving app, or a PDS that manages its own communities. An unlisted community answers CommunityNotFound to anyone who isn't a member.

- Kind: query
- Authority: community.umbrae.tools
- Lexicon: 1
- Published by [lexicons.umbrae.tools](https://lexicon.garden/identity/did:plc:656sqbhftme2qbyjtcc2q6jk), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:656sqbhftme2qbyjtcc2q6jk/tools.umbrae.community.getCommunity)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:656sqbhftme2qbyjtcc2q6jk/tools.umbrae.community.getCommunity/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:656sqbhftme2qbyjtcc2q6jk/tools.umbrae.community.getCommunity/analytics)

## Query (`tools.umbrae.community.getCommunity`)

Type: query · GET

### Parameters (query string)

- `key` (string, required): The community's key within this app.
  - Constraints: minLength: 1, maxLength: 63

### Output (application/json)

- `appClientId` (string · uri, required): The app's OAuth client ID: the URL of its client metadata, which publishes a JWKS. The app syncs members' community spaces with an attestation for this client, and a profile space limited by allowedApps must list it before the owner calls registerProfile.
- `community` (ref, required)
  - Reference: `tools.umbrae.community.defs#communityRef`
- `description` (string)
- `joinMode` (string, required)
  - Constraints: knownValues: open | request | invite
- `labeler` (string · did): The community's hidden labeler: a tools.umbrae.labeler space at self whose managed policy names this app. The app applies its labels to the community's posts.
- `listed` (boolean, required): Whether the app shows the community to anyone it admits. An unlisted one is shown only to members.
- `name` (string, required)
- `viewer` (ref, required)
  - Reference: `#viewerState`

### Errors

- `CommunityNotFound`: Not a community this managing app manages, or an unlisted one and the caller isn't a member.
- `NotAllowed`: The caller lacks the role this needs.
- `NotAdmitted`: The managing app doesn't admit this account.

## #viewerState (`tools.umbrae.community.getCommunity#viewerState`)

Type: object

### Properties

- `moderator` (boolean, required)
- `role` (string): A member's role: readers only read; writers also post, reply, like and repost.
  - Constraints: knownValues: reader | writer
- `state` (string, required)
  - Constraints: knownValues: none | requested | invited | member | removed

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A community's details and the caller's standing in it. Served by the community's managing app, at the service its ref's app names, with atproto service auth (iss the caller, aud the app, lxm this method); clients call through their PDS with atproto-proxy set to the ref's app. Any managing app may serve it: a serving app, or a PDS that manages its own communities. An unlisted community answers CommunityNotFound to anyone who isn't a member.",
      "errors": [
        {
          "description": "Not a community this managing app manages, or an unlisted one and the caller isn't a member.",
          "name": "CommunityNotFound"
        },
        {
          "description": "The caller lacks the role this needs.",
          "name": "NotAllowed"
        },
        {
          "description": "The managing app doesn't admit this account.",
          "name": "NotAdmitted"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "appClientId": {
              "description": "The app's OAuth client ID: the URL of its client metadata, which publishes a JWKS. The app syncs members' community spaces with an attestation for this client, and a profile space limited by allowedApps must list it before the owner calls registerProfile.",
              "format": "uri",
              "type": "string"
            },
            "community": {
              "ref": "tools.umbrae.community.defs#communityRef",
              "type": "ref"
            },
            "description": {
              "type": "string"
            },
            "joinMode": {
              "knownValues": [
                "open",
                "request",
                "invite"
              ],
              "type": "string"
            },
            "labeler": {
              "description": "The community's hidden labeler: a tools.umbrae.labeler space at self whose managed policy names this app. The app applies its labels to the community's posts.",
              "format": "did",
              "type": "string"
            },
            "listed": {
              "description": "Whether the app shows the community to anyone it admits. An unlisted one is shown only to members.",
              "type": "boolean"
            },
            "name": {
              "type": "string"
            },
            "viewer": {
              "ref": "#viewerState",
              "type": "ref"
            }
          },
          "required": [
            "community",
            "name",
            "joinMode",
            "listed",
            "appClientId",
            "viewer"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "key": {
            "description": "The community's key within this app.",
            "maxLength": 63,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "viewerState": {
      "properties": {
        "moderator": {
          "type": "boolean"
        },
        "role": {
          "description": "A member's role: readers only read; writers also post, reply, like and repost.",
          "knownValues": [
            "reader",
            "writer"
          ],
          "type": "string"
        },
        "state": {
          "knownValues": [
            "none",
            "requested",
            "invited",
            "member",
            "removed"
          ],
          "type": "string"
        }
      },
      "required": [
        "state",
        "moderator"
      ],
      "type": "object"
    }
  },
  "id": "tools.umbrae.community.getCommunity",
  "lexicon": 1
}
```
