# social.colibri.beta.community.setMemberRoles

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

## Definitions

### `social.colibri.beta.community.setMemberRoles`

**Type**: `procedure`

Sets the complete set of roles a member holds.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `roles` | `array` | Yes | The complete new set of roles the member should hold. |
| `subject` | `string` (did) | Yes | The member whose roles are being set. |
| `community` | `string` (did) | Yes | The community the member belongs to. |

#### Output

**Encoding**: `application/json`

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

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **Forbidden**: The requesting user lacks the role.manage permission.
- **CommunityNotFound**: No community exists with that DID.
- **MemberNotFound**: The subject does not hold a member record in this community.
- **RoleNotFound**: One of the requested roles does not exist.
- **RoleHierarchy**: The requesting user cannot grant or revoke a role at or above their own highest position.
- **CredentialsUnavailable**: The AppView's stored credentials for this community are missing or unusable.

## Raw Schema

```json
{
  "id": "social.colibri.beta.community.setMemberRoles",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "community",
            "subject",
            "roles"
          ],
          "properties": {
            "roles": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "record-key",
                "description": "A role."
              },
              "description": "The complete new set of roles the member should hold."
            },
            "subject": {
              "type": "string",
              "format": "did",
              "description": "The member whose roles are being set."
            },
            "community": {
              "type": "string",
              "format": "did",
              "description": "The community the member belongs to."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthRequired",
          "description": "The request is missing, malformed, or unverifiable service auth."
        },
        {
          "name": "Forbidden",
          "description": "The requesting user lacks the role.manage permission."
        },
        {
          "name": "CommunityNotFound",
          "description": "No community exists with that DID."
        },
        {
          "name": "MemberNotFound",
          "description": "The subject does not hold a member record in this community."
        },
        {
          "name": "RoleNotFound",
          "description": "One of the requested roles does not exist."
        },
        {
          "name": "RoleHierarchy",
          "description": "The requesting user cannot grant or revoke a role at or above their own highest position."
        },
        {
          "name": "CredentialsUnavailable",
          "description": "The AppView's stored credentials for this community are missing or unusable."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "member"
          ],
          "properties": {
            "member": {
              "ref": "social.colibri.beta.community.defs#memberView",
              "type": "ref",
              "description": "The updated member."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Sets the complete set of roles a member holds."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
