WhatsApp API Platform
Chat actions

Mark Chat As Read

POST
/api/v1/messages/read

Mark every unread inbound message in a recipient's chat as read, and reset the conversation's unread counter.

Use it when your own interface has shown the messages to a human, so the dashboard's unread badge agrees with what your agents have actually seen.

Returns the chat's total message count, which is the size of the history now available.

read_receipt reports separately whether WhatsApp was told — the local unread state is always updated, but the blue ticks on the recipient's handset need an inbound message inside the last 24 hours to attach to.

Authorization

ApiKeyAuth
X-API-Key<token>

API key from your dashboard (Settings > API Keys)

In: header

Header Parameters

X-AGENT-ID?string

Optional. Attribute this send to a specific agent, overriding the agent bound to the API key. The agent must belong to your account and be active (role AGENT, parent = your account) — otherwise the request returns 400. Drives customer assignment, agent allotment limits, and the wallet ledger entry.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

to*string

Recipient phone number with country code.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/messages/read" \  -H "X-AGENT-ID: agt_abc123" \  -H "Content-Type: application/json" \  -d '{    "to": "919876543210"  }'
{
  "success": true,
  "data": {
    "message_count": 42,
    "read_receipt": {
      "sent": true,
      "reason": "sent"
    }
  }
}
{
  "success": false,
  "message": "to field is required"
}
{
  "success": false,
  "message": "user not authenticated"
}
{
  "success": false,
  "message": "No chat found for that number"
}
{
  "success": false,
  "message": "internal server error"
}

Issue an access token POST

OAuth 2.0 **client-credentials** token endpoint. Exchanges the API key you are already calling with for a bearer token that authenticates as the **same account** — use it to sign that account into the dashboard, or to call any endpoint that expects `Authorization: Bearer` instead of an API key. Your API key is the client credential, so there is nothing to send: the account is whichever one the `X-API-Key` header resolves to. An agent-scoped API key returns a token for the account that owns the agent. The body is optional. If you send one — as JSON or as `application/x-www-form-urlencoded`, both are accepted — `grant_type` must be `client_credentials`; any other value returns `400`. There is no authorization-code flow: this endpoint never issues a token for an account other than the caller's. `expires_in` is always `null`: **the token does not expire**, and no `refresh_token` is issued because there is nothing to refresh. Treat it as a long-lived credential and store it like a password. The only way to invalidate it is to block or deactivate the account. Because the token carries exactly the authority the API key already had, any active account can call this — there is no extra permission to hold.

Show Typing Indicator POST

Show a "typing…" indicator on the recipient's chat. Use it while your bot or agent composes a reply, so the wait reads as activity rather than silence. The indicator expires on its own after a few seconds, or as soon as your next message arrives — there is nothing to clear. Best-effort by design: a provider that declines still returns `200`, because a missing indicator should never fail the flow that was about to send a real message. The body's `sent` tells you whether it actually reached the recipient, and `reason` names the gate when it did not. Only an unrecognised `to` returns an error. **Requires a recipient who has messaged you within the last 24 hours.** WhatsApp only permits an indicator in reply to a recent inbound message: a number with no chat history returns `404`, and one whose last message has aged out returns `200` with `"reason": "no_recent_inbound_message"`.