> ## 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.

# 列出事件

> 分页读取指定 Session 已持久化的历史事件。可使用游标继续读取，适合在实时流断开后补齐事件。点击 **Try it** 按钮可快速试用。



## OpenAPI

````yaml /openapi/openapi-managed-agents.json get /agent/managed/v1/sessions/{sessionId}/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
paths:
  /agent/managed/v1/sessions/{sessionId}/events:
    servers:
      - url: https://agent-api.bigmodel.cn/api
        description: 智谱 Managed Agents 服务
    get:
      tags:
        - Managed Agents - Session
      summary: 列出事件
      description: 分页读取指定 Session 已持久化的历史事件。可使用游标继续读取，适合在实时流断开后补齐事件。点击 **Try it** 按钮可快速试用。
      operationId: managedGetSessionsBySessionIdEvents
      parameters:
        - $ref: '#/components/parameters/ManagedZaiVersion'
        - $ref: '#/components/parameters/ManagedZaiBeta'
        - name: sessionId
          in: path
          required: true
          description: sessionId 资源标识。
          schema:
            type: string
        - name: types
          in: query
          required: false
          description: 事件类型过滤；可用逗号分隔或重复传入。
          schema:
            type: array
            items:
              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
          style: form
          explode: true
        - name: created_at[gt]
          in: query
          required: false
          description: RFC 3339 处理时间边界。
          schema:
            type: string
            format: date-time
        - name: created_at[gte]
          in: query
          required: false
          description: RFC 3339 处理时间边界。
          schema:
            type: string
            format: date-time
        - name: created_at[lt]
          in: query
          required: false
          description: RFC 3339 处理时间边界。
          schema:
            type: string
            format: date-time
        - name: created_at[lte]
          in: query
          required: false
          description: RFC 3339 处理时间边界。
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          required: false
          description: 每页数量；大于 100 时服务端截断为 100。
          schema:
            type: integer
            minimum: 1
            default: 100
        - name: order
          in: query
          required: false
          description: 排序方向。
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
        - name: page
          in: query
          required: false
          description: 上一页返回的 opaque cursor。
          schema:
            type: string
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedEventPage'
        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。
      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-2026-05-26；可与其他 beta 标识用逗号分隔。
      schema:
        type: string
        default: managed-agents-2026-05-26
        example: managed-agents-2026-05-26
  schemas:
    ManagedEventPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ManagedPersistedEvent'
        next_page:
          type: string
          nullable: true
      required:
        - data
        - next_page
      additionalProperties: false
    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
            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
    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: 排队中的输入事件可能省略；部分确认/中断事件会返回 null。
      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) 页面获取密钥。

````