Developer API

Export captured conversation messages as JSON or CSV.

Message Exports

Export Conversation Messages

An API key owner with Inbox Read access can export WhatsApp DM or group messages that Querygen has already captured for a specific time range. Personal WhatsApp Own Read limits exports to the owner’s registered phone numbers; Personal WhatsApp All Read includes other teammates’ connected WhatsApp conversations. Business accounts follow their own Read selections. This endpoint does not fetch older WhatsApp history that was never synced into Querygen.

Required date window

Both start and end are required ISO date-times with a timezone. The start is inclusive and the end is exclusive. Use Z for UTC or URL-encode offset plus signs as %2B.

Export DM messages

For DMs, pass both chat_id and user_phone from GET /api/v1/conversations?type=dm. The phone value keeps separate team members’ chats with the same contact from being mixed.

Complete DM export request
curl -X GET \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  "https://app.querygen.ai/api/v1/conversations/919876543210%40s.whatsapp.net/messages?type=dm&user_phone=919820160046&start=2026-06-25T00:00:00Z&end=2026-06-26T00:00:00Z"

Export group messages

For groups, use the group chat id returned by GET /api/v1/groups. The older group-specific route also works for compatibility.

Complete group export request
curl -X GET \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  "https://app.querygen.ai/api/v1/conversations/120363025555555555%40g.us/messages?type=group&start=2026-06-25T00:00:00Z&end=2026-06-26T00:00:00Z"
Complete legacy group export request
curl -X GET \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  "https://app.querygen.ai/api/v1/groups/120363025555555555%40g.us/messages?start=2026-06-25T00:00:00Z&end=2026-06-26T00:00:00Z"

Export CSV

Complete CSV export request
curl -X GET \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  "https://app.querygen.ai/api/v1/conversations/919876543210%40s.whatsapp.net/messages?type=dm&user_phone=919820160046&start=2026-06-25T00:00:00Z&end=2026-06-26T00:00:00Z&format=csv"

JSON response

Message export response
{
  "success": true,
  "data": [
    {
      "id": 101,
      "message_id": "wamid.101",
      "timestamp": "2026-06-25T09:00:00.000Z",
      "sender_name": "Customer One",
      "sender_phone": "919876543210",
      "message_text": "Need an invoice copy",
      "chat_id": "919876543210@s.whatsapp.net",
      "chat_name": "Customer One",
      "user_phone": "919820160046",
      "platform": "whatsapp",
      "is_edited": false,
      "is_deleted": false,
      "captured_at": "2026-06-25T09:00:02.000Z"
    }
  ],
  "total": 1,
  "pagination": {
    "limit": 1000,
    "offset": 0,
    "has_more": false,
    "next_offset": null
  }
}

Optional query parameters are format=json|csv, limit, offset, type=dm|group, and platform. Exports are limited to 60 requests per 15 minutes per organization and API key owner. CSV responses include X-Has-More and, when another page is available, X-Next-Offset.