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

# 清除未读消息

> 清除会话的未读消息计数

## 概述

清除指定会话的未读消息计数，将未读数量重置为 0。

## 请求体

<ParamField body="uid" type="string" required>
  用户 ID
</ParamField>

<ParamField body="channel_id" type="string" required>
  频道 ID
</ParamField>

<ParamField body="channel_type" type="integer" required>
  频道类型

  * `1` - 个人频道
  * `2` - 群组频道
</ParamField>

<ParamField body="message_seq" type="integer">
  消息序列号，指定清除到哪条消息为止
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "http://localhost:5001/conversations/clearUnread" \
    -H "Content-Type: application/json" \
    -d '{
      "uid": "user123",
      "channel_id": "group123",
      "channel_type": 2,
      "message_seq": 1001
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('http://localhost:5001/conversations/clearUnread', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      uid: 'user123',
      channel_id: 'group123',
      channel_type: 2,
      message_seq: 1001
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  data = {
      "uid": "user123",
      "channel_id": "group123",
      "channel_type": 2,
      "message_seq": 1001
  }

  response = requests.post('http://localhost:5001/conversations/clearUnread', json=data)
  result = response.json()
  print(result)
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      data := map[string]interface{}{
          "uid":          "user123",
          "channel_id":   "group123",
          "channel_type": 2,
          "message_seq":  1001,
      }
      
      jsonData, _ := json.Marshal(data)
      
      resp, err := http.Post(
          "http://localhost:5001/conversations/clearUnread",
          "application/json",
          bytes.NewBuffer(jsonData),
      )
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()
      
      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Printf("%+v\n", result)
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 成功响应 theme={null}
  {
    "status": "ok"
  }
  ```
</ResponseExample>

## 响应字段

<ResponseField name="status" type="string" required>
  操作状态，成功时返回 `"ok"`
</ResponseField>

## 状态码

| 状态码 | 说明       |
| --- | -------- |
| 200 | 未读消息清除成功 |
| 400 | 请求参数错误   |
| 403 | 没有操作权限   |
| 404 | 会话不存在    |
| 500 | 服务器内部错误  |
