Domain Model
Message
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string.uuid | Yes | — | Id |
| createdAt | string.date-time | Yes | — | Created at |
| updatedAt | string.date-time | Yes | — | Updated at |
| conversationId | string | Yes | — | ID of the associated conversation |
| direction | enum(inbound, outbound, system) | Yes | — | Direction |
| provider | enum(telegram, whatsapp, discord, slack, microsoft_teams, ai_agent, email) | Yes | — | Provider |
| externalMessageId | string | No | — | ID of the associated external message |
| senderExternalId | string | No | — | ID of the associated sender external |
| senderDisplayName | string | No | — | Sender display name |
| bodyText | string | No | — | Body text |
| bodyRichJson | unknown | No | — | Body rich json |
| attachmentRefsJson | unknown | No | — | Attachment refs json |
| messageType | string | Yes | — | Message type |
| sentAt | string.date-time | No | — | Sent at |
| receivedAt | string.date-time | No | — | Received at |
| deliveryStatus | enum(pending, sent, delivered, read, failed) | Yes | — | Delivery status |
| metadataJson | object | No | — | Metadata json |
| relevanceStatus | enum(auto_relevant, confirmed, excluded) | No | — | Relevance status |
| relevanceNote | string | No | — | Relevance note |
Create Schema
Fields accepted when creating a new record:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| conversationId | string | Yes | — | ID of the associated conversation |
| direction | enum(inbound, outbound, system) | Yes | — | Direction |
| provider | enum(telegram, whatsapp, discord, slack, microsoft_teams, ai_agent, email) | Yes | — | Provider |
| externalMessageId | string | No | — | ID of the associated external message |
| senderExternalId | string | No | — | ID of the associated sender external |
| senderDisplayName | string | No | — | Sender display name |
| bodyText | string | No | — | Body text |
| bodyRichJson | unknown | No | — | Body rich json |
| attachmentRefsJson | unknown | No | — | Attachment refs json |
| messageType | string | Yes | "text" | Message type |
| sentAt | string.date-time | No | — | Sent at |
| receivedAt | string.date-time | No | — | Received at |
| deliveryStatus | enum(pending, sent, delivered, read, failed) | Yes | "pending" | Delivery status |
| metadataJson | object | No | — | Metadata json |
| relevanceStatus | enum(auto_relevant, confirmed, excluded) | No | — | Relevance status |
| relevanceNote | string | No | — | Relevance note |
Update Schema
All fields are optional when updating:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| externalMessageId | string | No | — | ID of the associated external message |
| senderExternalId | string | No | — | ID of the associated sender external |
| senderDisplayName | string | No | — | Sender display name |
| bodyText | string | No | — | Body text |
| bodyRichJson | unknown | No | — | Body rich json |
| attachmentRefsJson | unknown | No | — | Attachment refs json |
| messageType | string | No | "text" | Message type |
| sentAt | string.date-time | No | — | Sent at |
| receivedAt | string.date-time | No | — | Received at |
| deliveryStatus | enum(pending, sent, delivered, read, failed) | No | "pending" | Delivery status |
| metadataJson | object | No | — | Metadata json |
| relevanceStatus | enum(auto_relevant, confirmed, excluded) | No | — | Relevance status |
| relevanceNote | string | No | — | Relevance note |