{
  "openapi": "3.1.0",
  "info": {
    "title": "SAMLab a1",
    "version": "0.4.0",
    "description": "ICAMA 实时查询与 UPLS 只读预览查询，使用不同的 Bearer Token。UPLS 默认待连接，业务返回 UNAVAILABLE。ICAMA 异步任务完成后内存保留 600 秒。调用方按可信代理解析后的出口 IP 区分。同步请求 5 秒队列等待 + 20 秒执行；批量 60 秒队列等待 + 240 秒执行。A1 来源侧可选持久化本地快照和冻结候选，独立只读凭据；默认清单为空、定时关闭。"
  },
  "servers": [
    {
      "url": "https://mcp.samlab.cn"
    }
  ],
  "paths": {
    "/api/v1/integration/upls/a1/status": {
      "get": {
        "summary": "getA1DeliveryStatus",
        "operationId": "getA1DeliveryStatus",
        "parameters": [
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "本次调用方范围内的幂等请求 ID"
          },
          {
            "name": "X-Trace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "当前调用的独立追踪 ID"
          },
          {
            "name": "X-Priority",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "normal"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "已处理；查询结果须继续检查 data.status",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/A1Status"
                }
              }
            }
          },
          "405": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "a1"
        ],
        "security": [
          {
            "A1ReadToken": []
          }
        ]
      }
    },
    "/api/v1/integration/upls/a1/candidate-batches": {
      "get": {
        "summary": "pullA1CandidateBatch",
        "operationId": "pullA1CandidateBatch",
        "parameters": [
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "本次调用方范围内的幂等请求 ID"
          },
          {
            "name": "X-Trace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "当前调用的独立追踪 ID"
          },
          {
            "name": "X-Priority",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "normal"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "已处理；查询结果须继续检查 data.status",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/A1Feed"
                }
              }
            }
          },
          "405": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "410": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "a1"
        ],
        "security": [
          {
            "A1ReadToken": []
          }
        ]
      }
    },
    "/api/v1/integration/upls/a1/snapshots/{snapshotId}": {
      "get": {
        "summary": "getA1Snapshot",
        "operationId": "getA1Snapshot",
        "parameters": [
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "本次调用方范围内的幂等请求 ID"
          },
          {
            "name": "X-Trace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "当前调用的独立追踪 ID"
          },
          {
            "name": "X-Priority",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "normal"
              ]
            }
          },
          {
            "name": "snapshotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "已处理；查询结果须继续检查 data.status",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/A1Snapshot"
                }
              }
            }
          },
          "405": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "a1"
        ],
        "security": [
          {
            "A1ReadToken": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "const": false
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "maxLength": 128
          },
          "traceId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "maxLength": 128
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "INVALID_PARAMETER",
                  "CONFLICT",
                  "NOT_FOUND",
                  "RATE_LIMITED",
                  "SERVICE_UNAVAILABLE",
                  "INVALID_CREDENTIALS",
                  "UNSUPPORTED_MEDIA_TYPE",
                  "PAYLOAD_TOO_LARGE",
                  "INTERNAL_ERROR",
                  "CURSOR_EXPIRED"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": [
                  "object",
                  "null"
                ]
              }
            },
            "required": [
              "code",
              "message",
              "details"
            ]
          }
        },
        "required": [
          "success",
          "requestId",
          "traceId",
          "timestamp",
          "error"
        ]
      },
      "A1Record": {
        "type": "object",
        "properties": {
          "registration_number": {
            "type": "string"
          },
          "change_type": {
            "enum": [
              "NEW",
              "CHANGED"
            ]
          },
          "snapshot_id": {
            "type": "string",
            "format": "uuid"
          },
          "previous_snapshot_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "changes": {
            "type": "object",
            "properties": {
              "/data/data/product_name": {
                "type": "object",
                "properties": {
                  "before": {
                    "type": "string"
                  },
                  "after": {
                    "type": "string"
                  }
                },
                "required": [
                  "before",
                  "after"
                ]
              }
            },
            "required": [],
            "additionalProperties": false
          },
          "raw_response": {
            "type": "object"
          }
        },
        "required": [
          "registration_number",
          "change_type",
          "snapshot_id",
          "previous_snapshot_id",
          "changes",
          "raw_response"
        ]
      },
      "A1Batch": {
        "type": "object",
        "properties": {
          "batch_id": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "source_namespace": {
            "const": "ICAMA"
          },
          "dataset": {
            "const": "pesticide_registration"
          },
          "records": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "$ref": "#/components/schemas/A1Record"
            }
          }
        },
        "required": [
          "batch_id",
          "created_at",
          "source_namespace",
          "dataset",
          "records"
        ]
      },
      "A1Feed": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "next_cursor": {
            "type": "string",
            "format": "uuid"
          },
          "batch": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/A1Batch"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "schema_version",
          "next_cursor",
          "batch"
        ]
      },
      "A1Status": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "source_namespace": {
            "const": "ICAMA"
          },
          "dataset": {
            "const": "pesticide_registration"
          },
          "start_cursor": {
            "type": "string",
            "format": "uuid"
          },
          "max_records_per_batch": {
            "const": 1
          },
          "retention_days": {
            "type": "integer",
            "minimum": 0
          },
          "approved_registrations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recheck_interval_seconds": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "schema_version",
          "start_cursor",
          "retention_days",
          "max_records_per_batch"
        ]
      },
      "A1Snapshot": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "snapshot_id": {
            "type": "string",
            "format": "uuid"
          },
          "registration_number": {
            "type": "string"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "raw_response": {
            "type": "object"
          }
        },
        "required": [
          "schema_version",
          "snapshot_id",
          "registration_number",
          "observed_at",
          "raw_response"
        ]
      }
    },
    "securitySchemes": {
      "A1ReadToken": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
