# chat.sprk.convo.defs

> Published by [sprk.so](https://lexicon.garden/identity/did:plc:cveom2iroj3mt747sd4qqnr2)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:cveom2iroj3mt747sd4qqnr2/chat.sprk.convo.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:cveom2iroj3mt747sd4qqnr2/chat.sprk.convo.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:cveom2iroj3mt747sd4qqnr2/chat.sprk.convo.defs/examples)

## Definitions

### `chat.sprk.convo.defs#convoView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes |  |
| `rev` | `string` | Yes |  |
| `muted` | `boolean` | Yes |  |
| `status` | `string` | No |  |
| `members` | `array` | Yes |  |
| `lastMessage` | `union` | No |  |
| `unreadCount` | `integer` | Yes |  |
| `lastReaction` | `union` | No |  |

### `chat.sprk.convo.defs#messageRef`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `convoId` | `string` | Yes |  |
| `messageId` | `string` | Yes |  |

### `chat.sprk.convo.defs#messageView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes |  |
| `rev` | `string` | Yes |  |
| `text` | `string` | Yes |  |
| `embed` | `string` (at-uri) | No |  |
| `sender` | `ref` → `#messageViewSender` | Yes |  |
| `sentAt` | `string` (datetime) | Yes |  |
| `reactions` | `array` | No | Reactions to this message, in ascending order of creation time. |

### `chat.sprk.convo.defs#logMuteConvo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |

### `chat.sprk.convo.defs#messageInput`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `text` | `string` | Yes |  |
| `embed` | `string` (at-uri) | No |  |

### `chat.sprk.convo.defs#reactionView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `value` | `string` | Yes |  |
| `sender` | `ref` → `#reactionViewSender` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |

### `chat.sprk.convo.defs#logBeginConvo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |

### `chat.sprk.convo.defs#logLeaveConvo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |

### `chat.sprk.convo.defs#logAcceptConvo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |

### `chat.sprk.convo.defs#logAddReaction`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |
| `message` | `union` | Yes |  |
| `reaction` | `ref` → `#reactionView` | Yes |  |

### `chat.sprk.convo.defs#logReadMessage`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |
| `message` | `union` | Yes |  |

### `chat.sprk.convo.defs#logUnmuteConvo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |

### `chat.sprk.convo.defs#logCreateMessage`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |
| `message` | `union` | Yes |  |

### `chat.sprk.convo.defs#logDeleteMessage`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |
| `message` | `union` | Yes |  |

### `chat.sprk.convo.defs#logRemoveReaction`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rev` | `string` | Yes |  |
| `convoId` | `string` | Yes |  |
| `message` | `union` | Yes |  |
| `reaction` | `ref` → `#reactionView` | Yes |  |

### `chat.sprk.convo.defs#messageViewSender`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `chat.sprk.convo.defs#deletedMessageView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes |  |
| `rev` | `string` | Yes |  |
| `sender` | `ref` → `#messageViewSender` | Yes |  |
| `sentAt` | `string` (datetime) | Yes |  |

### `chat.sprk.convo.defs#reactionViewSender`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `chat.sprk.convo.defs#messageAndReactionView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `message` | `ref` → `#messageView` | Yes |  |
| `reaction` | `ref` → `#reactionView` | Yes |  |

## Raw Schema

```json
{
  "id": "chat.sprk.convo.defs",
  "defs": {
    "convoView": {
      "type": "object",
      "required": [
        "id",
        "rev",
        "members",
        "muted",
        "unreadCount"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "rev": {
          "type": "string"
        },
        "muted": {
          "type": "boolean"
        },
        "status": {
          "type": "string",
          "knownValues": [
            "request",
            "accepted"
          ]
        },
        "members": {
          "type": "array",
          "items": {
            "ref": "chat.sprk.actor.defs#profileViewBasic",
            "type": "ref"
          }
        },
        "lastMessage": {
          "refs": [
            "#messageView",
            "#deletedMessageView"
          ],
          "type": "union"
        },
        "unreadCount": {
          "type": "integer"
        },
        "lastReaction": {
          "refs": [
            "#messageAndReactionView"
          ],
          "type": "union"
        }
      }
    },
    "messageRef": {
      "type": "object",
      "required": [
        "did",
        "messageId",
        "convoId"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        },
        "convoId": {
          "type": "string"
        },
        "messageId": {
          "type": "string"
        }
      }
    },
    "messageView": {
      "type": "object",
      "required": [
        "id",
        "rev",
        "text",
        "sender",
        "sentAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "rev": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "maxLength": 10000,
          "maxGraphemes": 1000
        },
        "embed": {
          "type": "string",
          "format": "at-uri"
        },
        "sender": {
          "ref": "#messageViewSender",
          "type": "ref"
        },
        "sentAt": {
          "type": "string",
          "format": "datetime"
        },
        "reactions": {
          "type": "array",
          "items": {
            "ref": "#reactionView",
            "type": "ref"
          },
          "description": "Reactions to this message, in ascending order of creation time."
        }
      }
    },
    "logMuteConvo": {
      "type": "object",
      "required": [
        "rev",
        "convoId"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        }
      }
    },
    "messageInput": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "maxLength": 10000,
          "maxGraphemes": 1000
        },
        "embed": {
          "type": "string",
          "format": "at-uri"
        }
      }
    },
    "reactionView": {
      "type": "object",
      "required": [
        "value",
        "sender",
        "createdAt"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "sender": {
          "ref": "#reactionViewSender",
          "type": "ref"
        },
        "createdAt": {
          "type": "string",
          "format": "datetime"
        }
      }
    },
    "logBeginConvo": {
      "type": "object",
      "required": [
        "rev",
        "convoId"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        }
      }
    },
    "logLeaveConvo": {
      "type": "object",
      "required": [
        "rev",
        "convoId"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        }
      }
    },
    "logAcceptConvo": {
      "type": "object",
      "required": [
        "rev",
        "convoId"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        }
      }
    },
    "logAddReaction": {
      "type": "object",
      "required": [
        "rev",
        "convoId",
        "message",
        "reaction"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        },
        "message": {
          "refs": [
            "#messageView",
            "#deletedMessageView"
          ],
          "type": "union"
        },
        "reaction": {
          "ref": "#reactionView",
          "type": "ref"
        }
      }
    },
    "logReadMessage": {
      "type": "object",
      "required": [
        "rev",
        "convoId",
        "message"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        },
        "message": {
          "refs": [
            "#messageView",
            "#deletedMessageView"
          ],
          "type": "union"
        }
      }
    },
    "logUnmuteConvo": {
      "type": "object",
      "required": [
        "rev",
        "convoId"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        }
      }
    },
    "logCreateMessage": {
      "type": "object",
      "required": [
        "rev",
        "convoId",
        "message"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        },
        "message": {
          "refs": [
            "#messageView",
            "#deletedMessageView"
          ],
          "type": "union"
        }
      }
    },
    "logDeleteMessage": {
      "type": "object",
      "required": [
        "rev",
        "convoId",
        "message"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        },
        "message": {
          "refs": [
            "#messageView",
            "#deletedMessageView"
          ],
          "type": "union"
        }
      }
    },
    "logRemoveReaction": {
      "type": "object",
      "required": [
        "rev",
        "convoId",
        "message",
        "reaction"
      ],
      "properties": {
        "rev": {
          "type": "string"
        },
        "convoId": {
          "type": "string"
        },
        "message": {
          "refs": [
            "#messageView",
            "#deletedMessageView"
          ],
          "type": "union"
        },
        "reaction": {
          "ref": "#reactionView",
          "type": "ref"
        }
      }
    },
    "messageViewSender": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        }
      }
    },
    "deletedMessageView": {
      "type": "object",
      "required": [
        "id",
        "rev",
        "sender",
        "sentAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "rev": {
          "type": "string"
        },
        "sender": {
          "ref": "#messageViewSender",
          "type": "ref"
        },
        "sentAt": {
          "type": "string",
          "format": "datetime"
        }
      }
    },
    "reactionViewSender": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        }
      }
    },
    "messageAndReactionView": {
      "type": "object",
      "required": [
        "message",
        "reaction"
      ],
      "properties": {
        "message": {
          "ref": "#messageView",
          "type": "ref"
        },
        "reaction": {
          "ref": "#reactionView",
          "type": "ref"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
