WhatsApp API & Developers

WhatsApp API Chat History: Can an API Read Past Chats?

You connect WhatsApp to your CRM, the integration works, and the first question from the sales team is: where are all our old chats? Three years of customer conversations live on the front-desk phone, and the new system starts at zero.

Whether an API can give you WhatsApp chat history depends on which API, and on how you moved the number. Meta's Cloud API has no way to fetch past messages at all. Coexistence onboarding can bring over up to six months of one-to-one chats, once. Linked-device APIs receive the recent history your phone sends to any newly linked device, groups included.

This post explains each path, what it brings over, and what you have to store yourself from day one.

Cloud API: no history endpoint, only what you store

The Cloud API sends messages and delivers webhooks. It has no endpoint to list or fetch past conversations.

Meta's Message API reference documents one operation on a phone number's messages: POST /PHONE_NUMBER_ID/messages, to send. There's no GET for a conversation, no search and no export. Inbound messages reach you once, as a webhook. Outbound messages are whatever your code sent. If your system didn't save something when it happened, you can't ask Meta for it later through the API.

That makes storage a day-one job, not a nice-to-have:

  • Persist every inbound webhook before doing anything else with it, ideally the raw payload alongside the fields you parse.
  • Key messages on the WhatsApp message ID (wamid...), so retries and duplicate deliveries don't create duplicate rows.
  • Record status updates (sent, delivered, read, failed) against the message they refer to.
  • Download media when it arrives. Meta's media docs say media IDs in webhooks expire after 7 days and each download URL after 5 minutes, so store the files yourself.
  • Don't assume a phone number. With usernames rolling out through 2026, webhooks can carry a business-scoped user ID without the phone number, so store both identifiers when you get them.

A minimal Flask receiver that stores inbound messages looks like this (verification handshake and signature checks omitted for brevity; never skip them in production):

import json
import sqlite3
from flask import Flask, request

app = Flask(__name__)
db = sqlite3.connect("whatsapp.db", check_same_thread=False)
db.execute("""create table if not exists messages (
  wamid text primary key, sender text, type text,
  body text, ts integer, raw text)""")

@app.post("/webhook")
def webhook():
    payload = request.get_json(force=True)
    for entry in payload.get("entry", []):
        for change in entry.get("changes", []):
            for m in change.get("value", {}).get("messages", []):
                body = (m.get("text") or {}).get("body")
                db.execute(
                    "insert or ignore into messages values (?, ?, ?, ?, ?, ?)",
                    (m["id"], m.get("from"), m["type"], body,
                     int(m["timestamp"]), json.dumps(m)),
                )
    db.commit()
    return "", 200

For the full receiving side, including the verify request and replies, see our guide to receiving WhatsApp messages by API.

Full migration: the old chats stay behind

Moving a number onto the Cloud API the standard way means deleting its WhatsApp account first, and Meta says the existing messaging history is lost.

Meta's migration guide for numbers already on the WhatsApp Business app is blunt: delete the account in the app (Settings, then Account, then Delete my account), wait a few minutes for the number to free up, then register it on the Cloud API. It tells you to back up your chat history from the app first, because the history won't come with you. A phone backup lets you keep the old chats on a phone; it doesn't put them into your API system.

If you're planning that move, our guide to migrating a WhatsApp number to the API covers the steps and the downtime.

Coexistence: up to six months of one-to-one history, once

Onboard a WhatsApp Business app number with coexistence, and Meta can sync one-to-one chats from the last six months, if the business agrees.

From Meta's Business app onboarding docs, as of October 2026:

  • Window: messages from up to 180 days before onboarding can be synchronized.
  • Consent: sharing history is optional. If the business declines, you get a history webhook with an error instead.
  • Groups are excluded. Group chats are not synchronized.
  • Delivery: history arrives through history webhooks in phases (the first day, then up to 90 days, then up to 180), in chunks that can arrive out of order, so sequence them with chunk_order and treat a progress of 100 as done.
  • Media: media asset IDs are only included for media from the last 14 days.
  • Afterwards: messages the business sends from the app keep flowing to you as smb_message_echoes webhooks, so your system sees both sides.

