{
  "components": {
    "headers": {
      "NoStore": {
        "description": "Always `no-store` — no intermediary may cache these responses.",
        "schema": {
          "type": "string"
        }
      },
      "UpstreamRequestID": {
        "description": "The fetch service's own request identifier for this call. Quote it together with\nthe envelope's `request_id` in support requests.\n",
        "schema": {
          "type": "string"
        }
      },
      "ReplayOf": {
        "description": "The platform request id that was replayed; identical to `data.request_id`.",
        "schema": {
          "type": "string"
        }
      },
      "ReplayOperation": {
        "description": "Which capability produced the original result.",
        "schema": {
          "enum": [
            "search",
            "extract",
            "map"
          ],
          "type": "string"
        }
      },
      "OriginalStatus": {
        "description": "HTTP status the original call answered with.",
        "schema": {
          "type": "integer"
        }
      },
      "OriginalOutcome": {
        "description": "Whether the original call succeeded; `data.success` carries the same fact.",
        "schema": {
          "enum": [
            "succeeded",
            "failed"
          ],
          "type": "string"
        }
      }
    },
    "parameters": {
      "JobID": {
        "description": "Job id, `job_` followed by 22 base62 characters.",
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "pattern": "^job_[0-9A-Za-z]{22}$",
          "type": "string"
        }
      }
    },
    "responses": {
      "Error400": {
        "content": {
          "application/json": {
            "examples": {
              "invalid-argument": {
                "summary": "Code 11000 — our own validation rejected the request",
                "value": {
                  "code": 11000,
                  "details": [
                    "url: must be a valid absolute URL"
                  ],
                  "message": "invalid argument",
                  "request_id": "req_6a99053110d62d17"
                }
              },
              "upstream-invalid-request": {
                "summary": "Code 16002 — the fetch service rejected the request",
                "value": {
                  "code": 16002,
                  "details": [
                    "The request body is invalid(url)."
                  ],
                  "message": "the request was rejected, see details",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The request was rejected — see the error table for the code"
      },
      "Error401": {
        "content": {
          "application/json": {
            "examples": {
              "api-key-invalid": {
                "summary": "Code 12014 — the API key is invalid, revoked, or expired",
                "value": {
                  "code": 12014,
                  "message": "invalid api key",
                  "request_id": "req_6a99053110d62d17"
                }
              },
              "unauthorized": {
                "summary": "Code 12001 — no credential was sent",
                "value": {
                  "code": 12001,
                  "message": "authentication required",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The credential is missing, invalid, or expired"
      },
      "Error402": {
        "content": {
          "application/json": {
            "examples": {
              "quota-exceeded": {
                "summary": "Code 13002 — the daily credit quota is exhausted",
                "value": {
                  "code": 13002,
                  "details": [
                    "Daily quota of 500 credits exhausted."
                  ],
                  "message": "quota exceeded",
                  "request_id": "req_6a99053110d62d17"
                }
              },
              "service-out-of-credits": {
                "summary": "Code 16004 — the fetch service has no credits left",
                "value": {
                  "code": 16004,
                  "message": "the fetch service is out of credits, please contact us to top up",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The account has no credits or quota left"
      },
      "Error403": {
        "content": {
          "application/json": {
            "examples": {
              "forbidden": {
                "summary": "Code 12003 — account disabled, or the write request failed its origin check",
                "value": {
                  "code": 12003,
                  "message": "forbidden",
                  "request_id": "req_6a99053110d62d17"
                }
              },
              "scope-denied": {
                "summary": "Code 12015 — the API key lacks this endpoint's scope; the only failure carrying `data`",
                "value": {
                  "code": 12015,
                  "data": {
                    "required_scope": "map"
                  },
                  "message": "api key scope denied",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The credential is valid but not allowed to do this"
      },
      "Error404": {
        "content": {
          "application/json": {
            "examples": {
              "not-found": {
                "summary": "Code 11004 — not found",
                "value": {
                  "code": 11004,
                  "message": "not found",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The target does not exist, or does not belong to this account"
      },
      "Error409": {
        "content": {
          "application/json": {
            "examples": {
              "upstream-conflict": {
                "summary": "Code 16008 — the fetch service reported a state conflict",
                "value": {
                  "code": 16008,
                  "details": [
                    "JOB_PAUSED"
                  ],
                  "message": "upstream conflict",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The request conflicts with the resource's current state"
      },
      "Error429": {
        "content": {
          "application/json": {
            "examples": {
              "rate-limited": {
                "summary": "Code 13000 — rate limited by us; honour `Retry-After`",
                "value": {
                  "code": 13000,
                  "message": "too many requests",
                  "request_id": "req_6a99053110d62d17"
                }
              },
              "service-rate-limiting": {
                "summary": "Code 16003 — the fetch service is rate limiting",
                "value": {
                  "code": 16003,
                  "message": "the fetch service is rate limiting, please retry later",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "Too many requests — back off and retry"
      },
      "Error500": {
        "content": {
          "application/json": {
            "examples": {
              "internal-error": {
                "summary": "Code 10000 — internal error (14000 storage and 16009 our platform credential also answer 500)",
                "value": {
                  "code": 10000,
                  "message": "internal server error",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "A fault on our side — retry later, and contact us if it persists"
      },
      "Error502": {
        "content": {
          "application/json": {
            "examples": {
              "upstream-error": {
                "summary": "Code 16000 — the fetch service failed or answered unparseably",
                "value": {
                  "code": 16000,
                  "message": "the fetch service failed, please retry later",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The fetch service failed — retry later"
      },
      "Error503": {
        "content": {
          "application/json": {
            "examples": {
              "upstream-unavailable": {
                "summary": "Code 16005 — the fetch service is unreachable",
                "value": {
                  "code": 16005,
                  "message": "the fetch service is unreachable, please retry later",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The fetch service is unreachable — retry later"
      },
      "Error504": {
        "content": {
          "application/json": {
            "examples": {
              "upstream-timeout": {
                "summary": "Code 16001 — the fetch service timed out",
                "value": {
                  "code": 16001,
                  "message": "the request timed out, please retry later",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The fetch service did not answer in time — retry later"
      },
      "Success": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        },
        "description": "Success (HTTP 200, `code` is 0)",
        "headers": {
          "Cache-Control": {
            "description": "Always `no-store` for capability responses.",
            "schema": {
              "type": "string"
            }
          },
          "X-Upstream-Request-Id": {
            "description": "The platform's own request identifier; quote it together with `request_id` in support requests.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "WatchCheckListSuccess": {
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WatchCheckListData"
                    }
                  },
                  "type": "object"
                }
              ]
            }
          }
        },
        "description": "Success; the page is nested as `data.data` (`checks`, `next_cursor`)",
        "headers": {
          "Cache-Control": {
            "description": "Always `no-store`.",
            "schema": {
              "type": "string"
            }
          },
          "X-Upstream-Request-Id": {
            "description": "The platform's own request identifier.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "WatchJobListSuccess": {
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WatchJobListData"
                    }
                  },
                  "type": "object"
                }
              ]
            }
          }
        },
        "description": "Success; the page is nested as `data.data` (`jobs`, `next_cursor`)",
        "headers": {
          "Cache-Control": {
            "description": "Always `no-store`.",
            "schema": {
              "type": "string"
            }
          },
          "X-Upstream-Request-Id": {
            "description": "The platform's own request identifier.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "WatchJobSuccess": {
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WatchJobData"
                    }
                  },
                  "type": "object"
                }
              ]
            }
          }
        },
        "description": "Success; the job is nested as `data.data.job` (plus a one-time `webhook_secret` when a new callback URL was registered)",
        "headers": {
          "Cache-Control": {
            "description": "Always `no-store`.",
            "schema": {
              "type": "string"
            }
          },
          "X-Upstream-Request-Id": {
            "description": "The platform's own request identifier.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "Error410": {
        "content": {
          "application/json": {
            "examples": {
              "result-expired": {
                "summary": "Code 11006 — the replay result was not retained, or the object is gone",
                "value": {
                  "code": 11006,
                  "message": "the requested result is no longer available",
                  "request_id": "req_6a99053110d62d17"
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The result existed but is no longer available — do not retry"
      }
    },
    "schemas": {
      "AccountData": {
        "properties": {
          "auth_method": {
            "description": "Which credential form this call used.",
            "enum": [
              "api_key",
              "session"
            ],
            "type": "string"
          },
          "credential_source": {
            "description": "Where the credential was read from.",
            "enum": [
              "bearer",
              "cookie"
            ],
            "type": "string"
          },
          "daily_credit_quota": {
            "description": "Daily credit limit for this key; `0` means unlimited.",
            "type": "integer"
          },
          "key_id": {
            "description": "Public identifier of the API key; empty for session calls.",
            "type": "string"
          },
          "scope_enforced": {
            "description": "`true` when scopes are enforced (API key calls), `false` for sessions.",
            "type": "boolean"
          },
          "scopes": {
            "description": "Scopes carried by this credential, for example `extract` or `search`. Empty for session calls.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "user_id": {
            "description": "Account id.",
            "type": "integer"
          }
        },
        "required": [
          "auth_method",
          "user_id",
          "scopes",
          "daily_credit_quota",
          "credential_source",
          "scope_enforced"
        ],
        "type": "object"
      },
      "Envelope": {
        "properties": {
          "code": {
            "description": "Application code — `0` on success.",
            "example": 0,
            "type": "integer"
          },
          "data": {
            "additionalProperties": true,
            "description": "The fetch service's response body, projected verbatim (internal fields removed).",
            "type": "object"
          },
          "message": {
            "example": "success",
            "type": "string"
          },
          "request_id": {
            "description": "flowda's identifier for this call. Quote it in support requests.",
            "example": "req_6a99053110d62d17",
            "pattern": "^req_[0-9a-z]+$",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "request_id"
        ],
        "type": "object"
      },
      "ErrorEnvelope": {
        "properties": {
          "code": {
            "description": "Non-zero application code. Which code is possible depends on the HTTP\nstatus — the error table in the introduction is the complete mapping.",
            "type": "integer"
          },
          "data": {
            "additionalProperties": true,
            "description": "Optional, and used by **one** failure only: a scope denial (`403` with code\n`12015`) carries `required_scope` here, naming the scope the key lacks.\nEvery other failure omits `data` entirely.",
            "type": "object"
          },
          "details": {
            "description": "The fetch service's explanation, present only for the codes marked in the\nerror table. Usually names the offending field.\n",
            "example": [
              "The request body is invalid(url)."
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "message": {
            "description": "Customer-facing description of what happened; it belongs to `code`.",
            "type": "string"
          },
          "request_id": {
            "description": "flowda's identifier for this call. Quote it in support requests.",
            "example": "req_6a99053110d62d17",
            "pattern": "^req_[0-9a-z]+$",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "request_id"
        ],
        "type": "object"
      },
      "ExtractData": {
        "properties": {
          "credits_used": {
            "description": "1 on a cache hit; otherwise 1 / 3 / 5 by strategy.",
            "type": "integer"
          },
          "meta": {
            "properties": {
              "cache_hit": {
                "description": "Whether a platform snapshot was reused.",
                "type": "boolean"
              },
              "cache_time": {
                "description": "When the reused snapshot was stored.",
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "completed_at": {
                "description": "When it completed (UTC, whole seconds).",
                "format": "date-time",
                "type": "string"
              },
              "created_at": {
                "description": "When the request was accepted (UTC, whole seconds).",
                "format": "date-time",
                "type": "string"
              },
              "response_time_ms": {
                "description": "Processing time in milliseconds — use this, not the difference of the timestamps.",
                "type": "integer"
              },
              "result": {
                "$ref": "#/components/schemas/PlatformMetaResult"
              },
              "strategy_used": {
                "description": "Strategy used, which drives the price.",
                "enum": [
                  "X1",
                  "X2",
                  "X3"
                ],
                "type": "string"
              }
            },
            "type": "object"
          },
          "outputs": {
            "description": "Exactly the representations you requested: `markdown`, `raw_html`,\n`clean_html` and/or `links`. An empty string means \"requested and produced,\nbut nothing matched\"; `null` means \"requested but could not be produced\".\n",
            "properties": {
              "clean_html": {
                "nullable": true,
                "type": "string"
              },
              "links": {
                "items": {
                  "type": "string"
                },
                "nullable": true,
                "type": "array"
              },
              "markdown": {
                "nullable": true,
                "type": "string"
              },
              "raw_html": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "request_id": {
            "description": "The platform's request identifier.",
            "type": "string"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "ExtractRequest": {
        "properties": {
          "advanced_mode": {
            "default": true,
            "description": "Allow the fetch service to escalate based on page signals.",
            "type": "boolean"
          },
          "country": {
            "description": "Access region, two letters.",
            "example": "US",
            "type": "string"
          },
          "exclude_tags": {
            "description": "CSS selectors of nodes to drop.",
            "example": [],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "formats": {
            "description": "Representations to produce; no duplicates.",
            "example": [
              "markdown"
            ],
            "items": {
              "enum": [
                "markdown",
                "raw_html",
                "clean_html",
                "links"
              ],
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Headers forwarded to the target site; forces a cache bypass and marks the URL for 48 hours.",
            "example": {},
            "type": "object"
          },
          "include_tags": {
            "description": "CSS selectors of nodes to keep.",
            "example": [],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "max_age_ms": {
            "default": 172800000,
            "description": "Maximum acceptable snapshot age; 0 forces a fresh fetch.",
            "format": "int64",
            "maximum": 172800000,
            "minimum": 0,
            "type": "integer"
          },
          "only_main_content": {
            "default": true,
            "description": "Keep the article body only.",
            "type": "boolean"
          },
          "timeout_ms": {
            "default": 60000,
            "description": "Budget for the whole call.",
            "format": "int64",
            "maximum": 120000,
            "minimum": 1000,
            "type": "integer"
          },
          "url": {
            "description": "Absolute http(s) URL of the page to fetch.",
            "example": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching",
            "type": "string"
          },
          "wait_for_ms": {
            "default": 0,
            "description": "Extra wait after page load; must be at most half of timeout_ms.",
            "format": "int64",
            "maximum": 30000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "MapData": {
        "properties": {
          "credits_used": {
            "description": "Absent when nothing was billed.",
            "type": "integer"
          },
          "meta": {
            "properties": {
              "completed_at": {
                "format": "date-time",
                "type": "string"
              },
              "count": {
                "type": "integer"
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "response_time_ms": {
                "type": "integer"
              },
              "result": {
                "$ref": "#/components/schemas/PlatformMetaResult"
              }
            },
            "type": "object"
          },
          "outputs": {
            "description": "Discovered URLs; `null` when nothing was found.",
            "items": {
              "properties": {
                "description": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "MapRequest": {
        "properties": {
          "country": {
            "default": "US",
            "description": "Access region, uppercase two-letter code.",
            "type": "string"
          },
          "domain_filter": {
            "default": "all",
            "description": "`domain` keeps same-host links only.",
            "enum": [
              "domain",
              "all"
            ],
            "type": "string"
          },
          "limit": {
            "default": 5000,
            "maximum": 100000,
            "minimum": 1,
            "type": "integer"
          },
          "sitemap": {
            "default": "include",
            "description": "How sitemaps are used.",
            "enum": [
              "skip",
              "include",
              "only"
            ],
            "type": "string"
          },
          "url": {
            "description": "Site to enumerate; the host must be publicly resolvable.",
            "example": "https://www.example.com",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "PlatformFailure": {
        "description": "The fetch service reports a business failure inside an HTTP 200 response.\nTreat `success: false` as a failed call.\n",
        "properties": {
          "code": {
            "description": "Platform error code, for example `TARGET_DNS_ERROR`, `TEMPLATE_MISMATCH`, `TARGET_ALL_ENGINES_FAILED`.",
            "example": "TARGET_DNS_ERROR",
            "type": "string"
          },
          "message": {
            "description": "Platform description of the failure.",
            "example": "The target host could not be resolved.",
            "type": "string"
          },
          "request_id": {
            "description": "The platform's own request identifier.",
            "type": "string"
          },
          "success": {
            "enum": [
              false
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "code",
          "message"
        ],
        "type": "object"
      },
      "PlatformMetaResult": {
        "description": "Facts about the target page.",
        "properties": {
          "final_url": {
            "description": "The URL after redirects; compare with `url` to detect a redirect.",
            "nullable": true,
            "type": "string"
          },
          "status_code": {
            "description": "The target site's HTTP status. `null` when the fetch service could not observe one — never assume 200.",
            "nullable": true,
            "type": "integer"
          },
          "url": {
            "description": "The URL you requested.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RegionListData": {
        "properties": {
          "regions": {
            "description": "Every enabled region, ordered by `code`. Empty when none is enabled.\nEach entry is `{code, name_en}` and nothing else.\n",
            "items": {
              "properties": {
                "code": {
                  "description": "ISO 3166-1 alpha-2 code — the value to send as `country`.",
                  "example": "US",
                  "pattern": "^[A-Z]{2}$",
                  "type": "string"
                },
                "name_en": {
                  "description": "English name of the region, for display.",
                  "example": "United States",
                  "type": "string"
                }
              },
              "required": [
                "code",
                "name_en"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "regions"
        ],
        "type": "object"
      },
      "SearchCountryListData": {
        "properties": {
          "countries": {
            "description": "Every supported search country, ordered by `code`. Each entry is\n`{code, name_en}` and nothing else. `code` is uppercase.\n",
            "items": {
              "$ref": "#/components/schemas/SearchEnumItem"
            },
            "type": "array"
          }
        },
        "required": [
          "countries"
        ],
        "type": "object"
      },
      "SearchData": {
        "properties": {
          "credits_used": {
            "description": "Billed credits; 0 when nothing was returned.",
            "type": "number"
          },
          "meta": {
            "properties": {
              "completed_at": {
                "format": "date-time",
                "type": "string"
              },
              "count": {
                "description": "Number of results returned.",
                "type": "integer"
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "response_time_ms": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "outputs": {
            "description": "Results; `null` when the query returned nothing.",
            "items": {
              "properties": {
                "date": {
                  "description": "Human-readable recency, for example `3 days ago`; only for sources that report it.",
                  "nullable": true,
                  "type": "string"
                },
                "extract": {
                  "description": "Present only with `extract_content: true`; a per-result extraction failure is reported here, not as a failed search.",
                  "nullable": true,
                  "properties": {
                    "code": {
                      "description": "Set when this single extraction failed.",
                      "type": "string"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "message": {
                      "description": "Why this single extraction failed.",
                      "type": "string"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ExtractData/properties/meta"
                    },
                    "outputs": {
                      "properties": {
                        "clean_html": {
                          "nullable": true,
                          "type": "string"
                        },
                        "links": {
                          "items": {
                            "type": "string"
                          },
                          "nullable": true,
                          "type": "array"
                        },
                        "markdown": {
                          "nullable": true,
                          "type": "string"
                        },
                        "raw_html": {
                          "nullable": true,
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "position": {
                  "description": "1-based rank.",
                  "type": "integer"
                },
                "snippet": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "nullable": true,
                  "type": "string"
                },
                "url": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "SearchEnumItem": {
        "properties": {
          "code": {
            "description": "The value to send in the request field.",
            "example": "US",
            "type": "string"
          },
          "name_en": {
            "description": "English name, for display.",
            "example": "United States",
            "type": "string"
          }
        },
        "required": [
          "code",
          "name_en"
        ],
        "type": "object"
      },
      "SearchLanguageListData": {
        "properties": {
          "languages": {
            "description": "Every supported search interface language, ordered by `code`. Each entry is\n`{code, name_en}` and nothing else. `code` is case-sensitive.\n",
            "items": {
              "$ref": "#/components/schemas/SearchEnumItem"
            },
            "type": "array"
          }
        },
        "required": [
          "languages"
        ],
        "type": "object"
      },
      "SearchRequest": {
        "properties": {
          "country": {
            "description": "Uppercase two-letter country code from the supported list.",
            "example": "US",
            "type": "string"
          },
          "extract_content": {
            "default": false,
            "description": "Also extract the content of every result.",
            "type": "boolean"
          },
          "extract_options": {
            "description": "Options for the inline extraction; only allowed when `extract_content` is true.",
            "properties": {
              "advanced_mode": {
                "default": true,
                "type": "boolean"
              },
              "exclude_tags": {
                "example": [],
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "formats": {
                "items": {
                  "enum": [
                    "markdown",
                    "raw_html",
                    "clean_html",
                    "links"
                  ],
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true
              },
              "include_tags": {
                "example": [],
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "max_age_ms": {
                "default": 172800000,
                "maximum": 172800000,
                "minimum": 0,
                "type": "integer"
              },
              "only_main_content": {
                "default": true,
                "type": "boolean"
              },
              "timeout_ms": {
                "default": 60000,
                "maximum": 120000,
                "minimum": 1000,
                "type": "integer"
              },
              "wait_for_ms": {
                "default": 0,
                "maximum": 30000,
                "minimum": 0,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "language": {
            "description": "Preferred result language, for example `en` or `pt-br`.",
            "example": "en",
            "type": "string"
          },
          "max_results": {
            "default": 10,
            "description": "Upper bound on results, not an exact count.",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "query": {
            "description": "The query, 1–256 characters.",
            "example": "espresso machine",
            "maxLength": 256,
            "minLength": 1,
            "type": "string"
          },
          "source": {
            "default": "web",
            "description": "Which corpus to search.",
            "enum": [
              "web",
              "news",
              "shopping",
              "scholar"
            ],
            "type": "string"
          },
          "time_range": {
            "description": "Recency filter.",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "TemplateCatalogData": {
        "description": "The fetch service's catalogue body, nested as `data.data`.",
        "properties": {
          "data": {
            "properties": {
              "templates": {
                "description": "Callable templates; `null` when there are none. Order is not guaranteed.",
                "items": {
                  "$ref": "#/components/schemas/TemplateSummary"
                },
                "nullable": true,
                "type": "array"
              }
            },
            "type": "object"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TemplateData": {
        "properties": {
          "credits_used": {
            "description": "Flat 5 credits per execution, including a successful but empty result.",
            "type": "integer"
          },
          "meta": {
            "properties": {
              "completed_at": {
                "format": "date-time",
                "type": "string"
              },
              "count": {
                "description": "Number of records; 0 when `outputs` is null.",
                "type": "integer"
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "fields": {
                "additionalProperties": {
                  "properties": {
                    "description": {
                      "description": "Human-readable description of this field for this template.",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "description": "Description of each record field that applies to this template, keyed by\nfield path (for example `variants[].price`).\n",
                "type": "object"
              },
              "response_time_ms": {
                "type": "integer"
              },
              "result": {
                "properties": {
                  "pages": {
                    "items": {
                      "properties": {
                        "final_url": {
                          "description": "Page after redirects.",
                          "type": "string"
                        },
                        "status_code": {
                          "description": "Target site's HTTP status.",
                          "type": "integer"
                        },
                        "url": {
                          "description": "Page that was requested.",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "maxItems": 1,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "outputs": {
            "description": "One record per item; fields and nesting are defined by the template's output schema.",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "TemplateDetailData": {
        "description": "The fetch service's template-description body, nested as `data.data`.",
        "properties": {
          "data": {
            "properties": {
              "description": {
                "type": "string"
              },
              "execution": {
                "description": "How to invoke this template.",
                "properties": {
                  "headers": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Placeholder headers — `Bearer \u003capi_key\u003e` is not a real key.",
                    "type": "object"
                  },
                  "method": {
                    "enum": [
                      "POST"
                    ],
                    "type": "string"
                  },
                  "url": {
                    "enum": [
                      "/v1/template"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "name": {
                "type": "string"
              },
              "output_schema": {
                "additionalProperties": true,
                "description": "JSON Schema of the **whole** success response for this template,\nincluding `meta.fields`.\n",
                "type": "object"
              },
              "params_schema": {
                "additionalProperties": true,
                "description": "JSON Schema (Draft 2020-12) of the **whole** `POST /v1/template` request\nbody for this template: `template` is pinned by `const`, `params` carries\nthe per-template keys with `additionalProperties: false`.\n",
                "type": "object"
              },
              "request_example": {
                "additionalProperties": true,
                "description": "Ready-to-send request body that satisfies `params_schema`.",
                "type": "object"
              },
              "response_example": {
                "additionalProperties": true,
                "description": "A success response example that satisfies `output_schema`. The values are\nplaceholders (`req_template_example`, `snap_template_example`), and any\n`snapshot_id` in it is removed from the response we send you.\n",
                "type": "object"
              },
              "template_id": {
                "description": "Public template name, matching the path.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TemplateRequest": {
        "properties": {
          "params": {
            "additionalProperties": true,
            "description": "Template input. The exact schema (including the identifier key) is\n`data.data.params_schema` from `GET /v1/templates/{template_id}`; it describes\nthe whole request body (`template` plus `params`), and unknown keys are rejected.\n",
            "example": {
              "query": "wireless headphones",
              "zipcode": "90017"
            },
            "type": "object"
          },
          "template": {
            "description": "Template to run; the current catalogue is `GET /v1/templates`.",
            "example": "walmart_search",
            "type": "string"
          }
        },
        "required": [
          "template",
          "params"
        ],
        "type": "object"
      },
      "TemplateSummary": {
        "properties": {
          "description": {
            "example": "Collects an Amazon US product detail page by ASIN.",
            "type": "string"
          },
          "name": {
            "example": "Amazon Product",
            "type": "string"
          },
          "template_id": {
            "description": "Public template name; pass it as `template` to `POST /v1/template`.",
            "example": "amazon_product",
            "type": "string"
          }
        },
        "required": [
          "template_id",
          "name",
          "description"
        ],
        "type": "object"
      },
      "WatchCheck": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "check_id": {
            "type": "string"
          },
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "code": {
            "description": "Set when this check itself failed, for example `TARGET_SITE_ERROR` or `INTERNAL_ERROR`.",
            "nullable": true,
            "type": "string"
          },
          "content_hash": {
            "nullable": true,
            "type": "string"
          },
          "credits_used": {
            "type": "number"
          },
          "diff_summary": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "is_baseline": {
            "type": "boolean"
          },
          "job_id": {
            "type": "string"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "result": {
            "$ref": "#/components/schemas/PlatformMetaResult"
          },
          "selector_matched": {
            "type": "boolean"
          },
          "strategy_used": {
            "nullable": true,
            "type": "string"
          },
          "trigger": {
            "enum": [
              "manual",
              "scheduled"
            ],
            "type": "string"
          },
          "webhook_delivery": {
            "$ref": "#/components/schemas/WatchDelivery"
          }
        },
        "type": "object"
      },
      "WatchCheckListData": {
        "description": "The platform's check-history body, projected verbatim, so the page sits at `data.data`.\n",
        "properties": {
          "data": {
            "properties": {
              "checks": {
                "description": "Check history, newest first; `null` when empty.",
                "items": {
                  "$ref": "#/components/schemas/WatchCheck"
                },
                "nullable": true,
                "type": "array"
              },
              "next_cursor": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "WatchCheckMeta": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "check_id": {
            "example": "chk_XTpNp2SRIsYu0rWRxNM6LA",
            "type": "string"
          },
          "checked_at": {
            "description": "When the page content was fetched.",
            "format": "date-time",
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "type": "string"
          },
          "content_hash": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "diff_summary": {
            "description": "Human-readable summary, for example `1 line modified`; empty when nothing changed.",
            "type": "string"
          },
          "error": {
            "description": "Monitoring problem (fetch, selector, diff). A non-empty value does not mean the run failed; it means no baseline or diff was produced.",
            "type": "string"
          },
          "is_baseline": {
            "description": "`true` on the first successful fetch: it only establishes the baseline, so `changed` is false and `diff` is null.",
            "type": "boolean"
          },
          "job_id": {
            "example": "job_N5HX0z7rZQ7DloP8gLgSWE",
            "type": "string"
          },
          "response_time_ms": {
            "type": "integer"
          },
          "result": {
            "$ref": "#/components/schemas/PlatformMetaResult"
          },
          "selector_matched": {
            "type": "boolean"
          },
          "strategy_used": {
            "description": "`null` when the fetch failed.",
            "enum": [
              "X1",
              "X2",
              "X3"
            ],
            "nullable": true,
            "type": "string"
          },
          "trigger": {
            "description": "`manual` for this endpoint.",
            "enum": [
              "manual",
              "scheduled"
            ],
            "type": "string"
          },
          "webhook_delivery": {
            "$ref": "#/components/schemas/WatchDelivery"
          }
        },
        "type": "object"
      },
      "WatchCheckRunData": {
        "description": "Result of a synchronous check — note the flat shape.",
        "properties": {
          "credits_used": {
            "description": "1 / 3 / 5 by strategy; 0 when the fetch failed.",
            "type": "integer"
          },
          "diff": {
            "$ref": "#/components/schemas/WatchDiff"
          },
          "meta": {
            "$ref": "#/components/schemas/WatchCheckMeta"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "WatchDeleteData": {
        "description": "The platform's delete body, projected verbatim, so its own `data` is `null`.",
        "properties": {
          "data": {
            "description": "Always `null`; a delete leaves no job projection to return.",
            "nullable": true,
            "type": "object"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "WatchDelivery": {
        "nullable": true,
        "properties": {
          "attempt_count": {
            "type": "integer"
          },
          "last_error": {
            "nullable": true,
            "type": "string"
          },
          "next_retry_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "delivered",
              "failed",
              "retrying"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WatchDiff": {
        "description": "Differences between the previous and current content; `null` when nothing changed or when the check only established the baseline.",
        "nullable": true,
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "hunks": {
            "items": {
              "properties": {
                "after": {
                  "description": "New value."
                },
                "before": {
                  "description": "Previous value (string, number, boolean or null)."
                },
                "change_type": {
                  "enum": [
                    "added",
                    "removed",
                    "modified"
                  ],
                  "type": "string"
                },
                "path": {
                  "description": "Selector path or JSON pointer of the change.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "mode": {
            "description": "Which view this diff is; with both modes requested the same structure also appears under `views.text` / `views.json`.",
            "enum": [
              "text",
              "json"
            ],
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/WatchDiffSummary"
          },
          "truncated": {
            "description": "Whether the diff was truncated.",
            "type": "boolean"
          },
          "unified_diff": {
            "description": "Unified diff text for the `text` view.",
            "nullable": true,
            "type": "string"
          },
          "views": {
            "additionalProperties": true,
            "description": "Present when both diff modes were requested.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "WatchDiffSummary": {
        "properties": {
          "added_lines": {
            "type": "integer"
          },
          "change_ratio": {
            "type": "number"
          },
          "modified_lines": {
            "type": "integer"
          },
          "removed_lines": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WatchEvent": {
        "description": "The change event we post to your callback address. It is the platform's event\nre-serialized by flowda — key order differs from the platform's own logs — so verify\nthe signature over the bytes you actually received.\n",
        "properties": {
          "data": {
            "properties": {
              "check": {
                "properties": {
                  "changed": {
                    "type": "boolean"
                  },
                  "check_id": {
                    "type": "string"
                  },
                  "checked_at": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "diff_summary": {
                    "description": "One-line summary of the change, for example `1 line modified`.",
                    "type": "string"
                  },
                  "result": {
                    "$ref": "#/components/schemas/PlatformMetaResult"
                  }
                },
                "required": [
                  "check_id",
                  "checked_at",
                  "changed"
                ],
                "type": "object"
              },
              "diff": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WatchDiff"
                  }
                ],
                "description": "The change itself; present only when `changed` is `true`. `hunks[].path` is a\nCSS/XPath selector, a JSON pointer, or a line marker such as `L683`, depending\non the job's selectors and `diff_modes`.\n"
              },
              "job": {
                "properties": {
                  "job_id": {
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "active",
                      "paused",
                      "errored"
                    ],
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "job_id",
                  "url",
                  "status"
                ],
                "type": "object"
              }
            },
            "required": [
              "job",
              "check"
            ],
            "type": "object"
          },
          "delivered_at": {
            "description": "Unix seconds when the platform created the event. It is **not** the signature\ntimestamp: that one is set when we hand the request to you, so it can be a few\nseconds later, and later still on a retry.\n",
            "format": "int64",
            "type": "integer"
          },
          "event": {
            "description": "The only event type currently delivered.",
            "enum": [
              "watch.change_detected"
            ],
            "type": "string"
          }
        },
        "required": [
          "event",
          "delivered_at",
          "data"
        ],
        "type": "object"
      },
      "WatchJob": {
        "description": "A monitoring job. `job_id` here is the `{id}` in the request paths.",
        "properties": {
          "consecutive_failures": {
            "type": "integer"
          },
          "country": {
            "description": "Uppercase; defaults to US.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "diff_modes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "job_id": {
            "example": "job_N5HX0z7rZQ7DloP8gLgSWE",
            "type": "string"
          },
          "last_check_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "last_content_hash": {
            "nullable": true,
            "type": "string"
          },
          "last_error": {
            "nullable": true,
            "properties": {
              "at": {
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "Same text as the originating check's `error`.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "mask": {
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "exclude": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "next_run_at": {
            "description": "Next run, jittered by up to 10% of the interval; `null` while paused or errored.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "retention_days": {
            "type": "integer"
          },
          "schedule": {
            "$ref": "#/components/schemas/WatchSchedule"
          },
          "selector": {
            "nullable": true,
            "type": "string"
          },
          "selector_type": {
            "description": "Defaults to `css` when unset.",
            "enum": [
              "css",
              "xpath"
            ],
            "type": "string"
          },
          "status": {
            "description": "`errored` means 5 consecutive failures; a later success returns the job to `active`.",
            "enum": [
              "active",
              "paused",
              "errored"
            ],
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "webhook_url": {
            "description": "Your own address; `null` when no callback is configured.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "WatchJobCreateRequest": {
        "properties": {
          "country": {
            "description": "Access region for the checks.",
            "example": "US",
            "type": "string"
          },
          "diff_modes": {
            "description": "`auto` cannot be combined with `text`/`json`; no duplicates.",
            "items": {
              "enum": [
                "auto",
                "text",
                "json"
              ],
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Extra headers for the checks.",
            "type": "object"
          },
          "mask": {
            "description": "Noise reduction applied before diffing.",
            "properties": {
              "enabled": {
                "default": false,
                "type": "boolean"
              },
              "exclude": {
                "items": {
                  "enum": [
                    "iso_timestamp",
                    "unix_timestamp",
                    "relative_time",
                    "counter",
                    "uuid",
                    "session_token",
                    "tracking_param",
                    "cache_buster",
                    "resource_hash",
                    "iframe_marker"
                  ],
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "retention_days": {
            "default": 30,
            "description": "Check-history retention; 0 keeps history indefinitely.",
            "maximum": 365,
            "minimum": 0,
            "type": "integer"
          },
          "schedule": {
            "$ref": "#/components/schemas/WatchSchedule"
          },
          "selector": {
            "description": "Monitor only part of the page.",
            "example": "main .price",
            "type": "string"
          },
          "selector_type": {
            "default": "css",
            "enum": [
              "css",
              "xpath"
            ],
            "type": "string"
          },
          "timezone": {
            "default": "UTC",
            "description": "IANA timezone name; affects `cron` schedules only.",
            "type": "string"
          },
          "url": {
            "description": "Page to monitor; immutable afterwards.",
            "example": "https://www.example.com/pricing",
            "type": "string"
          },
          "webhook_url": {
            "description": "Callback for change events; https, a public host and port 80/443 are required. Rewritten to flowda's relay before it reaches the platform.",
            "example": null,
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "url",
          "schedule"
        ],
        "type": "object"
      },
      "WatchJobData": {
        "description": "The platform's job body, projected verbatim, so the job sits at `data.data.job`.\n",
        "properties": {
          "data": {
            "properties": {
              "job": {
                "$ref": "#/components/schemas/WatchJob"
              },
              "webhook_secret": {
                "description": "Returned **once**, and only when `webhook_url` registered a callback address\nthis account had not used before. It is the HMAC key our callbacks are signed\nwith; `POST /v1/watch/jobs` documents the headers and the string we sign.\n",
                "type": "string"
              },
              "webhook_secret_note": {
                "description": "Present together with `webhook_secret`; reminds you that the secret is shown only once.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "request_id": {
            "description": "The platform's request identifier.",
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "WatchJobListData": {
        "description": "The platform's job-list body, projected verbatim, so the page sits at `data.data`.\n",
        "properties": {
          "data": {
            "properties": {
              "jobs": {
                "description": "Your jobs; `null` when the account has none.",
                "items": {
                  "$ref": "#/components/schemas/WatchJob"
                },
                "nullable": true,
                "type": "array"
              },
              "next_cursor": {
                "description": "Pass this back as `cursor`; `null` on the last page.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "request_id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "WatchJobUpdateRequest": {
        "description": "Partial update; omitted fields are unchanged. `webhook_url: null` removes the\ncallback. `url` cannot be changed and `schedule: null` is rejected.\n",
        "properties": {
          "country": {
            "example": "US",
            "type": "string"
          },
          "diff_modes": {
            "items": {
              "enum": [
                "auto",
                "text",
                "json"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "mask": {
            "example": {
              "enabled": false,
              "exclude": [
                "iso_timestamp"
              ]
            },
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "exclude": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "retention_days": {
            "maximum": 365,
            "minimum": 0,
            "type": "integer"
          },
          "schedule": {
            "$ref": "#/components/schemas/WatchSchedule"
          },
          "selector": {
            "description": "Monitor only part of the page.",
            "example": "main .price",
            "type": "string"
          },
          "selector_type": {
            "enum": [
              "css",
              "xpath"
            ],
            "example": "css",
            "type": "string"
          },
          "timezone": {
            "example": "UTC",
            "type": "string"
          },
          "webhook_url": {
            "example": null,
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "WatchSchedule": {
        "description": "Exactly one of `interval_seconds` (UTC, 60–2592000 seconds) or `cron` (five-field expression, interpreted in `timezone`).",
        "example": {
          "interval_seconds": 3600
        },
        "oneOf": [
          {
            "not": {
              "required": [
                "cron"
              ]
            },
            "required": [
              "interval_seconds"
            ]
          },
          {
            "not": {
              "required": [
                "interval_seconds"
              ]
            },
            "required": [
              "cron"
            ]
          }
        ],
        "properties": {
          "cron": {
            "example": "0 9 * * 1-5",
            "type": "string"
          },
          "interval_seconds": {
            "maximum": 2592000,
            "minimum": 60,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ReplayData": {
        "additionalProperties": true,
        "description": "The platform's original response body for the replayed call, projected verbatim\ninto `data` — the same shape `POST /v1/extract`, `POST /v1/template`,\n`POST /v1/search` or `POST /v1/map` returned when the call was made.\n\n`request_id` here is the **original** platform request id (the one you replayed),\nnot the id of this replay call; the envelope's `request_id` is this call's.\nInternal fields (for example `meta.snapshot_id`) are removed, exactly as on the\noriginal response.\n",
        "properties": {
          "code": {
            "description": "Platform error code of the original call; present only when `success` is `false`.",
            "type": "string"
          },
          "credits_used": {
            "description": "Credits the **original** call was billed; a replay is never billed again.",
            "type": "number"
          },
          "data": {
            "description": "Original payload, when the replayed call nests its result (watch).",
            "type": "object"
          },
          "message": {
            "description": "Platform explanation; present only when `success` is `false`.",
            "type": "string"
          },
          "meta": {
            "description": "Original platform metadata; `meta.snapshot_id` is removed.",
            "type": "object"
          },
          "outputs": {
            "description": "Original outputs (extract / search / template / map).",
            "type": [
              "array",
              "object",
              "null"
            ]
          },
          "request_id": {
            "description": "The original platform request id.",
            "type": "string"
          },
          "success": {
            "description": "Outcome of the **original** call. `false` means the call you replayed had\nfailed; the replay itself succeeded (HTTP 200, envelope `code: 0`).\n",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "request_id"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "bearerFormat": "flw_\u003cenv\u003e_\u003ckey_id\u003e_\u003csecret\u003e",
        "description": "An API key created in the console. Per-endpoint scopes are enforced.",
        "scheme": "bearer",
        "type": "http"
      },
      "apiKeyHeader": {
        "description": "The same API key sent as a plain header instead of a bearer token.",
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      },
      "bearerAuth": {
        "bearerFormat": "JWT",
        "description": "Session token obtained by signing in to the console. This service only verifies\nit — it never issues one. A session is the account owner and is not restricted\nby scopes.\n",
        "scheme": "bearer",
        "type": "http"
      },
      "cookieAuth": {
        "description": "The same session token as a cookie. Browsers send it automatically on the shared\ndomain; write requests additionally check the request origin (CSRF protection).\n",
        "in": "cookie",
        "name": "flowda_token",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "One API key for the four retrieval capabilities (extract, template, search, map)\nplus change monitoring (watch), all running on flowda's fetch network.\n\n* **Base URL** — the host this documentation is served from\n  (production: `https://openapi.flowda.ai`).\n* **Response body** — every capability endpoint returns the fetch platform's own\n  response body, projected verbatim into `data`. Field names and semantics therefore\n  match the platform contract; the only exception is that internal fields\n  (for example `meta.snapshot_id`, the platform's snapshot storage path) are **removed**.\n\n## Credentials\n\nThree credential forms are accepted, all of them scoped to your account:\n\n| How | Header | Notes |\n| --- | --- | --- |\n| API key | `Authorization: Bearer flw_\u003cenv\u003e_\u003ckey_id\u003e_\u003csecret\u003e` | Created in the console. Per-endpoint `scope` is enforced. |\n| API key | `X-API-Key: \u003ckey\u003e` | Equivalent form; `Authorization` wins when both are present. |\n| Session | `Authorization: Bearer \u003cJWT\u003e` or the `flowda_token` cookie | Obtained by signing in to the console. A session is the account owner, so **scopes are not enforced**. |\n\nScopes: `extract` (extract, template, templates), `search`, `map`, `watch`.\nA key that lacks a scope gets **403 with code 12015** (not 401) — the credential is\nvalid, the grant is not; `data.required_scope` names the scope you need.\n`GET /v1/account` tells you which scopes your key carries.\n\n## Response envelope\n\nSuccess — HTTP 200, `code` is `0`:\n\n```json\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"request_id\": \"req_6a99053110d62d17\",\n  \"data\": {\n    \"success\": true,\n    \"request_id\": \"req_01K7XT3B6C9D4M2Q\",\n    \"credits_used\": 1,\n    \"outputs\": { \"markdown\": \"# Example\" },\n    \"meta\": { \"strategy_used\": \"X1\", \"cache_hit\": true }\n  }\n}\n```\n\nFailure — the HTTP status is the one in the table below and `code` is a non-zero\napplication code. Every failure body has `code`, `message` and `request_id`; the\nonly optional members are `details` and, for a single code, `data`:\n\n```json\n{\n  \"code\": 16002,\n  \"message\": \"the request was rejected, see details\",\n  \"request_id\": \"req_6a99053110d62d17\",\n  \"details\": [\"The request body is invalid(url).\"]\n}\n```\n\n`details` is present only for the codes marked *yes* in the error table: it carries\nthe reason the request failed — for 16xxx codes that is the fetch service's own\nexplanation (usually naming the exact field), for the rest it is ours — and it is\nthe fastest way to fix a rejected call.\n\n`data` is present on **exactly one** failure: a scope denial (`403` with code\n`12015`) puts the missing scope in `data.required_scope`, because that is the one\nfield the caller needs in order to fix the key:\n\n```json\n{\n  \"code\": 12015,\n  \"message\": \"api key scope denied\",\n  \"request_id\": \"req_6a99053110d62d17\",\n  \"data\": { \"required_scope\": \"map\" }\n}\n```\n\nEvery other failure omits `data`, so a failure handler must treat it as optional\nrather than required or forbidden.\n\n## ⚠️ Check `data.success`, not just the status code\n\nThe fetch platform reports \"the target could not be retrieved\" **inside a 200\nresponse**: HTTP 200, outer `code: 0`, but `data.success: false` with a platform\ncode and message:\n\n```json\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"request_id\": \"req_a1b2c3d4e5f60718\",\n  \"data\": {\n    \"success\": false,\n    \"code\": \"TARGET_DNS_ERROR\",\n    \"message\": \"The target host could not be resolved.\",\n    \"request_id\": \"core-req-9f2c1b\"\n  }\n}\n```\n\nSo a client must treat `data.success === false` as a failed call even though the\nstatus is 200. (The same rule is applied to your call log: such a call is recorded\nas **failed**, with the platform code and reason attached.)\n`data.success` is always present for capability calls.\n\n### What `data.code` can contain\n\n`data.code` is an uppercase string owned by the fetch service. The lists below are\nthe codes that endpoint can currently produce; anything else should be handled like\n`UNKNOWN_ERROR`.\n\n**extract** — `TARGET_TIMEOUT`, `TARGET_DNS_ERROR` (the host, or a redirect target,\ncould not be resolved), `TARGET_SSL_ERROR`, `TARGET_SITE_ERROR` (unreachable,\nredirect loop, invalid redirect, non-routable address), `TARGET_ALL_ENGINES_FAILED`\n(every retrieval engine failed, or the page has no readable content — a\nJavaScript-only page also lands here: retry with `advanced_mode`),\n`TARGET_UNSUPPORTED_FILE_TYPE` (the target is a file type we do not deliver),\n`UNKNOWN_ERROR`.\n\n**template** — `TARGET_SITE_ERROR`, `TARGET_DNS_ERROR`, `TARGET_TIMEOUT`,\n`TARGET_SSL_ERROR`, `TARGET_ALL_ENGINES_FAILED`, `TEMPLATE_MISMATCH` (the page no\nlonger matches the template contract), `UNKNOWN_ERROR`. A missing product or an\nempty listing is *not* one of these: it comes back as a success with\n`outputs: null` and is still billed.\n\n**map** — `INVALID_REQUEST`, `INVALID_API_KEY`, `INSUFFICIENT_CREDITS`,\n`RATE_LIMITED`, `INTERNAL_ERROR`, `TARGET_ALL_ENGINES_FAILED`, `TARGET_TIMEOUT`,\n`UNKNOWN_ERROR`.\n\n**search** — a per-result extraction failure is reported inside\n`data.outputs[].extract` (`success: false` on that result) and does not fail the call;\na platform-level failure uses this shape like every other capability endpoint.\n\nTwo extract rejections use the HTTP status line instead of `data.success`, and arrive\nwith `16002`: `EXTRACTION_SELECTION_EMPTY` (your `exclude_tags` removed all body text)\nand `EXTRACTION_OUTPUT_TOO_LARGE` (the parser output exceeded the resource budget —\nreduce `formats`).\n\n## Two request identifiers — quote both in a support request\n\n| Value | Who generated it | Where |\n| --- | --- | --- |\n| `request_id` (envelope) | flowda | Envelope of every response, success or failure |\n| `request_id` inside `data` | the fetch platform | Platform response body; identical to the `X-Upstream-Request-Id` response header |\n\nFor `POST /v1/map` the value inside `data` may be the fetch network's own identifier\ninstead of the platform's; the `X-Upstream-Request-Id` header is the authoritative\none when you need to trace a single call.\n\n## Replay\n\n`GET /v1/replay/{request_id}` returns the **original response body** of an earlier\ncapability call, byte for byte, without calling the fetch service again.\n\n* The path parameter is the **platform** request id — the `X-Upstream-Request-Id`\n  response header of the original call (also `data.request_id` inside its body).\n  flowda's own envelope `request_id` is a different value and is **not** accepted.\n* The id format is `req_YYYYMMDD_\u003chex16\u003e`. Older ids (`req_\u003chex16\u003e`) were never\n  retained and answer `404`.\n* A replay is **never billed** and does not re-run the call: `data.credits_used` is\n  what the *original* call was billed, and `data.success` is the *original* outcome —\n  `false` means the call you replayed had failed. The replay itself succeeded.\n* Ownership is enforced per account: another account's `request_id` answers `404`,\n  exactly as if it did not exist. The key must also carry the scope of the original\n  operation (`search`, `extract` or `map`), otherwise the answer is `403` with code\n  `12015`.\n* Results are retained for a limited time. Once a result is gone the endpoint answers\n  `410` (code `11006`) — retrying will not bring it back. A result that is still being\n  archived answers `409` with `Retry-After: 1`.\n* The response carries the original call's metadata as headers: `X-Replay-Of` (the\n  replayed id), `X-Replay-Operation` (`search` / `extract` / `map`),\n  `X-Original-Status` and `X-Original-Outcome` (`succeeded` / `failed`).\n\n## Error codes\n\n| code | HTTP | Meaning | What to do | `details` |\n| --- | --- | --- | --- | --- |\n| 10000 | 500 | Internal error | Retry later; contact us if it persists | no |\n| 11000 | 400 | Invalid request | Fix the request as described in `details` | yes |\n| 11004 | 404 | Not found | Check the path; jobs and checks must belong to your account | no |\n| 11005 | 405 | Method not allowed | Use the documented method | no |\n| 11006 | 410 | The result is no longer available | Do not retry; the result was not retained | no |\n| 12001 | 401 | Authentication required | Send an API key or a session token | no |\n| 12002 | 401 | Invalid or expired session token | Sign in again | no |\n| 12003 | 403 | Forbidden | Account disabled, or the write request failed its origin check | no |\n| 12014 | 401 | API key invalid, revoked or expired | Check the key in the console | no |\n| 12015 | 403 | API key lacks this endpoint's scope | Add the scope named in `data.required_scope` | no |\n| 13000 | 429 | Rate limit exceeded | Back off using `Retry-After` | no |\n| 13002 | 402 | Daily quota exhausted | Wait for the next UTC day, or ask us for a higher quota | yes |\n| 14000 | 500 | Storage unavailable | Retry later; contact us if it persists | no |\n| 16000 | 502 | The fetch service failed | Retry later | no |\n| 16001 | 504 | The fetch service did not answer in time | Retry later | no |\n| 16002 | 400 | The fetch service rejected the request | Fix the request as described in `details` | yes |\n| 16003 | 429 | The fetch service is rate limiting | Reduce concurrency and retry | no |\n| 16004 | 402 | The fetch service has no credits left | Contact us to top up | yes |\n| 16005 | 503 | The fetch service is unreachable | Retry later | no |\n| 16006 | 400 | `webhook_url` rejected | Fix the URL as described in `details` | yes |\n| 16007 | 401 | Webhook signature invalid | Only returned on the platform callback endpoint | no |\n| 16008 | 409 | Conflicts with the job's current state | Adjust the state; `details` says which conflict | yes |\n| 16009 | 500 | Configuration problem on our side | **Contact us — retrying will not help** | no |\n\nCodes in the 16xxx range describe the fetch service. `16009` means *our* platform\ncredential is broken (a flowda-side configuration fault), never your API key:\nit is deliberately not a 401 so that you do not go looking for a problem in your\nown credentials.\n\n## Form-encoded request bodies\n\nEndpoints that accept both `application/json` and `application/x-www-form-urlencoded`\nuse the same field names for both media types. Form-encoded bodies are converted to\nJSON before processing, so all validation and field rules apply identically.\n\n### Encoding rules\n\n- **Strings**: send as a single value. Repeating the same field name for scalar fields\n  returns `400` with code `11000`.\n- **Booleans**: only `true` and `false` are accepted (as literal strings, unquoted).\n- **Integers**: decimal notation only; no leading zeros or decimal points (`01`, `1.0` rejected).\n- **Arrays**: repeat the field name (`formats=markdown\u0026formats=links`), or send a JSON\n  array as a single string value (`formats=[\"markdown\",\"links\"]`). If the value starts\n  with `[` but is not valid JSON (for example, the CSS selector `[data-kind]`), it is\n  treated as a regular string element in a single-item array.\n- **Objects** (`headers`, `extract_options`, `params`): send as a JSON object string\n  (`headers={\"Accept-Language\":\"en-US\"}`).\n- **Empty values**: a field sent with an empty value (`include_tags=`) means \"not\n  provided\" — it is dropped before the request is forwarded, exactly as if you had\n  left the field out. Send `include_tags=[]` if you really need an empty array.\n- **Character encoding**: UTF-8 only. A `charset` parameter other than `utf-8` or a\n  body that is not valid UTF-8 after percent-decoding returns `400` with code `11000`.\n\nUnknown fields are accepted and forwarded — the fetch service will reject them with a\nspecific field message if they are not recognized. This matches the JSON behavior.\n\n**Example**:\n\n```\nPOST /v1/extract HTTP/1.1\nContent-Type: application/x-www-form-urlencoded\n\nurl=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTTP%2FGuides%2FCaching\u0026formats=markdown\u0026formats=links\u0026only_main_content=false\u0026max_age_ms=0\u0026headers=%7B%22Accept-Language%22%3A%22en-US%22%7D\n```\n\nis equivalent to:\n\n```json\n{\n  \"url\": \"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching\",\n  \"formats\": [\"markdown\", \"links\"],\n  \"only_main_content\": false,\n  \"max_age_ms\": 0,\n  \"headers\": {\"Accept-Language\": \"en-US\"}\n}\n```\n\n## Billing\n\n* Every call to a capability endpoint is billed once it reaches the fetch service.\n  **There is no idempotency key**, so a retry after a timeout can be billed twice —\n  confirm the outcome in your call log before retrying.\n* `credits_used` in the response reports what this call cost:\n  extract costs 1 credit on a cache hit and 1 / 3 / 5 by the strategy used on a miss;\n  template execution costs a flat 5 credits (a successful but empty result still\n  costs 5, a failed execution costs 0); search is billed per result.\n* `GET /v1/templates` and `GET /v1/templates/{template_id}` are metadata calls:\n  they cost 0 credits but still appear in your call log.\n* `render_js` is an internal troubleshooting switch of the fetch service and is\n  **not exposed** — use `advanced_mode` when a page needs rendering.\n* A request that carries your own `headers` never reads the platform's snapshot\n  cache, and the target URL stays marked for 48 hours. Do not send `headers` for\n  private pages you do not want to be re-fetched.\n\n## Availability\n\nThe whole `/v1/**` surface (capabilities, `GET /v1/account`, this documentation and\neverything under `/v1/watch`) shares a single server-side switch. When the operator\nhas it off, **every** `/v1` route answers `404` with code `11004` — that is a\ndeliberate, uniform state, not a routing mistake. `GET /api/v1/healthz` and\n`GET /api/v1/readyz` stay available either way.\n",
    "title": "flowda Developer API",
    "version": "1.1.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/v1/account": {
      "get": {
        "description": "Answers \"who am I, what may I call, how much is left\" from the already-resolved\ncredential — it never queries the database, so it keeps working while you\ndiagnose a 403.\n\nRules worth knowing:\n\n* `key_id` is empty for session calls.\n* `scopes` is an empty array for session calls: a session is the account owner\n  and is not restricted by scopes.\n* `scope_enforced` is `true` only for API key calls.\n",
        "operationId": "account",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "auth_method": "api_key",
                    "credential_source": "bearer",
                    "daily_credit_quota": 5000,
                    "key_id": "0BcDeFgHiJkLmNoPqRsTuV",
                    "scope_enforced": true,
                    "scopes": [
                      "extract",
                      "search"
                    ],
                    "user_id": 1024
                  },
                  "message": "success",
                  "request_id": "req_2f4c9a1b7e8d5031"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AccountData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "The caller's identity"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "summary": "Current identity, scopes and quota",
        "tags": [
          "account"
        ]
      }
    },
    "/v1/extract": {
      "post": {
        "description": "Fetches one URL and returns the representations you ask for. Accepts JSON or\nform-encoded bodies (`application/x-www-form-urlencoded`); the same field names\napply to both.\n\n### Request body\n\n| Field | Type | Required | Default | Values | Description |\n| --- | --- | --- | --- | --- | --- |\n| `url` | string | **yes** | — | absolute `http`/`https` URL | The page to fetch. The host, every redirect hop and every resolved address must be public — loopback, private, link-local and reserved ranges are rejected. |\n| `formats` | string[] | no | `[\"markdown\"]` | `markdown`, `raw_html`, `clean_html`, `links` (no duplicates) | Which representations to produce. Only the keys you ask for are returned. |\n| `only_main_content` | boolean | no | `true` | — | Keep the article body only, dropping navigation, footers and sidebars. |\n| `include_tags` | string[] | no | — | CSS selectors | Keep only nodes matching these selectors. |\n| `exclude_tags` | string[] | no | — | CSS selectors | Remove matching nodes. If this removes all body text the call returns `400 EXTRACTION_SELECTION_EMPTY` — adjust the selectors and retry. |\n| `max_age_ms` | integer | no | `172800000` (2 days) | `0 … 172800000` | How old a cached snapshot may be. `0` forces a fresh fetch. |\n| `headers` | object\u003cstring,string\u003e | no | — | e.g. `{\"Accept-Language\":\"en-US\"}` | Headers forwarded to the target site. `Host` and hop-by-hop headers are rejected. See the cache-isolation side effect in the introduction. |\n| `wait_for_ms` | integer | no | `0` | `0 … 30000`, and at most half of `timeout_ms` | Extra wait after the page has loaded. |\n| `timeout_ms` | integer | no | `60000` | `1000 … 120000` | Budget for the whole call: validation, fetch, rendering and extraction. |\n| `country` | string | no | `US` | two letters from the supported egress regions | Access region. A well-formed code outside the list is rejected. |\n| `advanced_mode` | boolean | no | `true` | — | `true` lets the fetch service escalate based on page signals; `false` keeps it on the direct engine. This is the supported way to ask for rendering. |\n\n`render_js` is deliberately **not** accepted: it is the platform's paid browser\ntroubleshooting switch. Sending it returns `400` with code `11000`.\n\n### Reading the result\n\n* `data.success` is the call's real outcome (see the introduction).\n* `data.outputs` contains exactly the formats you requested; a requested-but-empty\n  `markdown` is `\"\"`, an unproducible one is `null`.\n* `data.meta.strategy_used` is `X1` / `X2` / `X3` and drives the price;\n  `data.meta.cache_hit` tells you whether a snapshot was reused.\n* `data.meta.result.status_code` is the **target site's** status and may be `null`\n  when the fetch service could not observe one — it is not this API's status code.\n",
        "operationId": "extract",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtractRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ExtractRequest"
              }
            }
          },
          "example": {
            "advanced_mode": true,
            "country": "US",
            "formats": [
              "markdown",
              "links"
            ],
            "max_age_ms": 0,
            "only_main_content": true,
            "timeout_ms": 60000,
            "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching"
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "retrieved": {
                    "summary": "Page retrieved",
                    "value": {
                      "code": 0,
                      "data": {
                        "credits_used": 1,
                        "meta": {
                          "cache_hit": false,
                          "cache_time": null,
                          "completed_at": "2026-09-05T00:00:01Z",
                          "created_at": "2026-09-05T00:00:00Z",
                          "response_time_ms": 1000,
                          "result": {
                            "final_url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching",
                            "status_code": 200,
                            "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching"
                          },
                          "strategy_used": "X1"
                        },
                        "outputs": {
                          "links": [
                            "https://httpwg.org/specs/rfc9111.html"
                          ],
                          "markdown": "# HTTP caching\n\nThe HTTP cache stores a response associated with a request and reuses the stored response for subsequent requests.\n\n…"
                        },
                        "request_id": "req_01K7XT3B6C9D4M2Q",
                        "success": true
                      },
                      "message": "success",
                      "request_id": "req_6a99053110d62d17"
                    }
                  },
                  "target_unreachable": {
                    "summary": "Platform-level failure reported inside a 200",
                    "value": {
                      "code": 0,
                      "data": {
                        "code": "TARGET_DNS_ERROR",
                        "message": "The target host could not be resolved.",
                        "request_id": "core-req-9f2c1b",
                        "success": false
                      },
                      "message": "success",
                      "request_id": "req_a1b2c3d4e5f60718"
                    }
                  }
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/ExtractData"
                            },
                            {
                              "$ref": "#/components/schemas/PlatformFailure"
                            }
                          ]
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Either a retrieved page or a platform-level failure inside `data`\n(`data.success: false`).\n",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          },
          "504": {
            "$ref": "#/components/responses/Error504"
          }
        },
        "summary": "Fetch a page and return its content",
        "tags": [
          "extract"
        ]
      }
    },
    "/v1/map": {
      "post": {
        "description": "Discovers the reachable URLs of a site. Accepts JSON or form-encoded bodies.\n\n### Request body\n\n| Field | Type | Required | Default | Values | Description |\n| --- | --- | --- | --- | --- | --- |\n| `url` | string | **yes** | — | absolute `http`/`https` URL | The site to enumerate. The host must be publicly resolvable. |\n| `country` | string | no | `US` | uppercase two-letter code | Access region. |\n| `domain_filter` | string | no | `all` | `domain` (same host only), `all` (include external links) | Whether off-site links are returned. |\n| `limit` | integer | no | `5000` | `1 … 100000` | Upper bound on returned URLs. |\n| `sitemap` | string | no | `include` | `skip`, `include`, `only` | How sitemaps are used: ignored, merged, or the only source. |\n\n### Reading the result\n\n* `data.outputs` is an array of `{url, title?, description?}`; it is `null` when\n  nothing was discovered.\n* `data.meta.result` describes the entry page: `status_code` may be `null` when\n  the entry HTML was never fetched, and `url` echoes the URL you sent.\n* Like the other capabilities, a failure may arrive as `data.success: false`\n  inside a 200 response.\n",
        "operationId": "map",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/MapRequest"
              }
            }
          },
          "example": {
            "country": "US",
            "domain_filter": "domain",
            "limit": 5000,
            "sitemap": "include",
            "url": "https://www.example.com"
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "all_sources_failed": {
                    "summary": "Platform-level failure reported inside a 200",
                    "value": {
                      "code": 0,
                      "data": {
                        "code": "TARGET_ALL_ENGINES_FAILED",
                        "message": "All enabled discovery sources failed.",
                        "request_id": "req_01K7XT7H3L5STWXY",
                        "success": false
                      },
                      "message": "success",
                      "request_id": "req_7e8f9a0b1c2d3e4f"
                    }
                  },
                  "discovered": {
                    "summary": "Three URLs discovered",
                    "value": {
                      "code": 0,
                      "data": {
                        "credits_used": 3,
                        "meta": {
                          "completed_at": "2026-10-23T09:01:16Z",
                          "count": 3,
                          "created_at": "2026-10-23T09:01:10Z",
                          "response_time_ms": 6210,
                          "result": {
                            "final_url": "https://www.example.com/",
                            "status_code": 200,
                            "url": "https://www.example.com"
                          }
                        },
                        "outputs": [
                          {
                            "description": "Example is a demo website.",
                            "title": "Example — Home",
                            "url": "https://www.example.com/"
                          },
                          {
                            "title": "Pricing",
                            "url": "https://www.example.com/pricing"
                          },
                          {
                            "url": "https://www.example.com/docs/getting-started"
                          }
                        ],
                        "request_id": "req_01K7XT4E8H2NPQR7",
                        "success": true
                      },
                      "message": "success",
                      "request_id": "req_5c7d9e1f2a3b4c5d"
                    }
                  }
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/MapData"
                            },
                            {
                              "$ref": "#/components/schemas/PlatformFailure"
                            }
                          ]
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Discovered URLs, possibly a platform-level failure in `data`",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "504": {
            "$ref": "#/components/responses/Error504"
          }
        },
        "summary": "Enumerate a site's URLs",
        "tags": [
          "map"
        ]
      }
    },
    "/v1/regions": {
      "get": {
        "description": "The regions you may pass as `country` to `POST /v1/extract`, `POST /v1/search`,\n`POST /v1/map` and `POST /v1/watch/jobs`, with the name to show for each one.\n\n* Only **enabled** regions are returned; a region that was taken out of service\n  disappears from this list and is rejected as a `country` value.\n* Every entry carries two fields: `code` (two uppercase letters, the value you\n  send) and `name_en` (the English name to display).\n* No pagination and no filters — the whole list is small and is meant to be cached\n  by your own process if you need to, not fetched per request by the browser.\n* The list is served by flowda itself, not proxied to the fetch platform.\n* **No key is required**: the list carries no account information, and the\n  people who need it most are the ones still setting up a credential.\n",
        "operationId": "listRegions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "regions": [
                      {
                        "code": "BR",
                        "name_en": "Brazil"
                      },
                      {
                        "code": "US",
                        "name_en": "United States"
                      },
                      {
                        "code": "VN",
                        "name_en": "Vietnam"
                      }
                    ]
                  },
                  "message": "success",
                  "request_id": "req_1c7b0d94e2a34f58"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/RegionListData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "All enabled regions, ordered by code",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [],
        "summary": "List supported egress regions",
        "tags": [
          "regions"
        ]
      }
    },
    "/v1/replay/{request_id}": {
      "get": {
        "description": "Returns the original response body of an earlier capability call, byte for byte,\nwithout calling the fetch service again.\n\n* **Free** — a replay is never billed and does not appear in the fetch service's\n  success-rate statistics. It is still recorded in your call log.\n* `data` is the platform's **original** response body, so `data.success` and\n  `data.code` describe the **original** call: `data.success: false` means the\n  call you replayed had failed. The replay itself succeeded.\n* `data.request_id` is the original platform request id — the same value you\n  passed in the path.\n* Only calls that reached the fetch service are retained: authentication,\n  content-type and body-size rejections are not, and answer `404`.\n* A result that is still being archived answers `409` with `Retry-After: 1`;\n  retry after a second. A result that is gone for good answers `410`.\n* Ownership is enforced per account: another account's `request_id` answers\n  `404`, exactly as if it did not exist.\n",
        "operationId": "replay",
        "parameters": [
          {
            "description": "The platform request id of the call to replay — the `X-Upstream-Request-Id`\nresponse header of that call (also `data.request_id` inside its body).\nOlder ids (`req_\u003chex16\u003e`) were never retained and answer `404`.\n",
            "in": "path",
            "name": "request_id",
            "required": true,
            "schema": {
              "pattern": "^req_[0-9]{8}_[0-9a-f]{16}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "credits_used": 3,
                    "meta": {
                      "completed_at": "2026-11-05T04:12:37Z",
                      "count": 1,
                      "created_at": "2026-11-05T04:12:31Z",
                      "response_time_ms": 6210
                    },
                    "outputs": [
                      {
                        "title": "Pricing",
                        "url": "https://www.example.com/pricing"
                      }
                    ],
                    "request_id": "req_20261105_9c1f0a7b3d2e4f68",
                    "success": true
                  },
                  "message": "success",
                  "request_id": "req_3f7a1c9e5b2d4068"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/ReplayData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "The original response body of the replayed call",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Original-Outcome": {
                "$ref": "#/components/headers/OriginalOutcome"
              },
              "X-Original-Status": {
                "$ref": "#/components/headers/OriginalStatus"
              },
              "X-Replay-Of": {
                "$ref": "#/components/headers/ReplayOf"
              },
              "X-Replay-Operation": {
                "$ref": "#/components/headers/ReplayOperation"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "summary": "Replay an earlier call's response",
        "tags": [
          "replay"
        ]
      }
    },
    "/v1/search": {
      "post": {
        "description": "Searches the web and optionally extracts the full content of every result in the\nsame call. Accepts JSON or form-encoded bodies.\n\nEvery call is written to your usage records — **including the `query` itself** — so a\nfailed search can be traced back to what you searched for. Retention follows your\nusage-record retention (12 months by default).\n\n### Request body\n\n| Field | Type | Required | Default | Values | Description |\n| --- | --- | --- | --- | --- | --- |\n| `query` | string | **yes** | — | 1–256 characters | The query. |\n| `max_results` | integer | no | `10` | `1 … 100` | **Upper bound, not an exact count** — fewer results are still a success. |\n| `source` | string | no | `web` | `web`, `news`, `shopping`, `scholar` | Which corpus to search. `time_range` is rejected together with `shopping`/`scholar`; `country` is rejected with `scholar`. |\n| `country` | string | no | — | uppercase two-letter ISO code from the supported list | Restricts results to a country. Lowercase is rejected. |\n| `language` | string | no | — | lower-case language code, e.g. `en`, `zh-cn`, `pt-br` | Preferred result language. |\n| `time_range` | string | no | — | `hour`, `day`, `week`, `month`, `year` | Recency filter. |\n| `extract_content` | boolean | no | `false` | — | Also extract the full content of each result. |\n| `extract_options` | object | no | — | only allowed when `extract_content: true` | Options for the inline extraction (see below). |\n\n`extract_options` accepts `formats` (`markdown`, `raw_html`, `clean_html`, `links`;\nno duplicates), `only_main_content`, `include_tags`, `exclude_tags`,\n`advanced_mode`, `max_age_ms` (`0 … 172800000`), `timeout_ms`\n(`1000 … 120000`) and `wait_for_ms` (`0 … 30000`, at most half of `timeout_ms`).\n`headers`, `url` and `country` are not accepted inside `extract_options`.\n\nIt only takes effect with `extract_content: true`. When extraction is off (or the\nflag is omitted) the field is dropped before the request reaches the fetch service,\nso a stale, default-filled object cannot fail the call.\n\n### Reading the result\n\n* `data.outputs` is an array of results, each with `position`, `title`, `url`,\n  `snippet` and — for `news` — a human-readable `date`.\n* With `extract_content: true` every result also carries `extract`; when that\n  single extraction fails it is reported per result\n  (`extract.success: false` with `extract.code` / `extract.message`) while the\n  search itself still succeeds.\n* Zero results is a **success**: `data.outputs` is `null` and\n  `data.meta.count` is `0`.\n",
        "operationId": "search",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "example": {
            "country": "US",
            "extract_content": true,
            "extract_options": {
              "formats": [
                "markdown",
                "links"
              ],
              "max_age_ms": 172800000,
              "only_main_content": true,
              "timeout_ms": 60000
            },
            "max_results": 10,
            "query": "espresso machine",
            "source": "web",
            "time_range": "week"
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "no_results": {
                    "summary": "No results (success)",
                    "value": {
                      "code": 0,
                      "data": {
                        "credits_used": 0,
                        "meta": {
                          "completed_at": "2026-10-23T08:20:04Z",
                          "count": 0,
                          "created_at": "2026-10-23T08:20:00Z",
                          "response_time_ms": 4210
                        },
                        "outputs": null,
                        "request_id": "req_01K7XT3B6C9D4M2R",
                        "success": true
                      },
                      "message": "success",
                      "request_id": "req_1a2b3c4d5e6f7788"
                    }
                  },
                  "results": {
                    "summary": "Two results, both extracted",
                    "value": {
                      "code": 0,
                      "data": {
                        "credits_used": 2.2,
                        "meta": {
                          "completed_at": "2026-10-23T08:15:09Z",
                          "count": 2,
                          "created_at": "2026-10-23T08:15:00Z",
                          "response_time_ms": 9128
                        },
                        "outputs": [
                          {
                            "date": "3 days ago",
                            "extract": {
                              "credits_used": 1,
                              "meta": {
                                "cache_hit": false,
                                "cache_time": null,
                                "completed_at": "2026-10-23T08:15:07Z",
                                "created_at": "2026-10-23T08:15:02Z",
                                "response_time_ms": 5127,
                                "result": {
                                  "final_url": "https://www.example.com/best-espresso-machines",
                                  "status_code": 200,
                                  "url": "https://www.example.com/best-espresso-machines"
                                },
                                "strategy_used": "X1"
                              },
                              "outputs": {
                                "links": [
                                  "https://www.example.com/breville-bambino-plus"
                                ],
                                "markdown": "# Best Espresso Machines of 2026\n\nWe tested 24 machines..."
                              },
                              "success": true
                            },
                            "position": 1,
                            "snippet": "We tested 24 machines. The Bambino Plus wins on value...",
                            "title": "Best Espresso Machines of 2026",
                            "url": "https://www.example.com/best-espresso-machines"
                          },
                          {
                            "position": 2,
                            "snippet": "Pressure, temperature stability and grinder quality matter most.",
                            "title": "Espresso machine buying guide",
                            "url": "https://www.example.org/espresso-guide"
                          }
                        ],
                        "request_id": "req_01K7XT3B6C9D4M2Q",
                        "success": true
                      },
                      "message": "success",
                      "request_id": "req_8f3c1d0a7b2e4956"
                    }
                  }
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/SearchData"
                            },
                            {
                              "$ref": "#/components/schemas/PlatformFailure"
                            }
                          ]
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Search results, possibly a platform-level failure in `data`",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "504": {
            "$ref": "#/components/responses/Error504"
          }
        },
        "summary": "Search the web",
        "tags": [
          "search"
        ]
      }
    },
    "/v1/search/countries": {
      "get": {
        "description": "The values you may pass as `country` to `POST /v1/search` — the search engine's\ncountry preference (Google `gl`), with the English name to show for each one.\n\n* Values are **uppercase** two-letter codes; lowercase is rejected.\n* This is **not** the egress-region list: `POST /v1/extract`, `POST /v1/map`\n  and `POST /v1/watch/jobs` take `country` from `GET /v1/regions`.\n* **No key is required**: the list is a static dictionary.\n",
        "operationId": "listSearchCountries",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "countries": [
                      {
                        "code": "DE",
                        "name_en": "Germany"
                      },
                      {
                        "code": "US",
                        "name_en": "United States"
                      }
                    ]
                  },
                  "message": "success",
                  "request_id": "req_3d0f1a6c8b2e4f90"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/SearchCountryListData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "All supported search countries, ordered by code",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [],
        "summary": "List supported search countries",
        "tags": [
          "search"
        ]
      }
    },
    "/v1/search/languages": {
      "get": {
        "description": "The values you may pass as `language` to `POST /v1/search` — the search engine's\ninterface language (Google `hl`), with the English name to show for each one.\n\n* Values are **case-sensitive** and are returned exactly as they must be sent\n  (`en`, `pt-br`, `zh-cn`, `sr-ME`, …).\n* **No key is required**: the list is a static dictionary.\n",
        "operationId": "listSearchLanguages",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "languages": [
                      {
                        "code": "en",
                        "name_en": "English"
                      },
                      {
                        "code": "pt-br",
                        "name_en": "Brazilian Portuguese"
                      }
                    ]
                  },
                  "message": "success",
                  "request_id": "req_5e9b2c7d1a3f4b60"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/SearchLanguageListData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "All supported search interface languages, ordered by code",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [],
        "summary": "List supported search interface languages",
        "tags": [
          "search"
        ]
      }
    },
    "/v1/template": {
      "post": {
        "description": "Runs one of the published templates against a supported site and returns records\nshaped by that template's output schema. Costs a flat 5 credits per execution.\n\n### Request body\n\n| Field | Type | Required | Default | Values | Description |\n| --- | --- | --- | --- | --- | --- |\n| `template` | string | **yes** | — | `amazon_product`, `amazon_search`, `amazon_bestsellers`, `walmart_product`, `walmart_search`, `walmart_category` | Which template to run. The catalogue with the current set is `GET /v1/templates`. |\n| `params` | object | **yes** | — | depends on the template | Template input. The exact schema — including which key identifies the item — is `data.data.params_schema` from `GET /v1/templates/{template_id}`; it describes the **whole** request body (`template` plus `params`), and unknown keys are rejected. |\n\nIdentifier key per template:\n\n| Template | Key | Format |\n| --- | --- | --- |\n| `amazon_product` | `asin` | 10 uppercase letters/digits |\n| `amazon_search` | `query` | 1–256 characters |\n| `amazon_bestsellers` | `url` | `https://www.amazon.com/...` best-sellers ranking page |\n| `walmart_product` | `item_id` | 5–15 digits |\n| `walmart_search` | `query` | 1–256 characters |\n| `walmart_category` | `url` | Walmart category page |\n\nCommon optional `params` keys:\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| `zipcode` | string | none | US 5-digit ZIP code used for pricing and availability. When omitted the target site decides the delivery location — flowda deliberately does not inject a default. |\n| `pages` | integer | `1` | Which results page to collect. List templates only; sending it to a detail template is rejected. |\n| `timeout_ms` | integer | `60000` | Execution budget, `1000 … 120000`. |\n\n### Reading the result\n\n* `data.outputs` is an array of records (or `null` when there was no content);\n  detail templates return one record.\n* `data.meta.fields` explains the record fields **that apply to this template**,\n  keyed by field path (for example `variants[].price`) — use it to render labels\n  in your own UI. Descriptions are provided by the template's published schema.\n* A successful but empty result is not a failure: `data.success` is `true`,\n  `data.outputs` is `null`, and the 5 credits are still charged.\n* A failed execution reports `data.success: false` with a platform `code`\n  (for example `TEMPLATE_MISMATCH` or `TARGET_SITE_ERROR`) and is not charged.\n",
        "operationId": "template",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TemplateRequest"
              }
            }
          },
          "example": {
            "params": {
              "pages": 1,
              "query": "wireless headphones",
              "zipcode": "90017"
            },
            "template": "walmart_search"
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "empty": {
                    "summary": "Successful but empty (still billed 5 credits)",
                    "value": {
                      "code": 0,
                      "data": {
                        "credits_used": 5,
                        "meta": {
                          "completed_at": "2026-09-16T02:10:03Z",
                          "count": 0,
                          "created_at": "2026-09-16T02:10:00Z",
                          "fields": {},
                          "response_time_ms": 3000,
                          "result": {
                            "pages": [
                              {
                                "final_url": "https://www.walmart.com/ip/0000000000",
                                "status_code": 404,
                                "url": "https://www.walmart.com/ip/0000000000"
                              }
                            ]
                          }
                        },
                        "outputs": null,
                        "request_id": "req_01K7XT5F9J3QRSTV",
                        "success": true
                      },
                      "message": "success",
                      "request_id": "req_2c8f11de40ab7731"
                    }
                  },
                  "mismatch": {
                    "summary": "Execution failed (not billed)",
                    "value": {
                      "code": 0,
                      "data": {
                        "code": "TEMPLATE_MISMATCH",
                        "message": "The page did not match the template contract.",
                        "request_id": "req_01K7XT6G2K4RSVWX",
                        "success": false
                      },
                      "message": "success",
                      "request_id": "req_7d3f21aa04bc9e55"
                    }
                  },
                  "records": {
                    "summary": "One record returned",
                    "value": {
                      "code": 0,
                      "data": {
                        "credits_used": 5,
                        "meta": {
                          "completed_at": "2026-09-16T02:00:05Z",
                          "count": 1,
                          "created_at": "2026-09-16T02:00:00Z",
                          "fields": {
                            "currency": {
                              "description": "Currency code of the price; fixed to USD for this template."
                            },
                            "is_sponsored": {
                              "description": "Whether the card carries a Sponsored badge."
                            },
                            "item_id": {
                              "description": "Walmart numeric product id, taken from the end of the product link."
                            },
                            "position": {
                              "description": "1-based card index within this page; not cumulative across pages."
                            },
                            "price": {
                              "description": "Current price in this zipcode context; null when the page shows no price."
                            },
                            "title": {
                              "description": "Product card title, as shown on the page."
                            },
                            "url": {
                              "description": "Canonical Walmart product page URL, without tracking parameters."
                            }
                          },
                          "response_time_ms": 5000,
                          "result": {
                            "pages": [
                              {
                                "final_url": "https://www.walmart.com/search?q=wireless+headphones\u0026page=1",
                                "status_code": 200,
                                "url": "https://www.walmart.com/search?q=wireless+headphones\u0026page=1"
                              }
                            ]
                          }
                        },
                        "outputs": [
                          {
                            "badge": null,
                            "currency": "USD",
                            "is_sponsored": false,
                            "item_id": "5070323892",
                            "list_price": null,
                            "position": 1,
                            "price": 9.97,
                            "rating": 4.6,
                            "review_count": 812,
                            "title": "Ozark Trail 18 oz Stainless Steel Tumbler",
                            "url": "https://www.walmart.com/ip/Ozark-Trail-18-oz-Stainless-Steel-Tumbler/5070323892"
                          }
                        ],
                        "request_id": "req_01K7XT4E8H2NPQR7",
                        "success": true
                      },
                      "message": "success",
                      "request_id": "req_5c1e77ab90d4f210"
                    }
                  }
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/TemplateData"
                            },
                            {
                              "$ref": "#/components/schemas/PlatformFailure"
                            }
                          ]
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Template result, possibly a platform-level failure in `data`",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "504": {
            "$ref": "#/components/responses/Error504"
          }
        },
        "summary": "Run a published extraction template",
        "tags": [
          "template"
        ]
      }
    },
    "/v1/templates": {
      "get": {
        "description": "Lists the templates that are currently callable, together with the identifiers\n`POST /v1/template` accepts.\n\n* **No query parameters are accepted**: the fetch service rejects any request that\n  carries one (you get `16002` with its explanation in `details`).\n* Free of charge (`credits_used` is not billed), but the call is still recorded in\n  your call log.\n* The fetch service's own body nests another `data` inside ours:\n  `data.success`, `data.request_id`, `data.data.templates`.\n* `data.data.templates` is `null` — not `[]` — when nothing is callable, and the\n  order is not guaranteed.\n",
        "operationId": "listTemplates",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "data": {
                      "templates": [
                        {
                          "description": "Collects an Amazon US product detail page by ASIN.",
                          "name": "Amazon Product",
                          "template_id": "amazon_product"
                        },
                        {
                          "description": "Collects Amazon US search result cards by keyword and page.",
                          "name": "Amazon Search",
                          "template_id": "amazon_search"
                        },
                        {
                          "description": "Collects Amazon US best seller listings by browse node or ranking URL.",
                          "name": "Amazon Bestsellers",
                          "template_id": "amazon_bestsellers"
                        },
                        {
                          "description": "Collects a Walmart US product detail page by item ID.",
                          "name": "Walmart Product",
                          "template_id": "walmart_product"
                        },
                        {
                          "description": "Collects Walmart US search result cards by keyword and page.",
                          "name": "Walmart Search",
                          "template_id": "walmart_search"
                        },
                        {
                          "description": "Collects Walmart US category listings by category URL and page.",
                          "name": "Walmart Category",
                          "template_id": "walmart_category"
                        }
                      ]
                    },
                    "request_id": "req_01K7XT9K5N7UVWXY",
                    "success": true
                  },
                  "message": "success",
                  "request_id": "req_2b7c9f4e1a0d3856"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/TemplateCatalogData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "The catalogue of callable templates",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": 16002,
                  "details": [
                    "Query parameter \"limit\" is not supported."
                  ],
                  "message": "the request was rejected, see details",
                  "request_id": "req_3c9e1f2a4b5d6e70"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The fetch service rejected the request — for example a query parameter was\nsupplied. Code `16002`, with its explanation in `details`.\n"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          }
        },
        "summary": "Template catalogue",
        "tags": [
          "template"
        ]
      }
    },
    "/v1/templates/{template_id}": {
      "get": {
        "description": "Everything needed to call one template: its input schema, its output schema, and\nready-made request and response examples.\n\n* Free of charge, but recorded in your call log.\n* No query parameters are accepted (same rule as the catalogue).\n* `data.data.params_schema` describes the **whole** `POST /v1/template` request\n  body — `template` plus `params` — and `additionalProperties: false` means keys\n  outside the schema are rejected. `data.data.output_schema` describes the whole\n  success response, including `meta.fields`.\n* `request_example` / `response_example` are copy-pasteable, but their values are\n  **placeholders** (`req_template_example`, `snap_template_example`), not real data.\n* Descriptions embedded in these schemas are authored by the template publisher\n  and are returned as published; a few templates still carry Chinese text there.\n  Render them as received instead of translating them.\n",
        "operationId": "getTemplate",
        "parameters": [
          {
            "description": "Public template name, exactly as returned by `GET /v1/templates`.",
            "in": "path",
            "name": "template_id",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z][A-Za-z0-9_:-]{2,127}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "data": {
                      "description": "Collects an Amazon US product detail page by ASIN.",
                      "execution": {
                        "headers": {
                          "Authorization": "Bearer \u003capi_key\u003e",
                          "Content-Type": "application/json"
                        },
                        "method": "POST",
                        "url": "/v1/template"
                      },
                      "name": "Amazon Product",
                      "output_schema": {
                        "$schema": "https://json-schema.org/draft/2020-12/schema",
                        "properties": {
                          "credits_used": {
                            "const": 5,
                            "type": "number"
                          },
                          "meta": {
                            "properties": {
                              "completed_at": {
                                "format": "date-time",
                                "type": "string"
                              },
                              "count": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "created_at": {
                                "format": "date-time",
                                "type": "string"
                              },
                              "fields": {
                                "description": "Description of every field path this template produces.",
                                "type": "object"
                              },
                              "response_time_ms": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "result": {
                                "properties": {
                                  "pages": {
                                    "items": {
                                      "properties": {
                                        "final_url": {
                                          "type": "string"
                                        },
                                        "status_code": {
                                          "type": "integer"
                                        },
                                        "url": {
                                          "type": "string"
                                        }
                                      },
                                      "type": "object"
                                    },
                                    "maxItems": 1,
                                    "minItems": 1,
                                    "type": "array"
                                  }
                                },
                                "type": "object"
                              }
                            },
                            "required": [
                              "created_at",
                              "completed_at",
                              "response_time_ms",
                              "count",
                              "result",
                              "fields"
                            ],
                            "type": "object"
                          },
                          "outputs": {
                            "items": {
                              "additionalProperties": true,
                              "required": [
                                "asin",
                                "url",
                                "title",
                                "currency",
                                "in_stock"
                              ],
                              "type": "object"
                            },
                            "maxItems": 1,
                            "minItems": 1,
                            "type": [
                              "array",
                              "null"
                            ]
                          },
                          "request_id": {
                            "type": "string"
                          },
                          "success": {
                            "const": true,
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "success",
                          "request_id",
                          "credits_used",
                          "meta",
                          "outputs"
                        ],
                        "type": "object"
                      },
                      "params_schema": {
                        "$schema": "https://json-schema.org/draft/2020-12/schema",
                        "additionalProperties": false,
                        "properties": {
                          "params": {
                            "additionalProperties": false,
                            "properties": {
                              "asin": {
                                "pattern": "^[A-Z0-9]{10}$",
                                "type": "string"
                              },
                              "timeout_ms": {
                                "default": 60000,
                                "maximum": 120000,
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "zipcode": {
                                "description": "US 5-digit ZIP code; when omitted the target site decides the delivery location.",
                                "pattern": "^\\d{5}$",
                                "type": "string"
                              }
                            },
                            "required": [
                              "asin"
                            ],
                            "type": "object"
                          },
                          "template": {
                            "const": "amazon_product",
                            "type": "string"
                          }
                        },
                        "required": [
                          "template",
                          "params"
                        ],
                        "type": "object"
                      },
                      "request_example": {
                        "params": {
                          "asin": "B08H8ZLKKK",
                          "timeout_ms": 60000
                        },
                        "template": "amazon_product"
                      },
                      "response_example": {
                        "credits_used": 5,
                        "meta": {
                          "completed_at": "2026-09-09T01:12:09Z",
                          "count": 1,
                          "created_at": "2026-09-09T01:12:04Z",
                          "fields": {
                            "asin": {
                              "description": "Product ASIN; an alias page returns the ASIN of the page that was actually served."
                            }
                          },
                          "response_time_ms": 5000,
                          "result": {
                            "pages": [
                              {
                                "final_url": "https://www.amazon.com/dp/B08H8ZLKKK",
                                "status_code": 200,
                                "url": "https://www.amazon.com/dp/B08H8ZLKKK"
                              }
                            ]
                          }
                        },
                        "outputs": [
                          {
                            "asin": "B08H8ZLKKK",
                            "currency": "USD",
                            "in_stock": true,
                            "title": "Example product",
                            "url": "https://www.amazon.com/dp/B08H8ZLKKK"
                          }
                        ],
                        "request_id": "req_template_example",
                        "success": true
                      },
                      "template_id": "amazon_product"
                    },
                    "request_id": "req_01K7XTA6P8QWXYZ0",
                    "success": true
                  },
                  "message": "success",
                  "request_id": "req_88f1c0aa7b23d9e4"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/TemplateDetailData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "The template's schemas and examples",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": 16002,
                  "details": [
                    "Unknown template_id \"walmart_productt\"."
                  ],
                  "message": "the request was rejected, see details",
                  "request_id": "req_8d41c25be07a9f31"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The fetch service rejected the request — for example a malformed\n`template_id`. Code `16002`, with its explanation in `details`.\n"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          }
        },
        "summary": "Template details",
        "tags": [
          "template"
        ]
      }
    },
    "/v1/watch/jobs": {
      "get": {
        "description": "Returns the jobs of your account only — the fetch platform shares one credential\nacross all brands, so ownership is decided here.\n\nQuery parameters: `status` (`active`, `paused`, `errored`; lowercase),\n`url` (exact match) and `limit` (`1 … 200`, default `50`), `cursor` (opaque,\ntaken from `data.data.next_cursor`).\n\nLike every Watch endpoint except `POST /v1/watch/jobs/{id}/check`, the platform's\nbody is nested one level deeper: `data.data.jobs` is `null` when the account has no\njobs, and `data.data.next_cursor` is `null` on the last page.\n",
        "operationId": "listWatchJobs",
        "parameters": [
          {
            "description": "Filter by job status (lowercase).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "active",
                "paused",
                "errored"
              ],
              "type": "string"
            }
          },
          {
            "description": "Exact URL match.",
            "in": "query",
            "name": "url",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's `data.data.next_cursor`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WatchJobListSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          }
        },
        "summary": "List monitoring jobs",
        "tags": [
          "watch"
        ]
      },
      "post": {
        "callbacks": {
          "changeDetected": {
            "{$request.body#/webhook_url}": {
              "post": {
                "description": "Delivered to the callback address registered for this job. Only change\nevents are sent: a check that finds no change delivers nothing, and a job\nwithout `webhook_url` sends nothing.\n\nEvery request is signed with that job's `webhook_secret`; the Webhooks guide\nlists the headers, the string that is signed and the retry rules. Read the\nchange itself from `data.diff`, or just its one-line summary from\n`data.check.diff_summary`.\n",
                "requestBody": {
                  "content": {
                    "application/json": {
                      "schema": {
                        "$ref": "#/components/schemas/WatchEvent"
                      }
                    }
                  },
                  "required": true
                },
                "responses": {
                  "2XX": {
                    "description": "Any 2xx accepts the event. A non-2xx answer is retried, up to 6 delivery\nattempts in total; 4xx answers other than 408, 425 and 429 stop\nimmediately.\n"
                  }
                },
                "summary": "Change detected on a monitored page"
              }
            }
          }
        },
        "description": "Registers a page with a schedule and returns the job. The job is created on the\nfetch platform under flowda's credential; ownership stays with your account here.\n\n### Request body\n\n| Field | Type | Required | Default | Values | Description |\n| --- | --- | --- | --- | --- | --- |\n| `url` | string | **yes** | — | absolute `http`/`https` URL, publicly resolvable | The page to monitor. Immutable afterwards. |\n| `schedule` | object | **yes** | — | `{interval_seconds}` **or** `{cron}` — exactly one | When to check. `interval_seconds` is `60 … 2592000` and runs on the UTC timeline (the timezone does not shift it); `cron` is a standard five-field expression interpreted in `timezone` (weekends included). |\n| `timezone` | string | no | `UTC` | IANA timezone name | Affects `cron` schedules only. |\n| `country` | string | no | `US` | two letters | Access region for the checks. |\n| `selector` | string | no | — | CSS or XPath, per `selector_type` | Monitor only part of the page. |\n| `selector_type` | string | no | `css` | `css`, `xpath` | How `selector` is interpreted. |\n| `diff_modes` | string[] | no | `[\"auto\"]` | `auto`, `text`, `json` (no duplicates; `auto` cannot be combined) | How differences are computed. |\n| `retention_days` | integer | no | `30` | `0 … 365` | How long check history is kept; `0` means keep it indefinitely. |\n| `webhook_url` | string | no | no notifications | absolute `http`/`https` URL on a public host, port 80 or 443 | Where change events are delivered. flowda rewrites it to its own relay before handing the job to the platform, and swaps your address back in the responses. |\n| `headers` | object\u003cstring,string\u003e | no | `{}` | `Host` and hop-by-hop headers are rejected | Extra headers for the checks. |\n| `mask` | object | no | `{enabled: false, exclude: []}` | see below | Noise reduction for diffing. `mask.enabled` (boolean) and `mask.exclude` (array of `iso_timestamp`, `unix_timestamp`, `relative_time`, `counter`, `uuid`, `session_token`, `tracking_param`, `cache_buster`, `resource_hash`, `iframe_marker`). |\n\n`schedule` is a **nested object**: `schedule_interval` and `schedule_cron` used to\nexist as top-level fields and are rejected — use `schedule`.\n\nThe body is accepted as JSON or form-encoded (`application/x-www-form-urlencoded`).\nWith form encoding, `schedule`, `headers` and `mask` are JSON object strings and\n`diff_modes` is sent by repeating the field name (or as a JSON array string) — the\nsame rules as the other endpoints that accept form bodies.\n\nIf `webhook_url` is new to this account, the response additionally carries\n`data.data.webhook_secret` **once**: store it. It is the HMAC key our callbacks are\nsigned with and it is never returned again — not by `GET /v1/watch/jobs/{id}`, not\nin the list.\n\n### Receiving callbacks\n\nWe `POST` to your address with `Content-Type: application/json`, a JSON body holding\nthe change event, and these headers:\n\n| Header | Meaning |\n| --- | --- |\n| `X-Watch-Signature` | `t=` followed by unix seconds, then `,v1=` followed by a lowercase hex digest. The digest is HMAC-SHA256 over the string built from those unix seconds, a dot, then the raw request body bytes. Reject anything whose timestamp is more than 5 minutes away, and compare digests in constant time. |\n| `X-Flowda-Event` | Event name; currently `watch.change_detected`. |\n| `X-Flowda-Event-Id` | Stable idempotency key for job, check and event; use it to deduplicate deliveries. |\n| `X-Flowda-Delivery-Id` | Identifier of this delivery. |\n| `X-Flowda-Attempt` | Attempt number, starting at `1`. |\n\nVerify over the **raw body bytes you received**: parsing the JSON and serializing it\nagain changes the bytes and breaks the signature. Answer 2xx quickly. A non-2xx\nanswer is retried, up to 6 delivery attempts in total, with delays of 10s, 1m, 5m,\n30m and 2h between them; 4xx answers other than 408, 425 and 429 stop immediately,\nand `Retry-After` is honoured up to 10 minutes.\n\nThe body is a `watch.change_detected` event: the job and check identifiers, a\none-line `data.check.diff_summary`, and the change itself under `data.diff`. Its\nschema is the `changeDetected` callback of this operation; `data.delivered_at` is\nwhen the platform created the event, which is not the timestamp in the signature\nheader.\n",
        "operationId": "createWatchJob",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchJobCreateRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/WatchJobCreateRequest"
              }
            }
          },
          "example": {
            "country": "US",
            "diff_modes": [
              "auto"
            ],
            "mask": {
              "enabled": true,
              "exclude": [
                "iso_timestamp",
                "counter"
              ]
            },
            "retention_days": 30,
            "schedule": {
              "interval_seconds": 3600
            },
            "selector": "main .price",
            "selector_type": "css",
            "timezone": "Asia/Shanghai",
            "url": "https://www.example.com/pricing",
            "webhook_url": "https://your-app.example.com/hooks/flowda"
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "data": {
                      "job": {
                        "consecutive_failures": 0,
                        "country": "US",
                        "created_at": "2026-10-23T09:07:28Z",
                        "diff_modes": [
                          "auto"
                        ],
                        "headers": {},
                        "job_id": "job_N5HX0z7rZQ7DloP8gLgSWE",
                        "last_check_at": null,
                        "last_content_hash": null,
                        "last_error": null,
                        "mask": {
                          "enabled": true,
                          "exclude": [
                            "iso_timestamp",
                            "counter"
                          ]
                        },
                        "next_run_at": "2026-10-23T10:07:31Z",
                        "retention_days": 30,
                        "schedule": {
                          "interval_seconds": 3600
                        },
                        "selector": "main .price",
                        "selector_type": "css",
                        "status": "active",
                        "timezone": "Asia/Shanghai",
                        "updated_at": "2026-10-23T09:07:28Z",
                        "url": "https://www.example.com/pricing",
                        "webhook_url": "https://your-app.example.com/hooks/flowda"
                      },
                      "webhook_secret": "whsec_EXAMPLEvaluenotARealKey",
                      "webhook_secret_note": "Store it now: it is returned only once."
                    },
                    "request_id": "req_01K7XT5F9J3QRSTV",
                    "success": true
                  },
                  "message": "success",
                  "request_id": "req_9d0e1f2a3b4c5d6e"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WatchJobData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "The created job, nested as `data.data.job`, plus `data.data.webhook_secret` when a new callback URL was registered",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          }
        },
        "summary": "Create a monitoring job",
        "tags": [
          "watch"
        ]
      }
    },
    "/v1/watch/jobs/{id}": {
      "delete": {
        "description": "Deletes the job together with its check history and pending deliveries.\nDeleting an already-deleted job still succeeds.\n\nThe platform's body is projected verbatim into `data`, so read the outcome from\n`data.success`; on success the platform's own `data.data` is `null` — there is no\ndeleted-job projection to return.\n",
        "operationId": "deleteWatchJob",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "data": null,
                    "request_id": "req_01K7XTA1B2C3DEFG",
                    "success": true
                  },
                  "message": "success",
                  "request_id": "req_5e6f708192a3b4c5"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WatchDeleteData"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Deleted; `data.success` is `true` and `data.data` is `null`",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          }
        },
        "summary": "Delete a job",
        "tags": [
          "watch"
        ]
      },
      "get": {
        "description": "Only your account's jobs are visible; another account's job is reported as\nnot found (404) rather than 403.\n",
        "operationId": "getWatchJob",
        "responses": {
          "200": {
            "$ref": "#/components/responses/WatchJobSuccess"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          }
        },
        "summary": "Job details",
        "tags": [
          "watch"
        ]
      },
      "parameters": [
        {
          "description": "Job id, `job_` followed by 22 base62 characters.",
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "pattern": "^job_[0-9A-Za-z]{22}$",
            "type": "string"
          }
        }
      ],
      "patch": {
        "description": "Partial update with the same field set as creation, **except `url`** (a job's\ntarget cannot be changed).\n\n* A field you leave out is unchanged.\n* `webhook_url: null` (or `\"\"`) removes the callback.\n* `schedule: null` is rejected — pass a new schedule object instead.\n* Changing `selector_type` without `selector` re-validates the existing selector\n  against the new type.\n* Re-sending the same values succeeds idempotently.\n* Registering a callback address this account has not used before returns\n  `data.data.webhook_secret` once, exactly like creation; the rest of the response\n  is the job, nested as `data.data.job`.\n\nThe body is accepted as JSON or form-encoded (`application/x-www-form-urlencoded`).\nWith form encoding, `schedule`, `headers` and `mask` are JSON object strings and\n`diff_modes` is sent by repeating the field name (or as a JSON array string) — the\nsame rules as the other endpoints that accept form bodies.\n",
        "operationId": "updateWatchJob",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchJobUpdateRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/WatchJobUpdateRequest"
              }
            }
          },
          "example": {
            "retention_days": 90,
            "schedule": {
              "cron": "*/30 * * * *"
            },
            "timezone": "Asia/Shanghai",
            "webhook_url": null
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WatchJobSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          }
        },
        "summary": "Update a job",
        "tags": [
          "watch"
        ]
      }
    },
    "/v1/watch/jobs/{id}/check": {
      "post": {
        "description": "Runs one check synchronously (the fetch platform allows about 60 seconds) and\nreturns the check result, including the diff when something changed.\n\nUnlike every other Watch endpoint the result is **flat**: `data` is\n`{success, request_id, credits_used, meta, diff}`. Job details, the job list and the\ncheck history nest the platform body one level deeper, as\n`data.data.{job|jobs|checks}`.\n\n`meta.is_baseline: true` means this was the first successful fetch: it only\nestablishes the baseline, so `changed` is `false` and `diff` is `null`.\n\nCosts 1 / 3 / 5 credits according to the strategy used; a failed fetch costs 0.\n",
        "operationId": "checkWatchJob",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "credits_used": 1,
                    "diff": {
                      "changed": true,
                      "hunks": [
                        {
                          "after": "$34.00",
                          "before": "$29.00",
                          "change_type": "modified",
                          "path": "main .price"
                        }
                      ],
                      "mode": "text",
                      "summary": {
                        "added_lines": 0,
                        "change_ratio": 0.3333333333333333,
                        "modified_lines": 1,
                        "removed_lines": 0
                      },
                      "truncated": false,
                      "unified_diff": "--- previous\n+++ current\n@@ -1,1 +1,1 @@\n-\u003cdiv class=\"price\"\u003e$29.00\u003c/div\u003e\n+\u003cdiv class=\"price\"\u003e$34.00\u003c/div\u003e\n"
                    },
                    "meta": {
                      "changed": true,
                      "check_id": "chk_XTpNp2SRIsYu0rWRxNM6LA",
                      "checked_at": "2026-10-23T09:31:11Z",
                      "completed_at": "2026-10-23T09:31:12Z",
                      "content_hash": "sha256:9f2c4e7a1b8d5063",
                      "created_at": "2026-10-23T09:31:10Z",
                      "diff_summary": "0 lines added / 0 lines removed / 1 line modified",
                      "error": "",
                      "is_baseline": false,
                      "job_id": "job_N5HX0z7rZQ7DloP8gLgSWE",
                      "response_time_ms": 2721,
                      "result": {
                        "final_url": "https://www.example.com/pricing/",
                        "status_code": 200,
                        "url": "https://www.example.com/pricing"
                      },
                      "selector_matched": true,
                      "strategy_used": "X1",
                      "trigger": "manual",
                      "webhook_delivery": {
                        "attempt_count": 0,
                        "last_error": null,
                        "next_retry_at": null,
                        "status": "delivered"
                      }
                    },
                    "request_id": "req_01K7XT6G2K4RSVWX",
                    "success": true
                  },
                  "message": "success",
                  "request_id": "req_2b3c4d5e6f708192"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/WatchCheckRunData"
                            },
                            {
                              "$ref": "#/components/schemas/PlatformFailure"
                            }
                          ]
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "The check result",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "code": 16008,
                  "details": [
                    "The job is paused."
                  ],
                  "message": "upstream conflict",
                  "request_id": "req_4c1e9b0f28463a7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The job is paused (`details: [\"The job is paused.\"]`) or a check is already\nrunning (`details: [\"A check is already in progress.\"]`), code `16008`.\n"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "summary": "Run a check now",
        "tags": [
          "watch"
        ]
      }
    },
    "/v1/watch/jobs/{id}/checks": {
      "get": {
        "description": "Lists past checks of a job, newest first. Query parameters: `limit`\n(`1 … 200`, default `50`) and `cursor` (from `data.data.next_cursor`).\n\nList items carry `diff_summary` (human-readable, for example\n`1 line modified`) but no diff body — fetch a single check for that.\nThe counts are nested as `data.data`: `data.data.checks` is `null` when the job has\nno history, and `data.data.next_cursor` is `null` on the last page.\n",
        "operationId": "listWatchChecks",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobID"
          },
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's `data.data.next_cursor`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WatchCheckListSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          }
        },
        "summary": "Check history",
        "tags": [
          "watch"
        ]
      }
    },
    "/v1/watch/jobs/{id}/checks/{check_id}": {
      "get": {
        "description": "Returns one check together with its diff (which is `null` when nothing changed\nor when the run only established the baseline). This is the only way to get the\ndiff body of a past check.\n",
        "operationId": "getWatchCheck",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobID"
          },
          {
            "description": "Check id, `chk_` followed by 22 base62 characters.",
            "in": "path",
            "name": "check_id",
            "required": true,
            "schema": {
              "pattern": "^chk_[0-9A-Za-z]{22}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "data": {
                    "data": {
                      "check": {
                        "changed": true,
                        "check_id": "chk_XTpNp2SRIsYu0rWRxNM6LA",
                        "checked_at": "2026-10-23T09:31:11Z",
                        "code": null,
                        "content_hash": "sha256:9f2c4e7a1b8d5063",
                        "credits_used": 1,
                        "diff_summary": "0 lines added / 0 lines removed / 1 line modified",
                        "error": "",
                        "is_baseline": false,
                        "job_id": "job_N5HX0z7rZQ7DloP8gLgSWE",
                        "message": null,
                        "result": {
                          "final_url": "https://www.example.com/pricing/",
                          "status_code": 200,
                          "url": "https://www.example.com/pricing"
                        },
                        "selector_matched": true,
                        "strategy_used": "X1",
                        "trigger": "manual",
                        "webhook_delivery": null
                      },
                      "diff": {
                        "changed": true,
                        "hunks": [
                          {
                            "after": "$34.00",
                            "before": "$29.00",
                            "change_type": "modified",
                            "path": "main .price"
                          }
                        ],
                        "mode": "text",
                        "summary": {
                          "added_lines": 0,
                          "change_ratio": 0.3333333333333333,
                          "modified_lines": 1,
                          "removed_lines": 0
                        },
                        "truncated": false,
                        "unified_diff": "--- previous\n+++ current\n@@ -1,1 +1,1 @@\n-\u003cdiv class=\"price\"\u003e$29.00\u003c/div\u003e\n+\u003cdiv class=\"price\"\u003e$34.00\u003c/div\u003e\n"
                      }
                    },
                    "request_id": "req_01K7XT8J4M6TUVWZ",
                    "success": true
                  },
                  "message": "success",
                  "request_id": "req_4d5e6f708192a3b4"
                },
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "properties": {
                            "data": {
                              "properties": {
                                "check": {
                                  "$ref": "#/components/schemas/WatchCheck"
                                },
                                "diff": {
                                  "$ref": "#/components/schemas/WatchDiff"
                                }
                              },
                              "type": "object"
                            },
                            "request_id": {
                              "type": "string"
                            },
                            "success": {
                              "type": "boolean"
                            }
                          },
                          "type": "object"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "One check with its diff, nested as `data.data`",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "X-Upstream-Request-Id": {
                "$ref": "#/components/headers/UpstreamRequestID"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          }
        },
        "summary": "Check details",
        "tags": [
          "watch"
        ]
      }
    },
    "/v1/watch/jobs/{id}/pause": {
      "post": {
        "description": "Stops the schedule. Pausing an already-paused job succeeds without side effects.",
        "operationId": "pauseWatchJob",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WatchJobSuccess"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          }
        },
        "summary": "Pause a job",
        "tags": [
          "watch"
        ]
      }
    },
    "/v1/watch/jobs/{id}/resume": {
      "post": {
        "description": "Re-enables the schedule, including for a job that failed its way into the\n`errored` state (`errored` after 5 consecutive failures). Resuming resets the\nconsecutive-failure counter.\n",
        "operationId": "resumeWatchJob",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WatchJobSuccess"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          }
        },
        "summary": "Resume a job",
        "tags": [
          "watch"
        ]
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    },
    {
      "apiKeyHeader": []
    },
    {
      "bearerAuth": []
    },
    {
      "cookieAuth": []
    }
  ],
  "servers": [
    {
      "description": "Production API",
      "url": "https://openapi.flowda.ai"
    }
  ],
  "tags": [
    {
      "description": "Inspect the current key, its scopes and its quota",
      "name": "account"
    },
    {
      "description": "List the supported egress regions (country codes and names)",
      "name": "regions"
    },
    {
      "description": "Fetch a single page and return its content",
      "name": "extract"
    },
    {
      "description": "Run a published extraction template against a supported site",
      "name": "template"
    },
    {
      "description": "Search the web, optionally extracting each result",
      "name": "search"
    },
    {
      "description": "Enumerate the URLs of a site",
      "name": "map"
    },
    {
      "description": "Replay the original response of an earlier call",
      "name": "replay"
    },
    {
      "description": "Monitor pages and receive change notifications",
      "name": "watch"
    }
  ]
}
