Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(api): document kind on webhook message payloads
Yudhi Armyndharis9e83c0f60952
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.mdindex 144c54393..9811de754 100644--- a/docs/06-api-specification.md+++ b/docs/06-api-specification.md@@ -4868,7 +4868,7 @@ These are the events OpenWA actually emits. A webhook is registered with an `eve| Event | When it fires | `data` payload sketch || --- | --- | --- |-| `message.received` | An inbound message arrives | The full message object: `id`, `from`, `to`, `body`, `type`, `timestamp` (epoch **seconds**), `isGroup`, `hasMedia`, `contact{…}` (plus optional `senderPhone` for `@lid` senders) |+| `message.received` | An inbound message arrives | The full message object: `id`, `from`, `to`, `body`, `type`, `timestamp` (epoch **seconds**), `isGroup`, `kind` (user-facing chat discriminator of `chatId` — `individual\|group\|channel\|status\|broadcast\|unknown`), `hasMedia`, `contact{…}` (plus optional `senderPhone` for `@lid` senders) || `message.sent` | An outbound message is created/sent from this session | Same message object shape as `message.received` || `message.ack` | A delivery/read receipt updates an outbound message | `{ id, messageId, status, ack }` — `status` is the canonical state (`pending`/`sent`/`delivered`/`read`/`failed`); `ack` is the deprecated legacy integer derived from it || `message.failed` | A receipt resolves to `failed` (dispatched in addition to `message.ack`) | `{ id, messageId, status: "failed", ack: -1 }` |diff --git a/src/modules/session/dto/chat-summary.dto.ts b/src/modules/session/dto/chat-summary.dto.tsindex 575c2a26e..506c73277 100644--- a/src/modules/session/dto/chat-summary.dto.ts+++ b/src/modules/session/dto/chat-summary.dto.ts@@ -1,4 +1,4 @@-import { ApiProperty } from '@nestjs/swagger';+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';import type { ChatKind } from '../../../engine/identity/wa-id';const CHAT_KINDS: ChatKind[] = ['individual', 'group', 'channel', 'status', 'broadcast', 'unknown'];@@ -23,6 +23,6 @@ export class ChatSummaryDto {@ApiProperty({ description: 'Unix seconds of the last activity.', example: 1700000010 })timestamp!: number;- @ApiProperty({ required: false, example: 'hi' })+ @ApiPropertyOptional({ example: 'hi' })lastMessage?: string;}