Coexistence is the only official path that brings existing chat history into an API system. Our guide to WhatsApp coexistence covers its other limits.

Linked devices: recent history at pairing, groups included

When a new device links to an account, the phone sends it an encrypted bundle of recent chats. Linked-number APIs receive that bundle like any other companion device.

This is how WhatsApp Web shows your recent chats a minute after you scan the QR code. Meta's engineering team described the mechanism when it launched multi-device in 2021: the phone encrypts a bundle of messages from recent chats, transfers it to the new device, and the device stores it locally. Because the account is a member of its groups, group conversations come over too.

Two caveats. "Recent" is WhatsApp's call, not yours: older messages may remain on the phone only, and no tool can pull more than WhatsApp sends. And the sync happens at link time; after that, history only grows while the device stays connected.

The paths side by side

PathPast one-to-one chatsPast group chatsHow far backAfter setup
Cloud API, new number or full migrationNoneNot applicableNothing before registrationWebhooks you must store
Cloud API with coexistenceOptional syncNot syncedUp to 6 monthsWebhooks plus app echoes
Linked-number APIRecent history at linkYesWhatever WhatsApp sends a new deviceLive sync while connected
Manual chat export from the phoneOne chat at a timeOne chat at a timeWhat's on the phoneNot ongoing

Whichever path you take, the history you import is personal data. Our guide to WhatsApp API data privacy covers retention and deletion duties.

Where Tenashi fits

When you link a number to Tenashi by QR scan, it imports the recent history WhatsApp sends to a newly linked device, DMs and groups, into your shared inbox. Your team starts with context instead of an empty screen: who the customer is, what they ordered, what was promised. History imports deliberately don't fire webhooks, so your automations and integrations don't replay months of old messages as if they were new. From then on, every message, including ones typed on the phone, is kept on each contact's timeline even after a teammate leaves.

The honest limits: Tenashi can't import more than WhatsApp sends to a new device, and its API is built for the present, not for bulk export. You can list chats with GET /api/v1/conversations and fetch any message by ID with GET /api/v1/messages/:id; reading a full thread happens in the inbox.

See every feature · Get started

FAQ

Can the WhatsApp Cloud API retrieve old messages?

No. Meta's Message API documents sending only, with no endpoint to list or fetch past messages. Inbound messages arrive once by webhook, so you must store them as they come. The one official route to earlier chats is coexistence onboarding, which can sync up to six months of one-to-one history from the WhatsApp Business app.

How much history does WhatsApp coexistence sync?

Up to six months, or 180 days before onboarding, of one-to-one chats, if the business chooses to share it during onboarding. Group chats are not synced, and media asset IDs come only for media from the last 14 days. History arrives in phased webhook chunks that can arrive out of order, per Meta's docs.

Do group chats sync with the WhatsApp API?

Not on the official platform. Coexistence history sync excludes group chats, and the Cloud API can't read groups a number was already in. Linked-device APIs do receive group history, because the account they connect to is a member of those groups and WhatsApp includes them in the recent history it sends.

Will I lose my chats if I move my number to the API?

With a standard migration, yes: you delete the WhatsApp account before registering on the Cloud API, and Meta says existing messaging history is lost, so back it up first. Coexistence keeps the Business app working and can sync six months of one-to-one chats. Linked-number tools leave your chats where they are.

Can a linked-device tool read my entire chat history?

Usually not all of it. A newly linked device receives the recent history the phone chooses to send, and older messages may stay only on the phone. From the moment of linking, though, the tool sees everything new in DMs and groups, which is why choosing a provider you trust with that data matters.


No WhatsApp API hands you years of past chats on request; at best you get a one-time sync, so the real job is storing everything from now on. If you'd rather start with your recent DMs and groups already in a shared inbox, get started with Tenashi. For every other path, see our complete guide to the WhatsApp API.