# com.getorbyt.community.deleteRole

> 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.deleteRole)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.deleteRole/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.deleteRole/examples)

## Definitions

### `com.getorbyt.community.deleteRole`

**Type**: `procedure`

Deletes a role the Community defined, or, for the key moderator, puts the built-in moderator role back to its default permissions. A role someone holds cannot be deleted; move them to another role first. Only an administrator may delete roles. Recorded in the moderation log.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `community` | `string` (at-uri) | Yes |  |
| `key` | `string` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `deleted` | `boolean` | Yes |  |

#### Errors

- **AuthenticationRequired**
- **CommunityNotFound**
- **InsufficientRole**
- **InvalidRequest**
- **RoleNotFound**
- **RoleInUse**: A member holds this role. Move them to another role first.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Deletes a role the Community defined, or, for the key moderator, puts the built-in moderator role back to its default permissions. A role someone holds cannot be deleted; move them to another role first. Only an administrator may delete roles. Recorded in the moderation log.",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "CommunityNotFound"
        },
        {
          "name": "InsufficientRole"
        },
        {
          "name": "InvalidRequest"
        },
        {
          "name": "RoleNotFound"
        },
        {
          "description": "A member holds this role. Move them to another role first.",
          "name": "RoleInUse"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "community": {
              "format": "at-uri",
              "type": "string"
            },
            "key": {
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "community",
            "key"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "deleted": {
              "type": "boolean"
            }
          },
          "required": [
            "deleted"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "com.getorbyt.community.deleteRole",
  "lexicon": 1
}
```
