# social.colibri.sync.subscribeEvents

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.sync.subscribeEvents)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.sync.subscribeEvents/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.sync.subscribeEvents/examples)

## Definitions

### `social.colibri.sync.subscribeEvents#ack`

**Type**: `object`

Sent in response to a heartbeat message.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents`

**Type**: `subscription`

Opens a WebSocket stream that transmits relevant events for the authenticated user.

```json
{
  "type": "subscription",
  "errors": [
    {
      "name": "AuthRequired"
    }
  ],
  "message": {
    "schema": {
      "refs": [
        "lex:social.colibri.sync.subscribeEvents#ack",
        "lex:social.colibri.sync.subscribeEvents#communityEvent",
        "lex:social.colibri.sync.subscribeEvents#memberEvent",
        "lex:social.colibri.sync.subscribeEvents#categoryEvent",
        "lex:social.colibri.sync.subscribeEvents#channelEvent",
        "lex:social.colibri.sync.subscribeEvents#messageEvent",
        "lex:social.colibri.sync.subscribeEvents#reactionEvent",
        "lex:social.colibri.sync.subscribeEvents#userEvent",
        "lex:social.colibri.sync.subscribeEvents#typingEvent"
      ],
      "type": "union"
    }
  },
  "description": "Opens a WebSocket stream that transmits relevant events for the authenticated user."
}
```

### `social.colibri.sync.subscribeEvents#userEvent`

**Type**: `object`

Sent when a known user has updated their profile or Colibri status.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#userEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#userStatus`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `text` | `string` | Yes |  |
| `emoji` | `string` | No |  |
| `state` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#memberEvent`

**Type**: `object`

Sent when a member has joined or left a community.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#memberEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#typingEvent`

**Type**: `object`

Sent when a user is typing in a channel the client is viewing.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#typingEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#userProfile`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `avatar` | `blob` | No |  |
| `banner` | `blob` | No |  |
| `handle` | `string` (handle) | Yes |  |
| `description` | `string` | No |  |
| `displayName` | `string` | No |  |

### `social.colibri.sync.subscribeEvents#channelEvent`

**Type**: `object`

Sent when a channel has been created, updated, or deleted.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#channelEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#messageEvent`

**Type**: `object`

Sent when a message has been sent, edited, or deleted.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#messageEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#categoryEvent`

**Type**: `object`

Sent when a category has been created, updated, or deleted.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#categoryEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#reactionEvent`

**Type**: `object`

Sent when a reaction has been added to or removed from a message.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#reactionEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#userEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `status` | `ref` → `lex:social.colibri.sync.subscribeEvents#userStatus` | No |  |
| `profile` | `ref` → `lex:social.colibri.sync.subscribeEvents#userProfile` | Yes |  |

### `social.colibri.sync.subscribeEvents#communityEvent`

**Type**: `object`

Sent when a community has been updated or deleted.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `ref` → `lex:social.colibri.sync.subscribeEvents#communityEventData` | Yes |  |
| `type` | `string` | Yes |  |

### `social.colibri.sync.subscribeEvents#memberEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `event` | `string` | Yes |  |
| `community` | `string` (at-uri) | Yes |  |
| `membership` | `string` (at-uri) | Yes |  |

### `social.colibri.sync.subscribeEvents#typingEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `event` | `string` | Yes |  |
| `channel` | `string` (at-uri) | Yes |  |

### `social.colibri.sync.subscribeEvents#channelEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `name` | `string` | No |  |
| `type` | `string` | No |  |
| `event` | `string` | Yes |  |
| `community` | `string` (at-uri) | Yes |  |
| `description` | `string` | No |  |

### `social.colibri.sync.subscribeEvents#messageEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `text` | `string` | No |  |
| `event` | `string` | Yes |  |
| `edited` | `boolean` | No |  |
| `facets` | `array` | No |  |
| `parent` | `string` (at-uri) | No |  |
| `channel` | `string` (at-uri) | Yes |  |
| `createdAt` | `string` (datetime) | No |  |
| `indexedAt` | `string` (datetime) | No |  |
| `attachments` | `array` | No |  |

### `social.colibri.sync.subscribeEvents#categoryEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `name` | `string` | No |  |
| `event` | `string` | Yes |  |
| `community` | `string` (at-uri) | Yes |  |
| `channelOrder` | `array` | No |  |

### `social.colibri.sync.subscribeEvents#reactionEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `emoji` | `string` | Yes |  |
| `event` | `string` | Yes |  |
| `target` | `string` (at-uri) | Yes |  |
| `channel` | `string` (at-uri) | Yes |  |

### `social.colibri.sync.subscribeEvents#communityEventData`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `name` | `string` | No |  |
| `event` | `string` | Yes |  |
| `picture` | `blob` | No |  |
| `description` | `string` | No |  |
| `categoryOrder` | `array` | No |  |

## Raw Schema

