# social.colibri.beta.role.update

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

## Definitions

### `social.colibri.beta.role.update`

**Type**: `procedure`

Updates a role's settings.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | No | Display name. |
| `role` | `string` (record-key) | Yes | The role's record key. |
| `color` | `string` | No | Hex colour as #rrggbb. |
| `hoisted` | `boolean` | No | Whether holders are listed separately in the member list. |
| `position` | `integer` | No | Hierarchy position. Higher outranks lower. |
| `community` | `string` (did) | Yes | The community the role belongs to. |
| `mentionable` | `boolean` | No | Whether @role mentions resolve to this role. |
| `permissions` | `array` | No | Permissions granted by this role. |
| `channelOverrides` | `array` | No | Per-channel overrides. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `role` | `ref` → `social.colibri.beta.community.defs#roleView` | Yes | The updated role. |

#### 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 modified.
- **RoleHierarchy**: The change would place the role at or above the caller's highest role position, or grants a permission the caller does not hold.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.

## Raw Schema

```json
{
  "id": "social.colibri.beta.role.update",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "community",
            "role"
          ],
          "properties": {
            "name": {
              "type": "string",
              "maxLength": 32,
              "minLength": 1,
              "description": "Display name."
            },
            "role": {
              "type": "string",
              "format": "record-key",
              "description": "The role's record key."
            },
            "color": {
              "type": "string",
              "maxLength": 7,
              "description": "Hex colour as #rrggbb."
            },
            "hoisted": {
              "type": "boolean",
              "description": "Whether holders are listed separately in the member list."
            },
            "position": {
              "type": "integer",
              "description": "Hierarchy position. Higher outranks lower."
            },
            "community": {
              "type": "string",
              "format": "did",
              "description": "The community the role belongs to."
            },
            "mentionable": {
              "type": "boolean",
              "description": "Whether @role mentions resolve to this role."
            },
            "permissions": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "A namespaced permission identifier."
              },
              "description": "Permissions granted by this role."
            },
            "channelOverrides": {
              "type": "array",
              "items": {
                "ref": "social.colibri.beta.community.defs#roleChannelOverride",
                "type": "ref",
                "description": "A per-channel permission override."
              },
              "description": "Per-channel overrides."
            }
          }
        },
        "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 modified."
        },
        {
          "name": "RoleHierarchy",
          "description": "The change would place the role at or above the caller's highest role position, or grants a permission the caller does not hold."
        },
        {
          "name": "CredentialsUnavailable",
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "role"
          ],
          "properties": {
            "role": {
              "ref": "social.colibri.beta.community.defs#roleView",
              "type": "ref",
              "description": "The updated role."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Updates a role's settings."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
