ChatWidgetSession
Stored in the chatwidgetsessions collection. createdAt and updatedAt are maintained automatically.
Returned by GET /chat-widget/:id/sessions, PUT /chat-widget/session/:sessionId/intercept.
| Field | Type | Notes |
|---|---|---|
company | ObjectId -> Company | required |
widget | ObjectId -> ChatWidget | required |
contact | ObjectId -> Contact | required |
status | string | default active · one of active, closed |
handover.status | string | default pending · one of pending, done |
handover.at | date | |
handover.by | ObjectId -> Member | |
handover.reason | string | one of immediate, delay, manual |
handover.dueAt | date | |
botRestartedAt | date | |
historyFrom | date | default null |
visitor.ip | string | |
visitor.userAgent | string | |
visitor.pageUrl | string | |
visitor.referrer | string | |
visitor.utmSource | string | |
visitor.utmMedium | string | |
visitor.utmCampaign | string | |
visitor.utmTerm | string | |
visitor.utmContent | string | |
lastVisitorMessageAt | date | |
lastAgentMessageAt | date | |
startedAt | date | default now |
lastSeenAt | date | default now |
visits | number | default 0 |
_id | ObjectId | default "6a95712f932657988a91c075" |
createdAt | date | set once |
updatedAt | date |