```json
{
  "id": "social.colibri.sync.subscribeEvents",
  "defs": {
    "ack": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "ack"
        }
      },
      "description": "Sent in response to a heartbeat message."
    },
    "main": {
      "type": "subscription",
      "errors": [
        {
          "name": "AuthRequired"
        }
      ],
      "message": {
        "schema": {
          "refs": [
            "lex:social.colibri.sync.subscribeEvents#ack",
            "lex:social.colibri.sync.subscribeEvents#communityEvent",
            "lex:social.colibri.sync.subscribeEvents#memberEvent",
            "lex:social.colibri.sync.subscribeEvents#categoryEvent",
            "lex:social.colibri.sync.subscribeEvents#channelEvent",
            "lex:social.colibri.sync.subscribeEvents#messageEvent",
            "lex:social.colibri.sync.subscribeEvents#reactionEvent",
            "lex:social.colibri.sync.subscribeEvents#userEvent",
            "lex:social.colibri.sync.subscribeEvents#typingEvent"
          ],
          "type": "union"
        }
      },
      "description": "Opens a WebSocket stream that transmits relevant events for the authenticated user."
    },
    "userEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#userEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "user_event"
        }
      },
      "description": "Sent when a known user has updated their profile or Colibri status."
    },
    "userStatus": {
      "type": "object",
      "required": [
        "state",
        "text"
      ],
      "properties": {
        "text": {
          "type": "string"
        },
        "emoji": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "knownValues": [
            "online",
            "away",
            "dnd",
            "offline"
          ]
        }
      }
    },
    "memberEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#memberEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "member_event"
        }
      },
      "description": "Sent when a member has joined or left a community."
    },
    "typingEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#typingEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "typing_event"
        }
      },
      "description": "Sent when a user is typing in a channel the client is viewing."
    },
    "userProfile": {
      "type": "object",
      "required": [
        "handle"
      ],
      "properties": {
        "avatar": {
          "type": "blob"
        },
        "banner": {
          "type": "blob"
        },
        "handle": {
          "type": "string",
          "format": "handle"
        },
        "description": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        }
      }
    },
    "channelEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#channelEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "channel_event"
        }
      },
      "description": "Sent when a channel has been created, updated, or deleted."
    },
    "messageEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#messageEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "message_event"
        }
      },
      "description": "Sent when a message has been sent, edited, or deleted."
    },
    "categoryEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#categoryEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "category_event"
        }
      },
      "description": "Sent when a category has been created, updated, or deleted."
    },
    "reactionEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#reactionEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "reaction_event"
        }
      },
      "description": "Sent when a reaction has been added to or removed from a message."
    },
    "userEventData": {
      "type": "object",
      "required": [
        "did",
        "profile"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        },
        "status": {
          "ref": "lex:social.colibri.sync.subscribeEvents#userStatus",
          "type": "ref"
        },
        "profile": {
          "ref": "lex:social.colibri.sync.subscribeEvents#userProfile",
          "type": "ref"
        }
      }
    },
    "communityEvent": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "properties": {
        "data": {
          "ref": "lex:social.colibri.sync.subscribeEvents#communityEventData",
          "type": "ref"
        },
        "type": {
          "type": "string",
          "const": "community_event"
        }
      },
      "description": "Sent when a community has been updated or deleted."
    },
    "memberEventData": {
      "type": "object",
      "required": [
        "event",
        "community",
        "membership"
      ],
      "properties": {
        "event": {
          "type": "string",
          "knownValues": [
            "join",
            "leave"
          ]
        },
        "community": {
          "type": "string",
          "format": "at-uri"
        },
        "membership": {
          "type": "string",
          "format": "at-uri"
        }
      }
    },
    "typingEventData": {
      "type": "object",
      "required": [
        "event",
        "channel",
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        },
        "event": {
          "type": "string",
          "knownValues": [
            "start",
            "stop"
          ]
        },
        "channel": {
          "type": "string",
          "format": "at-uri"
        }
      }
    },
    "channelEventData": {
      "type": "object",
      "required": [
        "event",
        "uri",
        "community"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "event": {
          "type": "string",
          "knownValues": [
            "upsert",
            "delete"
          ]
        },
        "community": {
          "type": "string",
          "format": "at-uri"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "messageEventData": {
      "type": "object",
      "required": [
        "event",
        "uri",
        "channel"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "text": {
          "type": "string"
        },
        "event": {
          "type": "string",
          "knownValues": [
            "upsert",
            "delete"
          ]
        },
        "edited": {
          "type": "boolean"
        },
        "facets": {
          "type": "array",
          "items": {
            "ref": "lex:social.colibri.richtext.facet",
            "type": "ref"
          }
        },
        "parent": {
          "type": "string",
          "format": "at-uri"
        },
        "channel": {
          "type": "string",
          "format": "at-uri"
        },
        "createdAt": {
          "type": "string",
          "format": "datetime"
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        },
        "attachments": {
          "type": "array",
          "items": {
            "type": "blob"
          }
        }
      }
    },
    "categoryEventData": {
      "type": "object",
      "required": [
        "event",
        "uri",
        "community"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "name": {
          "type": "string"
        },
        "event": {
          "type": "string",
          "knownValues": [
            "upsert",
            "delete"
          ]
        },
        "community": {
          "type": "string",
          "format": "at-uri"
        },
        "channelOrder": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "reactionEventData": {
      "type": "object",
      "required": [
        "event",
        "uri",
        "emoji",
        "target",
        "channel"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "emoji": {
          "type": "string"
        },
        "event": {
          "type": "string",
          "knownValues": [
            "added",
            "removed"
          ]
        },
        "target": {
          "type": "string",
          "format": "at-uri"
        },
        "channel": {
          "type": "string",
          "format": "at-uri"
        }
      }
    },
    "communityEventData": {
      "type": "object",
      "required": [
        "event",
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "name": {
          "type": "string"
        },
        "event": {
          "type": "string",
          "knownValues": [
            "upsert",
            "delete"
          ]
        },
        "picture": {
          "type": "blob"
        },
        "description": {
          "type": "string"
        },
        "categoryOrder": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
