# social.colibri.beta.community.ban

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.ban)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.ban/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.ban/examples)

## Definitions

### `social.colibri.beta.community.ban`

**Type**: `procedure`

Bans a member from a community. This removes their member record and stops the community issuing them space credentials. Their existing content is not deleted: it stays in their own repo, where it can still be labelled or filtered.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `reason` | `string` | No | Human-readable reason for the ban. |
| `subject` | `string` (did) | Yes | The member to ban. |
| `community` | `string` (did) | Yes | The community to ban the member from. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **Forbidden**: The caller lacks the member.ban permission.
- **CommunityNotFound**: No community exists at the given DID.
- **AlreadyBanned**: The subject is already banned from this community.
- **RoleHierarchy**: The subject holds a role at or above the caller's highest role position.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.

## Raw Schema

```json
{
  "id": "social.colibri.beta.community.ban",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "community",
            "subject"
          ],
          "properties": {
            "reason": {
              "type": "string",
              "maxLength": 512,
              "description": "Human-readable reason for the ban."
            },
            "subject": {
              "type": "string",
              "format": "did",
              "description": "The member to ban."
            },
            "community": {
              "type": "string",
              "format": "did",
              "description": "The community to ban the member from."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthRequired",
          "description": "The request is missing, malformed, or unverifiable service auth."
        },
        {
          "name": "Forbidden",
          "description": "The caller lacks the member.ban permission."
        },
        {
          "name": "CommunityNotFound",
          "description": "No community exists at the given DID."
        },
        {
          "name": "AlreadyBanned",
          "description": "The subject is already banned from this community."
        },
        {
          "name": "RoleHierarchy",
          "description": "The subject holds a role at or above the caller's highest role position."
        },
        {
          "name": "CredentialsUnavailable",
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "properties": {}
        },
        "encoding": "application/json"
      },
      "description": "Bans a member from a community. This removes their member record and stops the community issuing them space credentials. Their existing content is not deleted: it stays in their own repo, where it can still be labelled or filtered."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
