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

# 导出 Issue 列表

> 将符合过滤条件的 RUM 异常追踪 Issue 导出为 CSV 文件。响应为 `text/csv` 流，通过 `Content-Disposition: attachment` 交付——不是 JSON 信封；非控制台调用方可通过 `X-Export-Total` 与 `X-Export-Truncated` 响应头获知匹配总数与截断情况。

## 限制说明

| 项目   | 说明                                       |
| ---- | ---------------------------------------- |
| 速率限制 | 每个账户 **200 次/天**；**100 次/分钟**；**10 次/秒** |
| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用                |

## 使用说明

* 响应为 `text/csv` 流，通过 `Content-Disposition: attachment` 交付——不使用标准信封。文件名为 `rum-issues-<时间戳>.csv`，按请求的 `time_zone` 打时间戳。请通过 `X-Export-Total` 与 `X-Export-Truncated` 响应头获取总数与截断情况。
* 导出读取前 100 条匹配记录（`ExportMaxRows`）；匹配数超过上限时 `X-Export-Truncated` 为 `true`。`p` 和 `limit` 被忽略。
* 请求过滤条件与 `POST /rum/issue/list` 完全一致——导出就是“我正在看的列表，输出成文件”。
* `export_fields` 按顺序指定 CSV 列；未知键会被拒绝；空数组使用默认列集。
* `time_zone` 必须是合法的 IANA 时区名（如 `Asia/Shanghai`、`UTC`）；时间戳按该时区渲染，时间列表头携带时区。非法时区名会被拒绝。
* `console_origin` 用于拼接 `issue_url` 列；服务无法自行推断（SaaS、私有化与 dev 环境地址不同）。
* 每次调用都会记录到账户审计日志，包含调用者成员 ID、请求负载与最终错误（如有）。请勿在请求字段中放置敏感信息。


## OpenAPI

````yaml /api-reference/rum.openapi.zh.json post /rum/issue/export
openapi: 3.1.0
info:
  title: Flashduty 开放 API
  description: >-
    Flashduty 事件管理平台的公开 HTTP API —— 覆盖故障、通知模板、协作空间、值班排班、监控、RUM、以及平台管理。每次调用都需在
    query 中携带 `app_key`，该 key 在 Flashduty 控制台 账户 → APP Key 中签发。所有响应使用统一结构：成功时为
    `{ request_id, data }`，失败时为 `{ request_id, error }`。
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: RUM/应用管理
    description: 管理前端性能监控（RUM）应用。
  - name: RUM/RUM 数据查询
    description: 对 RUM 事件数据执行分析查询。
  - name: RUM/RUM 问题跟踪
    description: 查询和管理 RUM 异常追踪 Issue 及预设严重性规则。
  - name: RUM/RUM 自定义字段
    description: 查询 RUM 自定义字段及其值分布，用于构建分析过滤条件。
  - name: RUM/RUM Sourcemap
    description: 管理和查询用于 Browser、Android、iOS 错误符号化的 RUM Sourcemap 文件。
  - name: RUM/Session replay
    description: 查询 RUM 会话的回放元数据与录制分段。
  - name: RUM/错误采集规则
    description: 配置和查看决定 RUM 应用采集哪些错误的规则，并可查看其编辑历史。
  - name: RUM/Issue 预设严重性规则
    description: 管理按应用配置的预设严重性规则，用于为匹配的前端错误指定严重级别，并管理其评估顺序与变更历史。
  - name: RUM/资源
    description: 查询账户的 RUM 资源记录及当前用量。
