---
title: "POST /connections/{phoneNumber}/chat-modify"
method: POST
path: "/connections/{phoneNumber}/chat-modify"
tags: ["Connections"]
---

# POST /connections/{phoneNumber}/chat-modify

`POST /connections/{phoneNumber}/chat-modify`

Currently only supports marking chats as read/unread with `markRead` + `lastMessages`.

## Path parameters

- `phoneNumber` string, required

## Request body

- object
  - `mod` object, required
    - `markRead` boolean, required
    - `lastMessages` object[], required
      - `key` object, required
        - `id` string
        - `remoteJid` string
        - `fromMe` boolean
        - `participant` string
      - `messageTimestamp` number, required
  - `jid` string, required — WhatsApp JID

## Response `200`

Chat modification was successfully applied

## Other responses

- `403` — Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key.
- `421` — Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).

---

[API](https://skmtc.net/fazer-ai/apis/fazer-ai-baileys-api.md) · [All operations](https://skmtc.net/fazer-ai/apis/fazer-ai-baileys-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fazer-ai/fazer-ai-baileys-api/revisions/533b3360e2e4/schema)
