# app.protoimsg.chat.role

> Published by [lexicons.protoimsg.app](https://lexicon.garden/identity/did:plc:xk3xpcauatfephlieonmluh4)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:xk3xpcauatfephlieonmluh4/app.protoimsg.chat.role)
- [Documentation](https://lexicon.garden/lexicon/did:plc:xk3xpcauatfephlieonmluh4/app.protoimsg.chat.role/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:xk3xpcauatfephlieonmluh4/app.protoimsg.chat.role/examples)

## Definitions

### `app.protoimsg.chat.role`

**Type**: `record`

Assign a moderator role to a user for a specific room.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `role` | `string` | Yes | The role being assigned. |
| `room` | `string` (at-uri) | Yes | AT-URI of the room. |
| `subject` | `string` (did) | Yes | DID of the user being assigned the role. |
| `createdAt` | `string` (datetime) | Yes | Timestamp of role assignment. |

## Raw Schema

```json
{
  "id": "app.protoimsg.chat.role",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "room",
          "subject",
          "role",
          "createdAt"
        ],
        "properties": {
          "role": {
            "type": "string",
            "description": "The role being assigned.",
            "knownValues": [
              "moderator",
              "owner"
            ]
          },
          "room": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of the room."
          },
          "subject": {
            "type": "string",
            "format": "did",
            "description": "DID of the user being assigned the role."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "Timestamp of role assignment."
          }
        }
      },
      "description": "Assign a moderator role to a user for a specific room."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
