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

# 查询 Gitee 触发器投递记录

> 查询 Gitee 触发器收到的 webhook 投递，以及每次投递启动的运行。

## 限制说明

| 项目 | 说明 |
| - | - |
| 速率限制 | 每个账户 **1,000 次/分钟**；**50 次/秒** |
| 权限要求 | **Automation 查看**（`ai-sre`） |

## 使用说明

* 调用方必须能管理该规则本身（规则创建者，或规则所属团队的成员），否则返回 `403`。
* 结果按时间倒序。`p` 从 1 开始，`0` 按 1 处理；`limit` 为 `0` 时默认 20。
* `status` 是投递自身的结果；未启动运行时 `reason` 给出机器可读原因，例如 `rule_not_found`、`rule_disabled`、`self_echo`、`mcp_unavailable`。
* `payload_expires_at` 与 `audit_expires_at` 分别给出载荷与记录的清理时刻。


## OpenAPI

````yaml /api-reference/safari.openapi.zh.json post /safari/automation/delivery/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/技能
    description: AI SRE 智能体技能管理。
  - name: AI SRE/MCP 服务器
    description: MCP（Model Context Protocol）服务器管理。
  - name: AI SRE/A2A 智能体
    description: A2A（智能体到智能体）远程智能体管理。
  - name: AI SRE/会话
    description: AI SRE 智能体会话历史 —— 查询、查看与导出会话记录。
  - name: AI SRE/自动化
  - name: AI SRE/知识
  - name: AI SRE/产物
    description: AI SRE 产物库 —— 发布、浏览并公开分享智能体生成的文件。
  - name: AI SRE/自托管 Runner
    description: 自托管 Runner（BYOC）管理。
