> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trychert.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mark a chat as read

> POST /api/v1/chats/:id/mark-read - clear unread inbound messages and send a read receipt.

<Note>
  **Auth.** HMAC v1 or bearer token - see [Authentication](/api/authentication).
  **Status.** Live · **Idempotent:** Yes (re-marking an already-read chat is a no-op).
</Note>

Mark unread inbound messages in a chat as read and send a read receipt from the chat's line. The request has no body.

<Note>
  Use this when an operator opens a conversation, or after your agent finishes handling inbound messages.
</Note>

## Request

`POST /api/v1/chats/{id}/mark-read`

No request body.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://console.trychert.com/api/v1/chats/$CHAT_ID/mark-read \
    -H "x-chert-tenant: $TENANT" \
    -H "x-chert-signature: v1,$TS,$SIG" \
    -H "content-type: application/json"
  ```

  ```js Node.js theme={null}
  const ts = Math.floor(Date.now() / 1000)
  const sig = crypto.createHmac("sha256", SIGNING_SECRET).update(`${ts}.`).digest("hex")
  const res = await fetch(
    `https://console.trychert.com/api/v1/chats/${chatId}/mark-read`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "x-chert-tenant": TENANT_SLUG,
        "x-chert-signature": `v1,${ts},${sig}`,
      },
    },
  )
  ```

  ```python Python theme={null}
  import hmac, hashlib, time, requests
  ts = int(time.time())
  sig = hmac.new(SIGNING_SECRET.encode(), f"{ts}.".encode(), hashlib.sha256).hexdigest()
  r = requests.post(
      f"https://console.trychert.com/api/v1/chats/{chat_id}/mark-read",
      headers={
          "Content-Type": "application/json",
          "x-chert-tenant": TENANT_SLUG,
          "x-chert-signature": f"v1,{ts},{sig}",
      },
  )
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "chat_id": "0f2d3c1a-8b4e-4f6a-90d2-1a3b4c5d6e7f",
    "status": "read"
  }
  ```
</ResponseExample>

### Path parameters

<ParamField path="id" type="string" required>
  The Chert `chat_id` of the chat to mark as read.
</ParamField>

### Response fields

<ResponseField name="chat_id" type="string">
  Echoed-back `chat_id`.
</ResponseField>

<ResponseField name="status" type="string">
  Always `"read"` on success.
</ResponseField>

## Errors

| Code   | HTTP | When                                           |
| ------ | ---- | ---------------------------------------------- |
| `2002` | 404  | Chat not found, or not owned by this tenant.   |
| `1002` | 422  | Chat has no resolvable recipient.              |
| `4001` | 502  | Delivery failed downstream.                    |
| `4099` | 501  | Mark-read is not available on this phone line. |

See the full [error code reference](/api/errors).

## Notes

| Behavior                | What it means                                                                          |
| ----------------------- | -------------------------------------------------------------------------------------- |
| Pinned line required    | The receipt is emitted from the same line the chat is pinned to.                       |
| Existing chats only     | Create or receive a chat first, then mark-read.                                        |
| Read receipt visibility | The recipient only sees a receipt when read receipts are enabled for the conversation. |

## See also

* [List messages in a chat](/api/chats/list-messages)
* [Typing indicators](/api/chats/typing)
* [Get a chat](/api/chats/create)
