# social.colibri.beta.role.delete

> 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.role.delete)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.role.delete/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.role.delete/examples)

## Definitions

### `social.colibri.beta.role.delete`

**Type**: `procedure`

Deletes a role.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `role` | `string` (record-key) | Yes | The role's record key. |
| `community` | `string` (did) | Yes | The community the role belongs to. |

#### Output

**Encoding**: `application/json`

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

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **Forbidden**: The caller lacks the role.manage permission.
- **CommunityNotFound**: No community exists at the given DID.
- **RoleNotFound**: No role exists at the given record key.
- **RoleProtected**: The role is marked protected and cannot be deleted.
- **RoleHierarchy**: The role is 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.role.delete",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "community",
            "role"
          ],
          "properties": {
            "role": {
              "type": "string",
              "format": "record-key",
              "description": "The role's record key."
            },
            "community": {
              "type": "string",
              "format": "did",
              "description": "The community the role belongs to."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthRequired",
          "description": "The request is missing, malformed, or unverifiable service auth."
        },
        {
          "name": "Forbidden",
          "description": "The caller lacks the role.manage permission."
        },
        {
          "name": "CommunityNotFound",
          "description": "No community exists at the given DID."
        },
        {
          "name": "RoleNotFound",
          "description": "No role exists at the given record key."
        },
        {
          "name": "RoleProtected",
          "description": "The role is marked protected and cannot be deleted."
        },
        {
          "name": "RoleHierarchy",
          "description": "The role is 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": "Deletes a role."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
