---
title: "Get message history"
method: POST
path: "/report/"
tags: ["Messages"]
---

# Get message history

`POST /report/`

## Request

- Base URL: `https://wbiztool.com/api/v1`
- URL: `https://wbiztool.com/api/v1/report/`
- Auth: none required

Messages in the workspace created in a date range (from `start_date` 00:00 IST up to, not including, `end_date`), 200 per page, oldest first, whatever sent them (API, dashboard, campaigns). `status` is always `0`: success is `message: Success` with `total`. `Success` without `total` means the `whatsapp_client` ID is not in the workspace. Pagination needs a JSON body with `page` as a number. The JSON body is served with `Content-Type: text/html`; parse it as JSON whatever the header says.

## Request body

- MessageHistoryRequest: Your API credentials, sent in the request body (JSON or form fields) of every request that uses them. Both come from Settings → API keys in the dashboard. The API key decides which workspace the request acts on.
  - `client_id` integer, required: Your API Client ID from Settings → API keys.
  - `api_key` string, required: One of your API keys from the same page. Keep it secret.
  - `start_date` string, required: First day, `DD-MM-YYYY` (midnight IST).
  - `end_date` string, required: End of the range, `DD-MM-YYYY`. This day itself is not included.
  - `whatsapp_client` integer: ID of the WhatsApp number (or Telegram account) to send from, shown as "ID …" on the number's card on WhatsApp numbers in the dashboard.
  - `page` integer: 200 messages per page. Only works as a JSON number; as a form field or string the response has `total` but an empty `history`.

## Response `200`

History, or an error with `status: 0` and an empty `history` (`Error` for missing or badly formatted dates, an invalid JSON body or a non-POST request; `Auth Error`; `Demo Account can not access apis`).

- MessageHistory
  - `message` string, required: `Success` (with `total`) when the request worked.
  - `status` 0, required: Always `0`, even on success.
  - `total` integer: Messages in the range across all pages. Only on success.
  - `history` object[], required
    - `id` integer
    - `msg_type` 'Text' | 'Image' | 'File'
    - `contact` string
    - `message_status` 'Pending' | 'Sent' | 'Delivered' | 'Read' | 'Failed' | 'Cancelled' | 'Expired': `Delivered` and `Read` are reserved and not currently recorded.

## Other responses

- `400`: Invalid API key.
- `403`: `client_id` is not a whole number.

---

[API](https://skmtc.dev/wbiztool/apis/wbiztool-api.md) · [All operations](https://skmtc.dev/wbiztool/apis/wbiztool-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wbiztool/apis/wbiztool-api/revisions/bc7380bb5684?raw)