paths:
  /safari/automation/delivery/list:
    post:
      tags:
        - AI SRE/自动化
      summary: 查询 Gitee 触发器投递记录
      description: 查询 Gitee 触发器收到的 webhook 投递，以及每次投递启动的运行。
      operationId: automation-delivery-read-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SCMDeliveryListRequest'
            example:
              rule_id: rule_7Qm2Xc9Tb1Vk
              p: 1
              limit: 20
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ListGiteeDeliveriesResponse'
              example:
                request_id: 01HK8XQE3Z3KQ7M2NTFQ5YJ8P9R4
                data:
                  total: 1
                  deliveries:
                    - delivery_id: gitee_8d3f11c2-7b0e-4d6a-9f21-2c5b8e4a7d10
                      account_id: 10001
                      rule_id: rule_7Qm2Xc9Tb1Vk
                      trigger_id: trg_6Wm2QaLz
                      hook_id: hook_4412
                      event_type: merge_request
                      object_id: '2096'
                      action: merge
                      effective_timestamp: 1716962400000
                      summary_json: >-
                        {"title":"fix: bound the retry
                        queue","author":"li.na","head_branch":"fix/retry-queue","base_branch":"main"}
                      status: started
                      reason: ''
                      run_id: run_6Hc1Vd8Np3
                      attempts: 1
                      payload_expires_at: 1717567200
                      audit_expires_at: 1719559200
                      created_at: 1716962403
                      updated_at: 1716962411
        '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:
    SCMDeliveryListRequest:
      type: object
      description: 分页查询某条规则仓库投递的参数。
      required:
        - rule_id
      properties:
        rule_id:
          type: string
          description: 要查询投递的自动化规则 ID。
        p:
          type: integer
          format: int64
          description: 页码，从 1 开始；`0` 按 1 处理。
        limit:
          type: integer
          format: int64
          description: 每页条数；`0` 按 20 处理。
    ResponseEnvelope:
      type: object
      description: >-
        所有 Flashduty 公开 API 共用的标准响应结构。成功时 `data` 为接口专属载荷且不含 `error`；失败时 `error`
        存在而 `data` 缺失。`request_id` 始终存在，并会同步写入 `Flashcat-Request-Id` 响应头。
      properties:
        request_id:
          type: string
          description: 本次请求的唯一 ID，与 Flashcat-Request-Id 响应头一致。反馈问题时请携带该 ID。
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
        data:
          description: 接口返回的数据，格式见各接口的 200 响应。没有返回数据的接口会返回 `{}` 或完全不带 `data`。
      required:
        - request_id
    ListGiteeDeliveriesResponse:
      type: object
      required:
        - total
        - deliveries
      properties:
        total:
          type: integer
          format: int64
          description: 该规则累计记录的投递数。
        deliveries:
          type: array
          items:
            $ref: '#/components/schemas/GiteeDeliveryTable'
          description: 当前页的投递，按时间倒序。
    DutyError:
      type: object
      description: 响应结构中的错误 payload，仅在非 2xx 响应时出现。
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            按响应语言（query 参数 `locale` / `lang` 或请求头
            `Accept-Language`）返回的错误描述，可能包含出错的字段名，请不要解析它。
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    GiteeDeliveryTable:
      type: object
      description: Gitee 触发器收到的一次投递。
      required:
        - delivery_id
        - account_id
        - rule_id
        - trigger_id
        - hook_id
        - event_type
        - object_id
        - action
        - effective_timestamp
        - summary_json
        - status
        - reason
        - run_id
        - attempts
        - payload_expires_at
        - audit_expires_at
        - created_at
        - updated_at
      properties:
        delivery_id:
          type: string
          description: Gitee 为这次 webhook 调用分配的投递 ID。
        account_id:
          type: integer
          format: int64
          description: 规则所属账号。
        rule_id:
          type: string
          description: 接收该投递的自动化规则 ID。
        trigger_id:
          type: string
          description: 该规则内的 Gitee 触发器 ID。
        hook_id:
          type: string
          description: 发起投递的仓库 webhook ID。
        event_type:
          type: string
          description: 触发的 Gitee 事件，例如 `push`、`merge_request`。
        object_id:
          type: string
          description: 事件对应的 Gitee 对象标识；事件没有时为空。
        action:
          type: string
          description: 事件的动作；事件没有动作时为空。
        effective_timestamp:
          type: integer
          format: int64
          description: Gitee 所述事件发生时刻的 Unix 时间戳（毫秒）。
        summary_json:
          type: string
          description: 概述该事件的 JSON 文本，随投递一起存储。
        status:
          type: string
          description: >-
            投递状态：`received` 已接收、`duplicate` 重复投递、`filtered` 未命中触发器、`started`
            已创建运行、`failed` 处理失败。
        reason:
          type: string
          description: 投递未启动运行时的机器可读原因，例如 `rule_not_found`、`self_echo`；成功时为空。
        run_id:
          type: string
          description: 该投递启动的自动化运行 ID；未创建运行时为空。
        attempts:
          type: integer
          description: 该投递已尝试的次数。
        payload_expires_at:
          type: integer
          format: int64
          description: 已存载荷的清理时刻，Unix 时间戳（秒），为投递后 7 天。
        audit_expires_at:
          type: integer
          format: int64
          description: 投递记录本身的清理时刻，Unix 时间戳（秒），为投递后 30 天。
        created_at:
          type: integer
          format: int64
          description: 记录该投递的时刻，Unix 时间戳（秒）。
        updated_at:
          type: integer
          format: int64
          description: 该投递最后一次变更的时刻，Unix 时间戳（秒）。
    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
    ErrorCode:
      type: string
      description: >-
        错误码。所有失败响应都会把 `error.code` 设为下列稳定字符串之一，请以它而不是 HTTP 状态码做判断。


        | 错误码 | HTTP | 含义 |

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

        | `OK` | 200 | 保留值，失败的请求不会返回。 |

        | `InvalidParameter` | 400 | 参数缺失、类型错误或未通过校验，`message` 通常会指出字段名。 |

        | `BadRequest` | 400 | 请求违反业务规则或与对象当前状态冲突，`message` 会说明原因。 |

        | `InvalidContentType` | 400 | 请求体没有以 `application/json` 发送。 |

        | `ResourceNotFound` | 400 | 引用的对象在本账户中不存在或已删除。注意 HTTP 状态码是 400 而不是 404。
        |

        | `NoLicense` | 400 | 账户套餐不包含该功能、套餐配额已用完、套餐已过期或额度不足。 |

        | `ReferenceExist` | 400 | 对象仍被其他对象引用，无法删除。 |

        | `Unauthorized` | 401 | APP Key 缺失、无效或已删除。 |

        | `BalanceNotEnough` | 402 | 仅用于控制台计费流程，Open API 接口不会返回。 |

        | `AccessDenied` | 403 | APP Key 的权限范围或创建者角色不允许该操作或该对象。 |

        | `RouteNotFound` | 404 | 没有与该 HTTP 方法和路径匹配的接口。 |

        | `MethodNotAllowed` | 405 | 路径存在，但不支持该 HTTP 方法。 |

        | `UndonedOrderExist` | 409 | 仅用于控制台计费流程，Open API 接口不会返回。 |

        | `EntityTooLarge` | 413 | 请求体超出大小限制。 |

        | `RequestLocked` | 423 | 仅用于控制台登录保护，Open API 接口不会返回。 |

        | `RequestVerifyRequired` | 428 | 仅用于控制台验证码流程，Open API 接口不会返回。 |

        | `DangerousOperation` | 428 | 仅用于控制台高风险操作的 MFA 校验，Open API 接口不会返回。 |

        | `RequestTooFrequently` | 429 | 触发频率限制；请等待响应头
        `Flashcat-Request-Rate-Limit-Delay` 给出的秒数后再重试。 |

        | `InternalError` | 500 | 服务端意外错误；请退避后重试，反馈问题时附上 `request_id`。 |

        | `ServiceUnavailable` | 503 | 后端依赖过载或不可用，请退避后重试。 |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - EntityTooLarge
        - RequestLocked
        - RequestVerifyRequired
        - DangerousOperation
        - RequestTooFrequently
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: 保留值，失败的请求不会返回。
        InvalidParameter: 参数缺失、类型错误或未通过校验，`message` 通常会指出字段名。
        BadRequest: 请求违反业务规则或与对象当前状态冲突，`message` 会说明原因。
        InvalidContentType: 请求体没有以 `application/json` 发送。
        ResourceNotFound: 引用的对象在本账户中不存在或已删除。注意 HTTP 状态码是 400 而不是 404。
        NoLicense: 账户套餐不包含该功能、套餐配额已用完、套餐已过期或额度不足。
        ReferenceExist: 对象仍被其他对象引用，无法删除。
        Unauthorized: APP Key 缺失、无效或已删除。
        BalanceNotEnough: 仅用于控制台计费流程，Open API 接口不会返回。
        AccessDenied: APP Key 的权限范围或创建者角色不允许该操作或该对象。
        RouteNotFound: 没有与该 HTTP 方法和路径匹配的接口。
        MethodNotAllowed: 路径存在，但不支持该 HTTP 方法。
        UndonedOrderExist: 仅用于控制台计费流程，Open API 接口不会返回。
        EntityTooLarge: 请求体超出大小限制。
        RequestLocked: 仅用于控制台登录保护，Open API 接口不会返回。
        RequestVerifyRequired: 仅用于控制台验证码流程，Open API 接口不会返回。
        DangerousOperation: 仅用于控制台高风险操作的 MFA 校验，Open API 接口不会返回。
        RequestTooFrequently: 触发频率限制；请等待响应头 `Flashcat-Request-Rate-Limit-Delay` 给出的秒数后再重试。
        InternalError: 服务端意外错误；请退避后重试，反馈问题时附上 `request_id`。
        ServiceUnavailable: 后端依赖过载或不可用，请退避后重试。
      example: InvalidParameter
  responses:
    BadRequest:
      description: 请求非法 — 通常是参数缺失或格式不正确。
      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: 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: app_key 有效，但其权限范围或创建者角色不允许该操作或该对象。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            accessDenied:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: AccessDenied
                  message: Access Denied.
    TooManyRequests:
      description: 触发频率限制。请等待响应头 `Flashcat-Request-Rate-Limit-Delay` 给出的秒数后重试。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
      headers:
        Flashcat-Request-Rate-Limit-Delay:
          description: 距当前限流窗口重置的秒数。请求被网关全局保护限流拒绝时不返回该响应头。
          schema:
            type: integer
            minimum: 0
    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。可通过 query 参数 `app_key` 或请求头
        `Fd-App-Key` 传入。实际可访问范围是该 APP Key 的权限范围与创建者当前角色权限的交集，请妥善保管。

````

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