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

# 列出自动化运行历史

> 列出调用者可管理规则的运行历史。

## 调用限制

| 项    | 值                             |
| ---- | ----------------------------- |
| 速率限制 | **1,000 次/分钟**；**50 次/秒** 每账户 |
| 权限   | 有效 `app_key`；结果按调用者可见范围过滤     |


## OpenAPI

````yaml /api-reference/safari.openapi.zh.json post /safari/automation/run/list
openapi: 3.1.0
info:
  title: Flashduty 开放 API
  description: >-
    Flashduty AI SRE 平台的公开 HTTP API —— 技能、MCP 服务器（连接器）、A2A 智能体与会话。所有接口均使用
    Flashduty 控制台签发的 `app_key` 查询参数进行认证。
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: AI SRE/技能
  - name: AI SRE/MCP 服务器
  - name: AI SRE/A2A 智能体
  - name: AI SRE/会话
  - name: AI SRE/自动化
paths:
  /safari/automation/run/list:
    post:
      tags:
        - AI SRE/自动化
      summary: 列出自动化运行历史
      description: 列出调用者可管理规则的运行历史。
      operationId: automation-run-read-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationRunListRequest'
            example:
              rule_id: auto_7NnLzY2Qp8xS4kUaV3mR6b
              limit: 20
              trigger_kind: schedule
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AutomationRunListResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  total: 1
                  runs:
                    - run_id: taskrun_5oDvqiG64uur6sBNsTc4u
                      kind: automation_rule
                      account_id: 10023
                      rule_id: auto_7NnLzY2Qp8xS4kUaV3mR6b
                      trigger_kind: schedule
                      occurrence_key: autotrg_6aKp3wT9mQ2xVc8bR1nY7z:1780630800000
                      status: succeeded
                      attempts: 1
                      started_at: 1780630800000
                      completed_at: 1780630923456
                      duration_ms: 123456
                      error_code: ''
                      error_message: ''
                      stats_json: {}
                      result_json:
                        session_id: sess_f8oDvqiG64uur6sBNsTc4u
                      created_at: 1780630800000
                      updated_at: 1780630923456
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - AppKeyAuth: []
components:
  schemas:
    AutomationRunListRequest:
      type: object
      properties:
        rule_id:
          type: string
          description: 目标规则 ID。
        p:
          type: integer
          description: 页码，从 1 开始。
          default: 1
        limit:
          type: integer
          default: 20
          maximum: 100
          description: 每页数量。
        status:
          type: string
          enum:
            - queued
            - running
            - retrying
            - succeeded
            - partial
            - failed
            - skipped
            - abandoned
          description: 运行状态过滤。
        trigger_kind:
          type: string
          enum:
            - schedule
            - debug
            - manual
            - http_post
            - oncall_incident
          description: 触发来源过滤条件。
        started_after_ms:
          type: integer
          format: int64
          description: 开始时间下界，Unix 毫秒。
        started_before_ms:
          type: integer
          format: int64
          description: 开始时间上界，Unix 毫秒。
      required:
        - rule_id
    ResponseEnvelope:
      type: object
      description: >-
        Standard response envelope used by every Flashduty public API. On
        success `data` contains the endpoint-specific payload and `error` is
        absent. On failure `error` is present and `data` is absent. `request_id`
        is always present and is also mirrored in the `Flashcat-Request-Id`
        response header.
      properties:
        request_id:
          type: string
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
      required:
        - request_id
    AutomationRunListResponse:
      type: object
      properties:
        total:
          type: integer
          format: int64
          description: 总数。
        runs:
          type: array
          items:
            $ref: '#/components/schemas/AutomationRunItem'
      required:
        - total
        - runs
    DutyError:
      type: object
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
      required:
        - code
        - message
    AutomationRunItem:
      type: object
      properties:
        run_id:
          type: string
          description: 运行 ID。
        kind:
          type: string
          description: 运行类型。
        account_id:
          type: integer
          format: int64
          description: 账户 ID。
        rule_id:
          type: string
          description: 规则 ID。
        trigger_kind:
          type: string
          enum:
            - schedule
            - debug
            - manual
            - http_post
            - oncall_incident
          description: 触发来源。
        occurrence_key:
          type: string
          description: 幂等键。
        status:
          type: string
          enum:
            - queued
            - running
            - retrying
            - succeeded
            - partial
            - failed
            - skipped
            - abandoned
          description: 运行状态。
        attempts:
          type: integer
          description: 尝试次数。
        started_at:
          type: integer
          format: int64
          description: 开始时间，Unix 毫秒。
        completed_at:
          type: integer
          format: int64
          description: 完成时间，Unix 毫秒。0 表示尚未完成。
        duration_ms:
          type: integer
          format: int64
          description: 运行耗时，毫秒。
        error_code:
          type: string
          description: 错误码。
        error_message:
          type: string
          description: 错误消息。
        stats_json:
          description: 统计 JSON。
        result_json:
          description: 结果 JSON。
        created_at:
          type: integer
          format: int64
          description: 创建时间，Unix 毫秒。
        updated_at:
          type: integer
          format: int64
          description: 更新时间，Unix 毫秒。
      required:
        - run_id
        - kind
        - account_id
        - rule_id
        - trigger_kind
        - occurrence_key
        - status
        - attempts
        - started_at
        - completed_at
        - duration_ms
        - created_at
        - updated_at
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    ErrorCode:
      type: string
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these values. The value is a stable wire string — not a
        localized message and not a numeric status. HTTP status is
        informational.
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
  responses:
    BadRequest:
      description: Invalid request — usually a missing or malformed parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              summary: Missing required parameter
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter skill_id is not valid.
    Unauthorized:
      description: Missing or invalid app_key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    Forbidden:
      description: The app_key is valid but lacks permission for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            accessDenied:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: AccessDenied
                  message: Access Denied.
    TooManyRequests:
      description: Rate limit hit. Either the global API limit or a per-account limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: Unexpected server-side error. Include the request_id when reporting.
      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: >-
        App key issued from the Flashduty console. Required on every public API
        call. Keep it secret — it grants the same access as the owning account.

````