Skip to content

CLM API

api

Freelance messaging backend development for WaTheta within a shared customer lifecycle management platform. Contributions span Meta webhooks, automation, routing, WhatsApp coexistence, and real-time conversation workflows.

Client: WaTheta · View client experience

Role
Freelance Developer
Scope
Messaging services and integrations, persistence, real-time conversation events, and automated tests
Status
Implemented contributions verified in repository history; production operation was not independently verified

Problem

Support teams need to receive and respond to conversations across WhatsApp, Messenger, and Instagram, route them to suitable agents, and preserve conversation state across asynchronous events and service restarts.

Constraints

  1. C1

    Work took place in an existing multi-tenant backend; the full platform is shared team work, not an individual implementation.

  2. C2

    External messaging providers have distinct event formats, registration flows, media lifetimes, and channel restrictions.

  3. C3

    The 28 May–10 June 2026 contribution window comes from 47 commits attributed to Montasim in the available clone, using UTC+6 author dates; it does not establish contractual start or end dates.

  4. C4

    The repository is private. Repository creation metadata describes the accessible copy created on 21 June 2026; its retained history begins on 16 November 2025.

  5. C5

    Tests were inspected as source evidence, not rerun against external messaging services; deployment and production performance were not verified.

Architecture

NestJS messaging modules separate application services, domain contracts, and MongoDB persistence. Queued webhook processing connects provider events to conversations, automation, and real-time updates.

01

Provider event processing

Meta webhook handlers normalize inbound events for WhatsApp, Messenger, and Instagram, with event-specific deduplication and validation.

02

Conversation workflows

Application services coordinate keyword automation, routing, quoted replies, agent assignment, and SLA timers.

03

Persistence and real-time delivery

MongoDB repositories retain coexistence bindings and conversation state. Redis and Socket.IO support presence, typing, and conversation events with access checks.

Decisions

D1

Persist coexistence state

Replaced process-local coexistence bindings with repository-backed storage and added history-sync lifecycle handling (7654f7bb7).

D2

Make routing fallbacks explicit

Added skill, department, and priority routing with fallback reasons and open-conversation counts for agents (6f91a3548).

D3

Check access before real-time actions

Added conversation access checks, error handling, and expiration behavior to WebSocket conversation handlers (725c59eb8).

D4

Deduplicate provider events

Added event-specific idempotency keys for Instagram comments and Messenger events to handle repeated webhook delivery (a972b9bdc).

Contribution

  • Implemented Meta messaging backend features and subsequent Instagram comment, Messenger postback, opt-in, referral, and reaction handling.
  • Connected keyword automation and automatic agent assignment to the inbound message pipeline.
  • Implemented durable WhatsApp coexistence bindings, signup completion, contact and history synchronization, and media lifecycle handling.
  • Added presence, typing, join, leave, mark-read, quoted-reply, and SLA timer workflows with access checks.
  • Added unit and end-to-end tests for coexistence, automation, routing, inbound events, and messaging flows.

Outcomes

  • Repository history contains 47 commits authored by Montasim between 28 May and 10 June 2026.
  • Messaging workflows gained persistent coexistence state, event deduplication, and explicit conversation-routing fallbacks.
  • Automated test sources cover provider event handling, real-time access checks, routing, and messaging integration paths; no production performance claim is inferred from those tests.

Verified stack

  • Meta Graph API
  • WhatsApp Cloud API
  • Messenger API
  • Instagram API
  • Meta Conversions API
  • TypeScript
  • NestJS
  • MongoDB
  • Mongoose
  • Redis
  • BullMQ
  • Socket.IO
  • Zod
  • Jest

Working through something similar?

Share your challenge, scope, and timeline to start a focused conversation.