{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatapi/json-schema/beatapi-web-research-response-schema.json",
  "title": "WebResearchResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatapi-web-search-api-openapi.yml#/components/schemas/WebResearchResponse",
  "type": "object",
  "required": [
    "object",
    "request_id",
    "query",
    "status",
    "research_notes",
    "sources"
  ],
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "web.research"
      ]
    },
    "request_id": {
      "type": "string",
      "description": "Quote it in support requests."
    },
    "query": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "complete",
        "partial"
      ],
      "description": "`partial` — the research ran but some coverage is missing; `partial_reasons` says what."
    },
    "research_notes": {
      "type": "string",
      "description": "Unverified research notes that cite sources by `id`. They are leads, not evidence."
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebResearchSource"
      }
    },
    "partial_reasons": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Present only when `status` is `partial`. Values include `search_failed`,\n`some_sources_unread`, `follow_up_failed`, `no_source_read`,\n`reader_unavailable` and `incomplete`; more may be added.\n"
    },
    "x_search": {
      "type": "object",
      "description": "Present when the run searched X: how much it read. Posts reach `sources` only when the research relied on them, so `searches` with no X source means X was read and nothing was cited, while an absent `x_search` means X was not searched.",
      "required": [
        "searches",
        "posts_fetched"
      ],
      "properties": {
        "searches": {
          "type": "integer",
          "description": "X searches the research made."
        },
        "posts_fetched": {
          "type": "integer",
          "description": "Posts those searches returned to the research model."
        }
      }
    }
  },
  "$defs": {
    "WebResearchSource": {
      "type": "object",
      "required": [
        "id",
        "url",
        "read_status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Source id, such as `source_1`. `research_notes` cite sources by it."
        },
        "url": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "published_at": {
          "type": "string",
          "description": "Publication date as the source reports it",
          "when known.": null
        },
        "author": {
          "type": "string"
        },
        "snippet": {
          "type": "string",
          "description": "Search excerpt",
          "when one was seen.": null
        },
        "content": {
          "type": "string",
          "description": "Text of a page that was read. One call returns a limited total amount of page\ntext, so a `read` source past that budget has no `content`; call\n`POST /v1/web/read` with its `url` for the full text.\n"
        },
        "read_status": {
          "type": "string",
          "enum": [
            "read",
            "snippet",
            "cited",
            "failed"
          ],
          "description": "`read` — the page was read, and `content` holds its text unless the call's\ntext budget ran out; `snippet` — only a search excerpt was seen; `cited` —\nmentioned during research but not read; `failed` — reading the page failed.\nCite only `read` sources.\n"
        }
      }
    }
  }
}