# 获取 AI 助手会话记录 (/zh/api/analytics/assistant-conversations)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1745 · updated: 2026-07-30 -->
Related: [获取反馈](/zh/api/analytics/feedback.md), [获取 AI 助手调用方统计](/zh/api/analytics/assistant-caller-stats.md)

<div id="usage">
  ## 使用方法 [#使用方法]
</div>

使用此端点从你的文档中导出 AI 助手的会话历史。每个会话都包括用户查询、助手回复、引用的来源、解决状态以及查询类别。

使用响应中返回的 `cursor` 参数对结果进行分页。当 `hasMore` 为 `true` 时继续获取。

<div id="filtering">
  ## 筛选 [#筛选]
</div>

使用 `dateFrom` 和 `dateTo` 参数按日期范围过滤会话。

<div id="conversation-data">
  ## 会话数据 [#会话数据]
</div>

每个会话包含：

* **query**: 用户的问题
* **response**: AI 助手的回答
* **sources**: 回答中引用的页面，包括标题和 URL
* **resolutionStatus**: AI 助手是否成功回答了问题。值为 `answered` 或 `unanswered`。使用此字段可跟踪并分析 AI 助手无法解答的用户问题所暴露出的文档缺口。
* **queryCategory**: query 的类型分类（如果可用）
* **pageUrl**: 会话开始时所在文档页面的完整 URL；如果没有可用的页面路径，则为 `null`。使用此字段可将会话归因到具体页面。

<div id="rate-limits">
  ## 速率限制 [#速率限制]
</div>

此端点允许每个组织每小时最多 100 次请求。所有分析端点共享此限制。

`GET /v1/analytics/{projectId}/assistant`

返回分页后的 AI 助手会话历史

使用管理员 API 密钥进行身份验证。

## OpenAPI

```json
{
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "schema": {
        "type": "string",
        "description": "你的项目 ID，可在控制台的 [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) 页面中复制。"
      },
      "required": true,
      "name": "projectId",
      "in": "path"
    },
    {
      "schema": {
        "type": "string",
        "description": "ISO 8601 或 YYYY-MM-DD 格式的日期",
        "example": "2024-01-01"
      },
      "required": false,
      "name": "dateFrom",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "description": "ISO 8601 或 YYYY-MM-DD 格式的日期。`dateTo` 为不包含在内的上限。结果将包含早于该日期的记录，但不包含该日期当天的记录。",
        "example": "2024-01-01"
      },
      "required": false,
      "name": "dateTo",
      "in": "query"
    },
    {
      "schema": {
        "type": "number",
        "minimum": 1,
        "maximum": 1000,
        "default": 100,
        "description": "每页返回的最大结果数"
      },
      "required": false,
      "name": "limit",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "format": "ulid",
        "description": "分页游标（ULID 格式）"
      },
      "required": false,
      "name": "cursor",
      "in": "query"
    }
  ],
  "responses": {
    "200": {
      "description": "包含分页信息的会话数据",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "conversations": {
                "type": "array",
                "description": "AI 助手会话列表。",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "会话的唯一标识符。"
                    },
                    "timestamp": {
                      "type": "string",
                      "description": "会话发生时的时间戳。"
                    },
                    "query": {
                      "type": "string",
                      "description": "用户向 AI 助手提出的问题。"
                    },
                    "response": {
                      "type": "string",
                      "description": "AI 助手的回答。"
                    },
                    "sources": {
                      "type": "array",
                      "description": "在回答中被引用的文档页面。",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string",
                            "description": "被引用文档页面的标题。"
                          },
                          "url": {
                            "type": "string",
                            "description": "被引用文档页面的 URL。"
                          }
                        },
                        "required": [
                          "title",
                          "url"
                        ]
                      }
                    },
                    "queryCategory": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "会话自动分配的分类分组（如适用）。"
                    },
                    "pageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "会话开始时所在文档页面的完整 URL。如果没有捕获页面路径，则为 null。"
                    }
                  },
                  "required": [
                    "id",
                    "timestamp",
                    "query",
                    "response",
                    "sources",
                    "queryCategory",
                    "pageUrl"
                  ]
                }
              },
              "nextCursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "用于获取下一页结果的游标；如果没有更多结果则为 null。"
              },
              "hasMore": {
                "type": "boolean",
                "description": "指示在当前页之外是否还有更多可用结果。"
              }
            },
            "required": [
              "conversations",
              "nextCursor",
              "hasMore"
            ]
          }
        }
      }
    },
    "400": {
      "description": "无效的查询参数",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "描述错误原因的错误信息。"
              },
              "details": {
                "type": "array",
                "description": "关于该错误的其他详细信息。",
                "items": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "对某个特定校验或处理错误的说明。"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    },
    "500": {
      "description": "服务器错误",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "描述错误原因的错误信息。"
              },
              "details": {
                "type": "array",
                "description": "关于该错误的其他详细信息。",
                "items": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "对某个特定校验或处理错误的说明。"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  }
}
```
