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

# 列出线程事件

> 分页列出指定线程的完整事件历史，按创建时间升序返回。

<Accordion title="使用说明">

线程完整历史，data/next_page，按 created_at 升序。

</Accordion>



## OpenAPI

````yaml /openapi/openapi-managed-agents.json get /agent/managed/v1/sessions/{sessionId}/threads/{threadId}/events
openapi: 3.0.1
info:
  title: 智谱 AI Managed Agents API
  version: 1.0.0
  description: Agent、Environment、Session、File、Memory、Vault、Skill、Deployment 接口。
  contact:
    name: Z.AI 开发者
    url: https://chat.z.ai/legal-agreement/privacy-policy
    email: user_feedback@z.ai
servers:
  - url: https://open.bigmodel.cn/api/
    description: 开放平台服务
security:
  - bearerAuth: []
tags:
  - name: Managed Agents - Agent
    description: Agent 与版本管理。
    x-group: Agent
  - name: Managed Agents - Environment
    description: 声明式执行环境管理。
    x-group: Environment
  - name: Managed Agents - Session
    description: Session、Resource 与事件流。
    x-group: Session
  - name: Managed Agents - File
    description: Managed Files 上传、读取与删除。
    x-group: File
  - name: Managed Agents - Memory
    description: Memory Store、Memory 与版本管理。
    x-group: Memory
  - name: Managed Agents - Vault
    description: Vault 与 Credential 管理。
    x-group: Vault
  - name: Managed Agents - Skill
    description: 自定义 Skill 与版本管理。
    x-group: Skill
  - name: Managed Agents - Deployment
    description: 定时或手动 Deployment 与运行记录。
    x-group: Deployment
  - name: Thread
    description: 会话线程
    x-group: Thread
paths:
  /agent/managed/v1/sessions/{sessionId}/threads/{threadId}/events:
    servers:
      - url: https://agent-api.bigmodel.cn/api
    get:
      tags:
        - Thread
      summary: 列出线程事件
      description: |-
        分页列出指定线程的完整事件历史，按创建时间升序返回。

        <Accordion title="使用说明">

        线程完整历史，data/next_page，按 created_at 升序。

        </Accordion>
      operationId: managedGetsessionssessionIdthreadsthreadIdevents
      parameters:
        - $ref: '#/components/parameters/ManagedZaiVersion'
        - $ref: '#/components/parameters/ManagedZaiBeta'
        - name: sessionId
          in: path
          required: true
          schema:
            type: string
        - name: threadId
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 100
        - name: page
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedEventsPage'
        default:
          description: 错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsErrorResponse'
components:
  parameters:
    ManagedZaiVersion:
      name: zai-version
      in: header
      required: true
      description: >-
        Managed Agents API 入口要求的基础协议标识，当前只接受 2026-05-26；响应兼容形态由 zai-beta
        选择。两个头均需携带。
      schema:
        type: string
        enum:
          - '2026-05-26'
        default: '2026-05-26'
        example: '2026-05-26'
    ManagedZaiBeta:
      name: zai-beta
      in: header
      required: true
      description: >-
        声明 Managed Agents Beta 协议并选择响应字段与兼容行为。新接入使用
        managed-agents-2026-09-22；旧客户端仍可使用 managed-agents-2026-05-26。必须同时携带
        zai-version: 2026-05-26。字段差异见 /cn/managed-agents/protocol-versions。
      schema:
        type: string
        default: managed-agents-2026-09-22
        example: managed-agents-2026-09-22
  schemas:
    ManagedEventsPage:
      $ref: '#/components/schemas/ManagedEventPage'
    ManagedAgentsErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - request_too_large
                - rate_limit_error
                - api_error
                - timeout_error
                - overloaded_error
                - memory_path_conflict_error
                - memory_precondition_failed_error
                - conflict_error
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - type
            - message
          additionalProperties: false
        request_id:
          type: string
          example: req_01J...
      required:
        - type
        - error
        - request_id
      additionalProperties: false
    ManagedEventPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ManagedPersistedEvent'
        next_page:
          type: string
          nullable: true
      required:
        - data
        - next_page
      additionalProperties: false
    ManagedPersistedEvent:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - agent.custom_tool_use
            - agent.mcp_tool_result
            - agent.mcp_tool_use
            - agent.message
            - agent.thinking
            - agent.thread_context_compacted
            - agent.thread_message_received
            - agent.thread_message_sent
            - agent.tool_result
            - agent.tool_use
            - session.deleted
            - session.error
            - session.status_idle
            - session.status_rescheduled
            - session.status_running
            - session.status_terminated
            - session.thread_created
            - session.thread_status_idle
            - session.thread_status_rescheduled
            - session.thread_status_running
            - session.thread_status_terminated
            - session.updated
            - session.usage
            - span.model_request_end
            - span.model_request_start
            - span.outcome_evaluation_end
            - span.outcome_evaluation_ongoing
            - span.outcome_evaluation_start
            - system.message
            - user.custom_tool_result
            - user.define_outcome
            - user.interrupt
            - user.message
            - user.tool_confirmation
            - user.tool_result
        processed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            事件被平台处理时写入，不保证唯一。排队中的 user.message / user.interrupt 在历史接口中可能省略或为
            null；公共 SSE 会在平台接手后携带 processed_at 推送。
        session_thread_id:
          type: string
          description: Session 面子线程 cross-post 的来源归属；Thread ID，不是第三类资源。
        from_session_thread_id:
          type: string
        from_agent_name:
          type: string
        to_session_thread_id:
          type: string
        to_agent_name:
          type: string
        stop_details:
          type: object
          nullable: true
          enum:
            - null
        workflow_run_id:
          type: string
          nullable: true
        content:
          type: array
          items:
            type: object
            additionalProperties: true
          description: >-
            消息/Thinking 内容或工具结果块。Search 使用 search_result，Fetch 使用
            document；agent.thinking 的 content 仅新协议下输出。
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            cache_read_input_tokens:
              type: integer
            server_tool_use:
              type: object
              properties:
                web_search_requests:
                  type: integer
                  minimum: 0
                web_fetch_requests:
                  type: integer
                  enum:
                    - 0
              required:
                - web_search_requests
                - web_fetch_requests
              additionalProperties: false
          required:
            - input_tokens
            - output_tokens
            - cache_read_input_tokens
      required:
        - id
        - type
      additionalProperties: true
      description: 持久化事件。不同 type 的其余字段由对应事件载荷决定；此枚举直接来自 master 的 ManagedSessionEventTypes。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.