Skip to content

Feature: Expose WhatsApp message history API from gateway #345

@erikpr1994

Description

@erikpr1994

Problem

Currently, to search/query WhatsApp message history, you need to use wacli which maintains a separate database from Clawdbot. This means:

  1. Two separate WhatsApp connections (Clawdbot + wacli)
  2. Two separate databases that don't sync
  3. wacli sync is slow and needs to run periodically
  4. Messages received by Clawdbot don't appear in wacli until sync

Use Case

Building a CRM/contact tracker that:

  • Tracks last contact date with important people
  • Summarizes recent conversations
  • Alerts when you haven't talked to someone in X days

Currently requires wacli for history, but wacli is always behind real-time.

Proposed Solution

Expose an API from the Clawdbot gateway to query message history:

// Example API
gateway.whatsapp.messages.list({
  chat: "34612345678@s.whatsapp.net",
  limit: 20,
  after: "2026-01-01"
})

Or a CLI command:

clawdbot whatsapp messages --chat "+34612345678" --limit 20

Benefits

  • Single source of truth for WhatsApp data
  • Real-time access to message history
  • No need for separate wacli sync
  • Simpler architecture for agents building on Clawdbot

Workaround

For now, using wacli with periodic sync, but it's not ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions