Skip to main content

BizOSaaS 360-Degree CRM & Omnichannel API Specification

Version: 2.0 | Status: Production Ready | Module: CRM Omnichannel Core


1. Omnichannel Contact Identity Schema

Contacts store cross-channel identifiers and preference metadata:

export interface Contact360 {
id: string;
email: string;
phone?: string;
whatsappPhone?: string; // WhatsApp Business Cloud API number
instagramHandle?: string; // @handle
facebookPsid?: string; // Facebook Page-Scoped User ID
telegramId?: string; // Telegram chat_id
linkedinUrl?: string;
twitterHandle?: string;
preferredChannel?: 'whatsapp' | 'email' | 'instagram' | 'telegram';
language?: string; // ISO 639-1 code e.g. 'en', 'hi'
timezone?: string; // IANA e.g. 'Asia/Kolkata'
tags: string[]; // ['advocate', 'vip', 'lead', 'review-left']
leadScore: number;
}

2. API Endpoints

POST /api/crm/broadcast/whatsapp

Drafts a targeted WhatsApp broadcast campaign for a segment or audience.

Request Body

{
"segmentId": "uuid-optional",
"messageTemplate": "Hi {{firstName}}! Special festival offer inside...",
"scheduledAt": "2026-09-01T10:00:00Z"
}

Response (200 OK)

{
"success": true,
"campaignId": "wa_bcast_1787638000",
"targetCount": 142,
"status": "HITL_APPROVAL_PENDING",
"message": "WhatsApp broadcast campaign drafted for 142 contacts. Pending HITL approval in Task Manager."
}

3. Lead Score Recalculation Signals

The CrmAgent automatically adjusts lead scores based on cross-channel engagements:

  • WhatsApp Reply: +5 points
  • Form Submission: +15 points
  • 4-5 Star Google Review Left: +20 points (plus auto-tag #advocate)
  • Deal Stage Won: +50 points
  • Unsubscribed: -30 points