paths:
  /rum/issue/export:
    post:
      tags:
        - RUM/RUM 问题跟踪
      summary: 导出 Issue 列表
      description: >-
        将符合过滤条件的 RUM 异常追踪 Issue 导出为 CSV 文件。响应为 `text/csv` 流，通过
        `Content-Disposition: attachment` 交付——不是 JSON 信封；非控制台调用方可通过
        `X-Export-Total` 与 `X-Export-Truncated` 响应头获知匹配总数与截断情况。
      operationId: rum-issue-read-export
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RumIssueExportRequest'
            example:
              start_time: 1772611200000
              end_time: 1775961914595
              application_ids:
                - eWbr4xk3ZRnLabRa6unqwD
              statuses:
                - for_review
              orderby: updated_at
              export_fields:
                - issue_id
                - error_type
                - error_message
                - status
                - error_count
                - session_count
                - last_seen_at
              console_origin: https://console.flashcat.cloud
              time_zone: Asia/Shanghai
      responses:
        '200':
          description: Success. CSV attachment, not a JSON envelope.
          headers:
            X-Export-Total:
              description: Total number of issues matching the filters, before the row cap.
              schema:
                type: integer
                format: int64
            X-Export-Truncated:
              description: >-
                `true` when more issues matched than the 100-row cap and the
                file was truncated.
              schema:
                type: boolean
          content:
            text/csv:
              schema:
                type: string
                description: >-
                  CSV file content. The header row matches the exported columns
                  in order; values are sanitized against spreadsheet formula
                  injection.
              example: >-
                Issue ID,Error type,Error message,Status,Error count,Affected
                sessions,Last seen (Asia/Shanghai)

                NHEacQHi2DhXqobr9qPQz9,Error,Script
                error.,for_review,752,381,2026-04-12 10:43:59

                H8kZSmxiE7EgdyD4fCyyNa,Error,"API ERROR: We encountered an
                internal error | POST
                /api/access/logout",for_review,3,1,2026-04-03 12:41:24
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RumIssueExportRequest:
      type: object
      required:
        - start_time
        - end_time
      description: 导出 RUM 异常追踪 Issue 的过滤参数。
      properties:
        start_time:
          type: integer
          format: int64
          description: 时间范围起始，Unix 毫秒时间戳。
        end_time:
          type: integer
          format: int64
          description: 时间范围结束，毫秒时间戳，最大范围 183 天。
        application_ids:
          type: array
          items:
            type: string
          description: 按应用 ID 过滤；应用 ID 可通过 `POST /rum/application/list` 获取。
        dql:
          type: string
          description: DQL 高级过滤查询，不能与 `sql` 同时使用。
        sql:
          type: string
          description: SQL 式高级过滤查询，不能与 `dql` 同时使用。
        statuses:
          type: array
          items:
            type: string
            enum:
              - for_review
              - reviewed
              - ignored
              - resolved
          description: 按状态过滤，取值见枚举；传入其他值会报参数错误。
        suspected_causes:
          type: array
          items:
            type: string
            enum:
              - api.failed_request
              - network.error
              - code.exception
              - code.invalid_object_access
              - code.invalid_argument
              - unknown
          description: 按疑似原因过滤，取值见枚举。
        team_ids:
          type: array
          items:
            type: integer
            format: int64
          description: 按团队 ID 过滤；团队 ID 可通过 `POST /team/list` 获取。
        p:
          type: integer
          description: 页码（从 1 开始）。导出时忽略——始终读取前 100 条匹配记录。
        limit:
          type: integer
          description: 每页条数（1–100）。导出时忽略——行数上限固定为 100。
        orderby:
          type: string
          enum:
            - created_at
            - updated_at
            - session_count
            - error_count
            - severity
          description: 排序字段；缺省时按 `updated_at` 排序。
        asc:
          type: boolean
          description: 为 `true` 时升序排列；默认降序。
        error_required:
          type: boolean
          description: 为 `true` 时仅导出有关联错误事件的 Issue。
        by_intersection:
          type: boolean
          description: >-
            为 `true` 时按时间交集匹配：导出在时间窗口内仍有活动的 Issue（`last_seen_timestamp` 不早于
            `start_time`），即使其创建于窗口之前；默认 `false` 仅导出创建于窗口内的 Issue。
        export_fields:
          type: array
          items:
            type: string
            enum:
              - issue_id
              - issue_url
              - application_name
              - service
              - error_type
              - error_message
              - status
              - severity
              - is_crash
              - error_count
              - session_count
              - first_seen_at
              - first_seen_version
              - last_seen_at
              - last_seen_version
              - versions
              - suspected_cause
              - resolved_at
          description: 按顺序指定导出的 CSV 列；未知键会被拒绝；空数组使用默认列集。
        console_origin:
          type: string
          description: >-
            用于拼接 `issue_url` 列的控制台地址，如
            `https://console.flashcat.cloud`；服务无法自行推断（SaaS、私有化与 dev 环境地址不同）。
        time_zone:
          type: string
          description: 渲染 CSV 时间戳所用的 IANA 时区名，如 `Asia/Shanghai`、`UTC`；默认 `Asia/Shanghai`。
    ErrorResponse:
      type: object
      description: 错误响应结构。`error` 必填，`data` 不存在。
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          description: 本次请求的唯一追踪 ID（trace ID），反馈问题时请提供该值以便检索日志。
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    DutyError:
      type: object
      description: 响应结构中的错误 payload，仅在非 2xx 响应时出现。
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: 用户可读的错误描述，语言会跟随调用方的 Accept-Language。可能包含字段名、ID 等请求上下文。
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    ErrorCode:
      type: string
      description: >-
        Flashduty 错误码枚举。每个失败响应的 `error.code` 都是下列稳定值之一，HTTP 状态码仅作参考。


        | 错误码 | HTTP | 含义 |

        |---|---|---|

        | `OK` | 200 | 保留值，正常错误响应不会返回。 |

        | `InvalidParameter` | 400 | 必填参数缺失或未通过校验。 |

        | `BadRequest` | 400 | 通用的 400 错误，通常是请求本身不合法。 |

        | `InvalidContentType` | 400 | 请求头 `Content-Type` 不是 `application/json`。
        |

        | `ResourceNotFound` | 400 | 目标资源不存在。注意 HTTP 状态码是 400 而非 404（历史设计）。 |

        | `NoLicense` | 400 | 功能需要有效授权，但未找到可用的 license。 |

        | `ReferenceExist` | 400 | 该资源仍被其他实体引用，无法删除。 |

        | `Unauthorized` | 401 | `app_key` 缺失、无效或已过期。 |

        | `BalanceNotEnough` | 402 | 账户余额不足，无法执行需要计费的操作。 |

        | `AccessDenied` | 403 | 身份认证通过，但 RBAC 权限不足以执行该操作。 |

        | `RouteNotFound` | 404 | 请求的 URL 路径不是已知路由。 |

        | `MethodNotAllowed` | 405 | 当前路径不接受所使用的 HTTP 方法。 |

        | `UndonedOrderExist` | 409 | 账户存在未完成的订单，请稍后重试。 |

        | `RequestLocked` | 423 | 因连续失败被临时锁定。 |

        | `EntityTooLarge` | 413 | 请求体超过允许的最大长度。 |

        | `RequestTooFrequently` | 429 | 命中限流（全局、账户级或集成级）。 |

        | `RequestVerifyRequired` | 428 | 操作需要二次验证码，但未提供。 |

        | `DangerousOperation` | 428 | 危险操作，需要进行 MFA 验证。 |

        | `InternalError` | 500 | 服务端未预期错误。反馈问题请附上 `request_id`。 |

        | `ServiceUnavailable` | 503 | 后端依赖不可用，请稍后重试。 |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: 保留值，正常错误响应不会返回。
        InvalidParameter: 必填参数缺失或未通过校验。
        BadRequest: 通用的 400 错误，通常是请求本身不合法。
        InvalidContentType: 请求头 `Content-Type` 不是 `application/json`。
        ResourceNotFound: 目标资源不存在。注意 HTTP 状态码是 400 而非 404（历史设计）。
        NoLicense: 功能需要有效授权，但未找到可用的 license。
        ReferenceExist: 该资源仍被其他实体引用，无法删除。
        Unauthorized: '`app_key` 缺失、无效或已过期。'
        BalanceNotEnough: 账户余额不足，无法执行需要计费的操作。
        AccessDenied: 身份认证通过，但 RBAC 权限不足以执行该操作。
        RouteNotFound: 请求的 URL 路径不是已知路由。
        MethodNotAllowed: 当前路径不接受所使用的 HTTP 方法。
        UndonedOrderExist: 账户存在未完成的订单，请稍后重试。
        RequestLocked: 因连续失败被临时锁定。
        EntityTooLarge: 请求体超过允许的最大长度。
        RequestTooFrequently: 命中限流（全局、账户级或集成级）。
        RequestVerifyRequired: 操作需要二次验证码，但未提供。
        DangerousOperation: 危险操作，需要进行 MFA 验证。
        InternalError: 服务端未预期错误。反馈问题请附上 `request_id`。
        ServiceUnavailable: 后端依赖不可用，请稍后重试。
      example: InvalidParameter
  responses:
    BadRequest:
      description: 请求非法 — 通常是参数缺失或格式不正确。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter is not valid.
    Unauthorized:
      description: app_key 缺失或无效。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    TooManyRequests:
      description: 命中限流。可能是全局 API 限流、账户级限流或集成级限流。限流按账户聚合。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: 服务端未预期错误。反馈问题时请携带 request_id。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: app_key
      description: >-
        在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API
        时都必须携带。它等同于所属账户的身份凭证，请妥善保管。

````