Guides/For developers

Importing existing WhatsApp conversation history into our own CRM

History endpoints: list conversations and past messages (direction, wamid, timestamps, type, text, attachments) with pagination — backfill once, then go real-time via webhooks. 3 min read

Webhooks only deliver what happens after you turn them on. If your CRM needs the conversations that already exist, use these two read-only endpoints with the same API key. Recommended pattern: backfill once, then hand over to webhooks for real-time.

1. List conversations

curl "https://waco.id/api/v1/percakapan?halaman=1" \
  -H "Authorization: Bearer waco_YOUR_KEY"
{
  "halaman": 1, "per_halaman": 25, "ada_lagi": true,
  "nomor_bisnis": "628158825011",
  "percakapan": [
    { "id": 812, "nomor": "628111222333", "nama": "Budi", "nomor_bisnis": "628158825011",
      "status": "selesai", "dibuat": "2026-08-13T05:20:00.000Z",
      "aktivitas_terakhir": "2026-08-14T02:11:00.000Z", "pesan_terakhir": "Thank you" }
  ]
}

Newest first, 25 per page; increase halaman (page) while ada_lagi (has more) is true. Optional: nomor=628… for a single customer, and dari=628… if you run more than one business number (otherwise the first number is used). Field names are Indonesian, matching the webhook: nomor = customer number, nomor_bisnis = your number, status is one of terbuka (open), menunggu (pending), ditunda (snoozed), selesai (resolved).

2. Messages in one conversation

curl "https://waco.id/api/v1/percakapan/812/pesan" \
  -H "Authorization: Bearer waco_YOUR_KEY"
{
  "percakapan": { "id": 812, "nomor": "628111222333", "...": "..." },
  "ada_lagi": true, "sebelum_berikutnya": 40311,
  "pesan": [
    { "id": 40311, "wamid": "wamid.HBgL…", "arah": "masuk", "waktu": "2026-08-13T05:20:00.000Z",
      "tipe": "text", "teks": "Hello, I would like to register", "status": null,
      "pengirim": { "jenis": "pelanggan", "nama": "Budi" }, "privat": false, "lampiran": [] },
    { "id": 40312, "wamid": "wamid.HBgM…", "arah": "keluar", "waktu": "2026-08-13T05:21:30.000Z",
      "tipe": "image", "teks": "Here is the brochure", "status": "read",
      "pengirim": { "jenis": "tim", "nama": "Ani" }, "privat": false,
      "lampiran": [ { "id": 77, "jenis": "image", "url": "https://…/brochure.jpg", "ekstensi": "jpg", "ukuran": 182331 } ] }
  ]
}
Limit: 120 requests per minute per API key. For thousands of conversations, run the backfill sequentially with a small delay — not in parallel — and persist the last halaman so you can resume if interrupted.
  1. Turn on the webhook first and note the start time.
  2. Pull conversations page by page; for each one, pull messages backwards until exhausted.
  3. Use wamid as the unique key; webhook events arriving during the backfill will carry the same wamid and can simply be ignored.

The full contract is in the OpenAPI spec.

Still stuck after following this guide? Contact us from the dashboard — attach a screenshot if you have one, it speeds everything up.