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

# 查询 Webhook 投递日志

> 查询 Webhook 投递结果。默认返回最近 72 小时，单次时间范围最多 30 天；response_body 最多保留约 2000 个字符，可能包含接收端返回的业务或敏感信息。

当前服务按租户范围查询日志，而不是按创建 Webhook 的用户二次隔离。该接口只应由受控租户的管理员 API Key 使用，并应尽量传 webhook_id 收窄范围。不要向普通终端用户暴露日志响应。




## OpenAPI

````yaml api-reference/adp-api.yaml POST /open/agentic_doc_processor/{tenant_name}/v1/webhook/logs
openapi: 3.1.0
info:
  title: ADP API
  version: 1.0.0
  description: >-
    Laiye ADP 官方 OpenAPI
    接口规范，覆盖文档抽取、解析与转换，抽取应用管理、Webhook、人机协同、积分查询，以及工作流发现、运行、导出和文件管理。
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp.laiye.com
    description: ADP 生产环境
security: []
tags:
  - name: 文档抽取
    description: 从上传的文档中抽取结构化字段。
  - name: 文档解析
    description: 识别上传文档中的文字、版面块和位置信息。
  - name: 文档转换
    description: 将 PDF、Office、OFD 和图片转换为页面图片或电子表格结构。
  - name: 应用管理
    description: 创建、修改、删除和查询抽取应用及配置。
  - name: Webhook
    description: 查询事件目录并管理事件回调。
  - name: 账户
    description: 查询账户积分和使用情况。
  - name: 工作流
    description: 查询业务工作流模板、运行工作流应用并查询执行结果。
  - name: 工作流文件
    description: 上传和管理工作流应用使用的文件。
  - name: 人机协同
    description: 配置审核触发规则，查询协同任务并提交人工修正。
paths:
  /open/agentic_doc_processor/{tenant_name}/v1/webhook/logs:
    post:
      tags:
        - Webhook
      summary: 查询 Webhook 投递日志
      description: >
        查询 Webhook 投递结果。默认返回最近 72 小时，单次时间范围最多 30 天；response_body 最多保留约 2000
        个字符，可能包含接收端返回的业务或敏感信息。


        当前服务按租户范围查询日志，而不是按创建 Webhook 的用户二次隔离。该接口只应由受控租户的管理员 API Key 使用，并应尽量传
        webhook_id 收窄范围。不要向普通终端用户暴露日志响应。
      operationId: queryWebhookLogs
      parameters:
        - $ref: '#/components/parameters/TenantName'
      requestBody:
        $ref: '#/components/requestBodies/WebhookLogQueryRequest'
      responses:
        '200':
          $ref: '#/components/responses/WebhookLogResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    TenantName:
      name: tenant_name
      in: path
      required: true
      description: 租户名称，默认 laiye。
      schema:
        type: string
        default: laiye
  requestBodies:
    WebhookLogQueryRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookLogQueryRequest'
          example:
            webhook_id: webhook_abc123
            start_time: '2026-08-01 00:00:00'
            end_time: '2026-08-02 00:00:00'
            page: 1
            page_size: 20
  responses:
    WebhookLogResponse:
      description: Webhook 投递日志。response_body 可能包含敏感数据。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookLogResponse'
    ValidationError:
      description: 参数校验错误。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
          example:
            detail:
              - type: greater_than
                loc:
                  - query
                  - limit
                msg: Input should be greater than 0
                input: 0
                ctx:
                  gt: 0
  schemas:
    WebhookLogQueryRequest:
      type: object
      additionalProperties: false
      properties:
        webhook_id:
          type:
            - string
            - 'null'
          description: Webhook 配置 ID；建议始终提供以收窄日志查询范围。
        start_time:
          type:
            - string
            - 'null'
          pattern: ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$
          description: 起始时间，格式 YYYY-MM-DD HH:mm:ss。省略时默认为结束时间前 72 小时。
        end_time:
          type:
            - string
            - 'null'
          pattern: ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$
          description: 结束时间，格式 YYYY-MM-DD HH:mm:ss。省略时为当前时间。
        page:
          type: integer
          default: 1
          minimum: 1
        page_size:
          type: integer
          default: 20
          minimum: 1
          maximum: 100
    WebhookLogResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                logs:
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhookLog'
                total:
                  type: integer
                  minimum: 0
                page:
                  type: integer
                  minimum: 1
                page_size:
                  type: integer
                  minimum: 1
                  maximum: 100
              required:
                - logs
                - total
                - page
                - page_size
          required:
            - data
    HTTPValidationError:
      type: object
      description: FastAPI/Pydantic 请求参数校验错误。
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      required:
        - detail
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: 业务码。成功通常为 success 或 200。
        message:
          type: string
          description: 返回信息。
        tips:
          type:
            - string
            - 'null'
          description: 详细信息，默认为空。
    WebhookLog:
      type: object
      properties:
        id:
          type: string
        webhook_id:
          type: string
        webhook_url:
          type: string
          format: uri
        event_type:
          $ref: '#/components/schemas/WebhookEventType'
        app_id:
          type:
            - string
            - 'null'
        app_name:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - pending
            - success
            - failed
            - final_failed
        retry_count:
          type: integer
          minimum: 0
        next_retry_at:
          type:
            - string
            - 'null'
          format: date-time
        response_code:
          type:
            - integer
            - 'null'
        response_body:
          type:
            - string
            - 'null'
          maxLength: 2000
          description: 接收端最后一次响应或错误信息，可能包含敏感数据。
        delivered_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - webhook_id
        - webhook_url
        - event_type
        - status
        - retry_count
    ValidationErrorItem:
      type: object
      additionalProperties: true
      properties:
        type:
          type: string
          description: 校验错误类型。
        loc:
          type: array
          description: 错误字段在请求中的位置。
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
          description: 可读的错误说明。
        input:
          description: 导致校验失败的输入值。
        ctx:
          type: object
          additionalProperties: true
          description: 校验器提供的补充上下文。
        url:
          type: string
          format: uri
          description: Pydantic 错误说明链接。
      required:
        - type
        - loc
        - msg
    WebhookEventType:
      type: string
      enum:
        - doc_parse_completed
        - doc_extract_completed
        - collaboration_start
        - collaboration_success
        - collaboration_failed
        - collaboration_completed
        - collaboration_timeout
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: 生产环境 API Key，可在 ADP 平台的「我的 API」中查看。请确保 API Key 有效且属于生产环境。

````

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