{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prosp-cc/json-schema/prosp-cc-job-result-schema.json",
  "title": "JobResult",
  "description": "The result of a finished discovery, present once the run reaches a terminal state.\nField names are snake_case. `prospects[]` carries only customer-safe fields — internal\nscoring, provenance, and raw content are never included.\n",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prosp-cc-openapi.yaml#/components/schemas/JobResult",
  "type": "object",
  "required": [
    "jobId",
    "status"
  ],
  "properties": {
    "jobId": {
      "type": "string",
      "description": "Id of this discovery."
    },
    "icp_id": {
      "$ref": "#/$defs/JobIcpId"
    },
    "status": {
      "description": "Terminal lifecycle state of the discovery (`completed`, `failed`, or `exhausted`).",
      "$ref": "#/$defs/JobState"
    },
    "total_prospects": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of prospects this discovery produced — the canonical per-discovery delivery count, the SAME field name and metric the live `JobStatus.total_prospects` reports (this is its terminal, frozen value). Key on this ONE name to group/count a discovery's delivery across the status and result surfaces. On the merged `Discovery` view this is read at `result.total_prospects`. Distinct from the pagination `total` on `ProspectList`/`ProspectSummaryList` (a LIST/SEARCH result-set count across your inbox)."
    },
    "withheld_count": {
      "type": "integer",
      "minimum": 0,
      "description": "How many companies this discovery DELIVERED and then RETRACTED, so `total_prospects` above is the SERVABLE set rather than the originally-announced one. A prospect is retracted when a check that can only complete after delivery decides it does not belong to your search — most often a headquarters re-check placing it outside your target region. Retracted companies are removed from `prospects[]`/`found[]` and never reach your CRM. ABSENT (never `0`) when nothing was retracted: absence is the signal."
    },
    "withheld": {
      "type": "array",
      "description": "The retracted companies, one entry per row removed from `prospects[]`/`found[]`. Present only alongside a non-zero `withheld_count`.",
      "items": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The retracted company's domain, as it was originally delivered."
          },
          "reason": {
            "type": "string",
            "description": "Bounded reason the company was retracted. `sub_region` = its headquarters resolved outside your target region; `exclusion` / `business_model` = it matched a filter you set; `kb_seed_dedup` = you already own it from an earlier search; `intent_mismatch` = a fuller check of its own website found it does not do what you searched for; `delivery_cap` = it arrived after the run had already met your target; `displaced_by_verified_match` = a company whose own pages confirm your search took its place within your requested count.",
            "enum": [
              "sub_region",
              "kb_seed_dedup",
              "exclusion",
              "business_model",
              "intent_mismatch",
              "delivery_cap",
              "displaced_by_verified_match",
              "unspecified"
            ]
          }
        }
      }
    },
    "terminal_reason": {
      "$ref": "#/$defs/TerminalReason"
    },
    "already_owned_count": {
      "$ref": "#/$defs/AlreadyOwnedCount"
    },
    "already_owned_withheld_count": {
      "$ref": "#/$defs/AlreadyOwnedWithheldCount"
    },
    "candidates_screened": {
      "$ref": "#/$defs/CandidatesScreened"
    },
    "evaluated_count": {
      "$ref": "#/$defs/EvaluatedCount"
    },
    "auto_complete_reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "stuck_processing_no_marker",
        "stuck_processing_no_prospects",
        "null"
      ],
      "description": "Present ONLY when automatic recovery force-completed a run that stalled in `processing` with no completion marker (`stuck_processing_no_marker` when prospects had accumulated, `stuck_processing_no_prospects` when none had). Absent on every normally-terminating run."
    },
    "credits_refunded": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "Credits returned to the caller's balance when this run was auto-refunded (e.g. an exhausted run that delivered fewer prospects than requested). Absent when no refund applied. Same field, semantics, and shape as `JobCancelled.credits_refunded` — one canonical refund projection across the result and cancel surfaces."
    },
    "credits_refund_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Bounded reason the refund was applied (e.g. `candidates_exhausted`, `time_limit_reached`), resolved from durable terminal state. Present iff `credits_refunded` is. Mirrors `JobCancelled.credits_refund_reason`."
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the discovery finished (ISO-8601). Null while not yet terminal."
    },
    "prospects": {
      "type": "array",
      "description": "The customer-safe prospects this run found (same field set as `ProspectList`).",
      "items": {
        "$ref": "#/$defs/Prospect"
      }
    },
    "suggestions": {
      "type": "array",
      "default": [],
      "description": "Data-driven entries derived from THIS run. At most ONE leak-safe ADVICE recommendation (the single most impactful change) is emitted when the run underperformed (exhausted with fewer prospects than requested), each carrying a human-readable message and an optional `suggested_parameters` delta to merge over your original criteria and start a new discovery. In addition, ZERO OR MORE mandatory `FILTER_RELAXED` disclosures may appear on any terminal run when a requested filter (`company_sizes` or `sub_country_regions`) was relaxed so some returned companies fall outside it, each carrying a `suggested_parameters` clearing that filter. For a region-scoped run where no out-of-region company is yet provable (the region signal often finalizes after async enrichment), a single informational `REGION_PREFERENCE_APPLIED` note appears instead, carrying the same `{sub_country_regions: []}` correction. Empty when the run met target, no filter was relaxed, and no regional preference was requested.",
      "items": {
        "$ref": "#/$defs/Suggestion"
      }
    },
    "circular_opportunity": {
      "description": "ONE circular-economy opportunity inferred from your own stored business profile, offered alongside this finished run rather than as a separate message. ABSENT - never null and never an empty object - whenever there is nothing well-grounded to offer, you have opted out, or this run was itself started from an opportunity. The same entry is returned for every read of this discovery, so polling does not change it.",
      "$ref": "#/$defs/CircularOpportunity"
    }
  },
  "$defs": {
    "AlreadyOwnedCount": {
      "type": "integer",
      "minimum": 0,
      "description": "How many of this discovery's delivered domains you ALREADY owned from a PRIOR discovery (any earlier search, not just this one's filters) — i.e. cross-search overlap with your existing prospects. 0 means every delivered domain is new to you. Domains already owned under this exact search's filters are de-duplicated out before delivery and are not counted here. Served on both the progressive status and the finalized result from one durable value. See `already_owned_withheld_count` for how many WERE de-duplicated out."
    },
    "AlreadyOwnedWithheldCount": {
      "type": "integer",
      "minimum": 1,
      "description": "How many companies this discovery found, judged in-scope for THIS search, and then did NOT deliver because you already own them from an earlier run of the same search. This is the count `already_owned_count` explicitly excludes: those domains were suppressed one step BEFORE delivery, so they appear in neither `prospects` nor `total_prospects`. It is the number that explains an otherwise puzzling result — a repeat search of a market you have already worked returns few new companies precisely BECAUSE most of what it found is already yours, and without this field that outcome is indistinguishable from a failed run. Counted as DISTINCT companies across both suppression paths (freshly searched and re-served from your existing knowledge base), so it never double-counts one company found twice. ABSENT — never 0 — when nothing was suppressed, so any value you receive is a real one."
    },
    "CandidatesScreened": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of candidate companies this discovery began SCREENING (search/candidate-dispatch phase). Increases monotonically during screening so a client sees live progress even before the first prospect domain lands; 0 before screening has started. It legitimately PLATEAUS once search has exhausted the niche and the run moves into its crawl/validation tail — that is not a stall. For liveness during that tail, read `evaluated_count`. On the finished result it is the frozen final value, so the same number explains a run after it ends."
    },
    "CircularClaim": {
      "type": "object",
      "required": [
        "label",
        "grounding",
        "speech_act"
      ],
      "additionalProperties": false,
      "description": "One claim, together with what may be DONE with it. `label` is presented verbatim in its original language and is never translated - it may carry a product, brand or material designation. `speech_act` is the machine-readable form of a rule that is a sentence on a chat surface: an `IMPLIED` claim is something we inferred about your business, not something you told us, so it may only ever be put to you as a QUESTION.",
      "properties": {
        "label": {
          "type": "string",
          "description": "The flow, asset, capacity, capability or counterpart type, in plain commercial language."
        },
        "grounding": {
          "type": "string",
          "enum": [
            "STATED",
            "CONFIRMED",
            "IMPLIED"
          ],
          "description": "`STATED` - appears in your business profile. `CONFIRMED` - you corrected or confirmed it and we retained that. `IMPLIED` - inferred, and not yet confirmed by you."
        },
        "speech_act": {
          "type": "string",
          "enum": [
            "ASSERT",
            "ASK"
          ],
          "description": "`ASSERT` for a stated or confirmed claim. `ASK` for an unconfirmed hypothesis, which must be phrased as a question about your business and must not enter outreach."
        }
      }
    },
    "CircularOpportunity": {
      "type": "object",
      "required": [
        "handle",
        "category_group",
        "mode",
        "direction",
        "resource",
        "counterpart"
      ],
      "additionalProperties": false,
      "description": "One graded circular-economy opportunity for your business. Individually runnable via `POST /api/v1/discoveries` with `opportunityHandle`.",
      "properties": {
        "handle": {
          "type": "string",
          "description": "Opaque id of this entry, scoped to your portfolio. Pass it to run the counterpart search."
        },
        "category_group": {
          "type": "string",
          "description": "The kind of opportunity - materials recovery is one of several and is never a default. A bounded vocabulary; treat an unfamiliar value as opaque rather than as an error."
        },
        "mode": {
          "type": "string",
          "description": "The shape of the search this entry becomes. Bounded vocabulary."
        },
        "direction": {
          "type": "string",
          "enum": [
            "CUSTOMER_HOLDS",
            "CUSTOMER_SEEKS"
          ],
          "description": "`CUSTOMER_HOLDS` - you hold underutilized value and the search finds who wants it. `CUSTOMER_SEEKS` - you would source value another company holds."
        },
        "resource": {
          "description": "What of YOURS the opportunity rests on.",
          "$ref": "#/$defs/CircularClaim"
        },
        "counterpart": {
          "description": "The kind of company that completes it.",
          "$ref": "#/$defs/CircularClaim"
        },
        "markets": {
          "type": "array",
          "default": [],
          "items": {
            "type": "string"
          },
          "description": "ISO-3166 alpha-2 markets the counterpart search would cover."
        },
        "proximity_bound": {
          "type": "boolean",
          "default": false,
          "description": "True when the exchange only transacts over short distances (heat, CO2, water, bulky low-value material, shared capacity), so reachability constrains the search."
        },
        "grounding_sources": {
          "type": "array",
          "default": [],
          "items": {
            "type": "string"
          },
          "description": "Customer-safe CATEGORIES the claims rest on - where and when, never who. Paired with the list's `computed_at`, these are the provenance of everything shown here."
        },
        "outreach_draft_eligible": {
          "type": "boolean",
          "description": "Whether this entry may GROUND an outreach draft. False when the `resource` - the thing a message would be ABOUT - is an unconfirmed hypothesis; such an entry must not be used to compose outreach in any form, not even as a question, until the customer confirms it. True does NOT license asserting the `counterpart`: that is a hypothesis about a MARKET rather than about the customer, it carries its own `speech_act`, and on a true entry it is very often still `ASK`. Read both."
        },
        "requires_resource_confirmation": {
          "type": "boolean",
          "description": "True when running this entry requires `confirmedResource` on the trigger, because its resource is an unconfirmed hypothesis."
        },
        "credits_cost": {
          "type": "integer",
          "minimum": 0,
          "description": "What running the counterpart search costs, shown before anything is spent."
        }
      }
    },
    "Contact": {
      "type": "object",
      "description": "A discovered person at the company — customer-safe fields only. Most fields are nullable\nsince discovery frequently yields partial data. Any field not listed here is never\nreturned.\n",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's full name."
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's email address, where discovered."
        },
        "position": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's job title or role."
        },
        "phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "A direct phone number for the person."
        },
        "department": {
          "type": [
            "string",
            "null"
          ],
          "description": "The department or function the person works in."
        },
        "organization": {
          "type": [
            "string",
            "null"
          ],
          "description": "The organization or company the person is associated with."
        },
        "linkedin_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's LinkedIn profile URL."
        },
        "instagram_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's Instagram profile URL."
        },
        "facebook_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's Facebook profile URL."
        },
        "twitter_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's X (Twitter) profile URL."
        },
        "youtube_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's YouTube channel URL."
        },
        "telegram_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's Telegram contact URL."
        },
        "viber_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's Viber contact URL."
        },
        "whatsapp_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's WhatsApp click-to-chat URL."
        },
        "contact_address": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's street address, where discovered."
        },
        "contact_city": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's city."
        },
        "contact_country": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's country."
        },
        "contact_country_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's country as an ISO-3166-1 alpha-2 code."
        },
        "contact_region": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's sub-country region (e.g. state or province)."
        },
        "registry_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "The government registry this person was verified against, when applicable."
        },
        "email_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Provenance of `email` when it was INFERRED rather than directly discovered. `derived_domain_pattern` = a name-coupled mailbox reconstructed from the company's own observed local-part convention (confidence ~0.5, never verified); `micro_company_generic_pairing` = a sole owner paired to the company's generic mailbox. Absent (null) for a crawled/verified email. Use it to weight an inferred address (which carries bounce risk) before outreach."
        },
        "is_officer": {
          "type": "boolean",
          "description": "True when this person matches a statutory officer listed in a government registry. Present only when the company carries a registry officer roster; omitted from the object (not sent as false) otherwise."
        }
      }
    },
    "EvaluatedCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of screened candidates that have finished crawl + validation (a running verdict count = accepted + rejected). Complements `candidates_screened`: it keeps climbing through the crawl/validation tail — after screening plateaus — so a polling client sees liveness for the WHOLE run. Retains its final total once the discovery is terminal, where together with `candidates_screened` it is the funnel that explains the delivered count."
    },
    "JobIcpId": {
      "type": "string",
      "description": "The saved ICP this discovery was started from (`POST /api/v1/discoveries {\"icpId\": ...}`), for billing attribution — the same value the matching credit-ledger rows carry, so a charge reconciles back to the ICP that caused it. Served on EVERY job surface (the progressive status, the merged discovery view, the finished result, and each entry of the discoveries list) from one reader, so a customer can attribute a run to its ICP without waiting for the run to finish or cross-referencing the ledger. ABSENT (field omitted, never an empty string) when the run was ad-hoc from inline criteria. Ids are scoped to the calling customer — the same namespace `GET /api/v1/icps` returns."
    },
    "JobState": {
      "type": "string",
      "description": "Discovery lifecycle state. `queued` = accepted, not yet started; `running` and `processing` = discovery in progress; `completed` = finished and reached its target; `failed` = ended with an error; `exhausted` = finished but ran out of candidates before hitting the target; `cancelled` = stopped by the caller via `POST /mcp/jobs/{jobId}/cancel`. The last four are terminal.",
      "enum": [
        "queued",
        "running",
        "processing",
        "completed",
        "failed",
        "exhausted",
        "cancelled"
      ]
    },
    "Prospect": {
      "type": "object",
      "description": "A discovered company — customer-safe fields only. Internal scoring, provenance, and raw\ncontent fields are never present; any field not listed here is never returned. Most\nfields are nullable, since discovery frequently yields partial data. `domain` is always\npresent. A few fields are populated only on specific endpoints, noted per-field\n(e.g. `knowledge_graph`/`pages` on the detail endpoint, `semantic_score` on search).\n\nThere is deliberately no bare `source` field: a single name would be ambiguous about what\nit describes. Provenance is published per subject instead: `registry_source`,\n`employee_count_source`, `footer_legal_name_source` and `social_source` here, and\n`email_source` on the nested `contacts` entries.\n",
      "additionalProperties": false,
      "required": [
        "domain"
      ],
      "properties": {
        "domain": {
          "type": "string",
          "description": "The company's primary website domain. The stable identifier for the prospect."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's name."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Short description of what the company does."
        },
        "industry": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's primary industry (coarse-grained), returned as a human-readable Title Case display label (for example `Fashion Retail`, `Hotel & Lodging`, `Agriculture & Food Production`), not as a snake_case token. Internally each value is normalized to a canonical snake_case taxonomy token and rendered to the display label when the response is built; the tokens are: `fashion_retail`, `electronics_retail`, `grocery_retail`, `home_furniture`, `furniture_manufacturing`, `automotive`, `manufacturing`, `chemicals_materials`, `agriculture_food_production`, `logistics`, `b2b_services`, `technology_software`, `healthcare`, `financial_services`, `cosmetics_beauty`, `jewelry_accessories`, `hospitality_restaurant`, `hospitality_lodging`, `energy`, `sporting_goods`, `recreation`, `education`, and the specialty-retail categories `florist_flowers`, `bakery_pastry`, `butcher_delicatessen`, `optician_eyewear`, `pharmacy_drugstore`, `pet_shop`, `toy_hobby`, `stationery_office_supplies`, `bookstore`, `garden_center`, `musical_instruments`, and `hardware_diy`. The list is not strict — a value outside it may occasionally be returned — so treat it as the expected vocabulary rather than a closed enum. The snake_case tokens are the internal vocabulary only: they are not emitted in this field, and the prospects list endpoint has no `industry` query parameter, so the display label is not a filter value."
        },
        "employee_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Estimated number of employees."
        },
        "employee_count_source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "official_registry",
            "public_knowledge_base",
            "professional_network",
            "web_research",
            "company_website",
            "unverified_estimate",
            "verified",
            null
          ],
          "description": "Authority band of `employee_count` — a source-agnostic label for the kind of source that won the precedence contest when the value was last written (`official_registry` > `public_knowledge_base` > `professional_network` > `web_research` > `company_website` > `unverified_estimate`, with `verified` an operator override). `official_registry` is an official government/company registry; `public_knowledge_base` is a public, structured, source-referenced knowledge base; `professional_network` is a public professional-network profile; `web_research` is a third-party OSINT figure researched from cited public sources; `company_website` is the company's own website; `unverified_estimate` is an UNVERIFIED third-party or model-derived estimate — nothing was measured, filed or self-declared, so treat it as the pipeline's best guess and NOT as a sourced figure. Surfaced customer-side so the freshness/authority of the headcount can be audited (provenance of a delivered fact) without naming any internal pipeline/vendor. Null when no source has been recorded."
        },
        "employee_count_as_of": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "ISO-8601 UTC timestamp of when `employee_count` was last written by a winning source (server-stamped). The freshness marker paired with `employee_count_source`. Null when no source has been recorded."
        },
        "size_certainty": {
          "type": "string",
          "enum": [
            "verified",
            "estimated",
            "unknown"
          ],
          "description": "How much to trust company_size/employee_count: verified = official registry or declared; estimated = third-party or model estimate; unknown = no size."
        },
        "company_size": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "micro",
            "small",
            "medium",
            "large",
            "enterprise",
            null
          ],
          "description": "Company size bucket by employee headcount (lowercase; null when undetermined). `micro` (≤10 employees), `small` (≤50), `medium` (≤200), `large` (≤500), `enterprise` (500+). Uses the SAME lowercase tokens as the `company_sizes` INPUT filter (DiscoveryCriteria.company_sizes), so a value read off a result can be re-submitted verbatim as a filter without a 400. `micro` companies are returned by a `small` `company_sizes` filter."
        },
        "headquarters_location": {
          "type": [
            "string",
            "null"
          ],
          "description": "Headquarters location as a \"City, Country\" string."
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's country."
        },
        "country_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's country as an ISO-3166-1 alpha-2 code."
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's city."
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's state, province, or region."
        },
        "postal_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's postal or ZIP code."
        },
        "street": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's street address."
        },
        "street_romanized": {
          "type": [
            "string",
            "null"
          ],
          "description": "Latin-script transliteration of `street`, for companies in non-Latin-script markets."
        },
        "contacts": {
          "type": "array",
          "description": "People discovered at the company.",
          "items": {
            "$ref": "#/$defs/Contact"
          }
        },
        "phones": {
          "type": "array",
          "description": "Company phone numbers.",
          "items": {
            "type": "string"
          }
        },
        "company_emails": {
          "type": "array",
          "description": "General company email addresses (e.g. info@, sales@), as opposed to a specific person's.",
          "items": {
            "type": "string"
          }
        },
        "city_romanized": {
          "type": [
            "string",
            "null"
          ],
          "description": "Latin-script transliteration of city (non-Latin source markets)."
        },
        "state_romanized": {
          "type": [
            "string",
            "null"
          ],
          "description": "Latin-script transliteration of state (non-Latin source markets)."
        },
        "linkedin_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's LinkedIn page URL."
        },
        "instagram_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's Instagram profile URL."
        },
        "facebook_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's Facebook page URL."
        },
        "twitter_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's X (Twitter) profile URL."
        },
        "youtube_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's YouTube channel URL."
        },
        "telegram_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's Telegram channel or click-to-chat URL."
        },
        "viber_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's Viber click-to-chat URL."
        },
        "whatsapp_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's WhatsApp click-to-chat URL."
        },
        "weibo_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's Weibo profile URL."
        },
        "douyin_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's Douyin (Chinese TikTok) profile URL."
        },
        "wechat_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "WeChat account ID (WeChat has no public profile URL)."
        },
        "qq_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "QQ account ID (QQ has no public profile URL)."
        },
        "business_model": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "manufacturer",
            "retailer",
            "distributor",
            "service_provider",
            "unknown",
            null
          ],
          "description": "The company's classified business model — `manufacturer`, `retailer`, `distributor`, or `unknown`. Null when not classified."
        },
        "estimated_annual_revenue_usd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Estimated annual revenue in whole USD dollars, derived from a model (based on employee count). Null when undetermined — never a fabricated zero."
        },
        "estimated_revenue_currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO-4217 alpha-3 currency for the revenue estimate (currently always USD)."
        },
        "founded_year": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Year the company was founded (company-maturity signal). Null when unknown."
        },
        "reported_revenue_usd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Reported annual revenue in whole USD dollars, sourced from public company financials (distinct from the model-based `estimated_annual_revenue_usd`). Null when not reported."
        },
        "funding_total_usd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Total capital raised to date in whole USD dollars, from public company financials. Null when not reported."
        },
        "funding_latest_round": {
          "type": [
            "object",
            "null"
          ],
          "description": "Latest funding round (round name/type, date, amount, currency). Returned as a decoded object — the API decodes the stored JSON for you at the boundary, so do NOT decode a second time. The key set comes from the financial source and is not closed: read the keys you need and ignore the rest. Often null."
        },
        "web_traffic": {
          "type": [
            "object",
            "null"
          ],
          "description": "Website-traffic snapshot. Returned as a decoded object — the API decodes the stored JSON for you at the boundary, so do NOT decode a second time. The properties below are the ones commonly present; the key set comes from the traffic source and is not closed, so read the keys you need and ignore the rest. Often null.",
          "properties": {
            "visitsMonthly": {
              "type": [
                "number",
                "null"
              ],
              "description": "Visits in the most recent complete month."
            },
            "countryRank": {
              "type": [
                "number",
                "null"
              ],
              "description": "Traffic rank of the site within its own country (lower is busier)."
            },
            "avgDurationSeconds": {
              "type": [
                "number",
                "null"
              ],
              "description": "Average visit duration in seconds."
            },
            "history": {
              "type": [
                "array",
                "null"
              ],
              "description": "Month-by-month visit history, oldest period first.",
              "items": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Visits in that period."
                  },
                  "dateFrom": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Start of the period, `YYYY-MM`."
                  },
                  "dateTo": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "End of the period, `YYYY-MM`."
                  }
                }
              }
            }
          }
        },
        "hq_address": {
          "type": [
            "string",
            "null"
          ],
          "description": "Full one-line formatted headquarters address (companion to city/country/postal)."
        },
        "logo_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Company logo/image URL."
        },
        "source_published_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "Publication date of the web source this prospect was surfaced from (per-source freshness)."
        },
        "source_last_updated": {
          "type": [
            "string",
            "null"
          ],
          "description": "Last-updated date of the web source this prospect was surfaced from (per-source freshness)."
        },
        "registry_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's government registry identifier (e.g. IČO, HRB, KRS), where matched."
        },
        "registry_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Which government registry `registry_id` came from."
        },
        "lei": {
          "type": [
            "string",
            "null"
          ],
          "description": "Legal Entity Identifier (ISO 17442), where the company is present in the GLEIF register. Null otherwise."
        },
        "uscc": {
          "type": [
            "string",
            "null"
          ],
          "description": "Chinese Unified Social Credit Code. Populated only for Chinese companies. Null otherwise."
        },
        "social_profiles": {
          "type": [
            "array",
            "null"
          ],
          "description": "Per-platform public social profiles discovered for the company, beyond the singular per-platform `*_url` fields (which carry only the headline platform). One entry per platform, returned as decoded objects — the API decodes the stored JSON for you at the boundary, so do NOT decode a second time.",
          "items": {
            "type": "object",
            "required": [
              "platform",
              "url"
            ],
            "additionalProperties": false,
            "properties": {
              "platform": {
                "type": "string",
                "description": "Which public platform this entry is from, and the provenance for the rest of the entry's fields (e.g. `linkedin`, `youtube`, `twitter`, `instagram`)."
              },
              "url": {
                "type": "string",
                "description": "The public profile URL on that platform."
              },
              "follower_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Audience size on that platform (followers, or subscribers on video platforms). Null when the profile published no count."
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The company's own business summary as published on that platform, verbatim. Null when the profile published none."
              },
              "legal_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Registered legal-entity name CANDIDATE taken from that profile's own title or summary. A candidate only — it never overrides the company name. Null when the profile published no distinct legal name."
              },
              "extra_links": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                },
                "description": "External links the profile itself lists (subsidiary, other-market or store domains). Null for platforms that publish no such block."
              }
            }
          }
        },
        "employer_reputation_tier": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "strong",
            "mixed",
            "limited",
            null
          ],
          "description": "Coarse, un-attributed employer-reputation band — `strong`, `mixed`, or `limited`. A derived legitimacy/size-corroboration signal; NOT a third-party review platform's verbatim rating (which is never returned) and carrying NO source name. Omitted from the object (not sent as null) when no reputation signal is available."
        },
        "beian_number": {
          "type": [
            "string",
            "null"
          ],
          "description": "China MIIT web-filing number (beian = the ICP备案 recordal, e.g. 湘ICP备17001547号) mined from the site footer. A MIIT-registered-commercial-site provenance signal — NOT a corporate registry id (registry_source is set to 'MIIT-BEIAN' when present)."
        },
        "footer_legal_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Market-agnostic registered legal-name candidate anchored in the page footer / legal-notice region. Two producers today: the CN beian (ICP备案)/copyright footer (Chinese …有限公司 or English … LIMITED/LTD) and the DE/AT §5 TMG Impressum legal name (…GmbH/AG). Verbatim — never translated. A candidate that never overwrites company_name. Which producer supplied it is on footer_legal_name_source."
        },
        "footer_legal_name_source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "beian",
            "impressum",
            "impressum_own_domain",
            "copyright",
            null
          ],
          "description": "Where `footer_legal_name` was taken from — `beian` (Chinese MIIT web-filing footer), `impressum` (German/Austrian legal-notice footer), `impressum_own_domain` (the same legal notice, admitted because the name is printed beside the site's own domain even though it shares nothing with the brand, e.g. TOPADROIT a.s. on venira.cz), or `copyright` (a plain copyright line). Null when `footer_legal_name` is null."
        },
        "social_description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Business summary harvested from the prospect's public social profile page (no login). Winning-platform priority LinkedIn > YouTube > Twitter; the source platform is on social_source."
        },
        "social_follower_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Audience-size traction proxy from the winning social profile — LinkedIn follower count OR YouTube subscriber count (which one is on social_source)."
        },
        "social_legal_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Registered legal-entity name candidate from a social profile's og:title / og:description (never overwrites company_name; names never translated)."
        },
        "social_source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "linkedin",
            "youtube",
            "twitter",
            null
          ],
          "description": "Which public social profile the social intel above came from — `linkedin`, `youtube`, or `twitter`. Null when no social profile was found."
        },
        "social_extra_links": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "YouTube channel About-tab external links (subsidiary / other-market / store domains). A YouTube-only signal."
        },
        "nace_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's NACE industry-classification code, from its registry entry where available."
        },
        "legal_form": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's legal form (e.g. GmbH, s.r.o., Ltd), from its registry entry where available."
        },
        "officers": {
          "type": [
            "array",
            "null"
          ],
          "description": "Names of the company's statutory officers, from its government registry entry where available.",
          "items": {
            "type": "string"
          }
        },
        "registration_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "Date the company was registered, from its registry entry where available."
        },
        "discovered_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When this company was first discovered for you (ISO-8601)."
        },
        "detected_language": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO-639-1 language detected for the company's content."
        },
        "vat_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "VAT/tax identifier where available."
        },
        "detected_industry": {
          "type": [
            "string",
            "null"
          ],
          "description": "Finer-grained detected industry (companion to the coarse `industry`), returned as a Title Case display label like `industry`. Drawn from the same canonical snake_case taxonomy listed under `industry` — including the specialty-retail categories (`florist_flowers`, `bakery_pastry`, `butcher_delicatessen`, `optician_eyewear`, `pharmacy_drugstore`, `pet_shop`, `toy_hobby`, `stationery_office_supplies`, `bookstore`, `garden_center`, `musical_instruments`, `hardware_diy`) — and likewise not a strict closed set."
        },
        "company_status": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's operational status, where a government registry reports it (e.g. `active`, `liquidated`, `dissolved`). Free-text — not a fixed set."
        },
        "has_wikipedia_article": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Notability / enterprise signal — a Wikipedia article was found."
        },
        "domain_age_days": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Age of the registered domain in days — company maturity/stability signal."
        },
        "branch_regions": {
          "type": [
            "array",
            "null"
          ],
          "description": "Registry-authoritative ISO-3166-2 branch-office regions (multi-location footprint).",
          "items": {
            "type": "string"
          }
        },
        "sub_country_region": {
          "type": [
            "string",
            "null"
          ],
          "description": "The ISO-3166-2 sub-country region (e.g. `ES-VC`, `DE-BY`) the company's own headquarters geography places it in — resolved from its stored `state`, `city` and `postal_code`, so it can be checked against the address on the same record. It is the region a `sub_country_regions` discovery filter is matched against. Null when that geography does not resolve to a region; it is cleared again if a later correction to the address stops supporting it. A single HQ region, distinct from `branch_regions`."
        },
        "certifications": {
          "type": [
            "array",
            "null"
          ],
          "description": "Quality/compliance certifications the company publicly claims (e.g. ISO 9001:2015, IATF 16949, IPC-A-610, RoHS, REACH), extracted from the company's public web presence.",
          "items": {
            "type": "string"
          }
        },
        "customer_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Self-reported count of customers/clients served — a traction proxy (distinct from employee_count)."
        },
        "customer_count_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Provenance of customer_count. Always `self_reported_site` when customer_count is set (the company's own website states the count); null when customer_count is null."
        },
        "export_markets": {
          "type": [
            "object",
            "null"
          ],
          "description": "Export / market-distribution snapshot. Returned as a decoded object — the API decodes the stored JSON for you at the boundary, so do NOT decode a second time. Two shapes are emitted depending on what the source disclosed: `{\"regions\":{\"Europe\":48,...}}` (share per region) or `{\"export_share_pct\":80,\"regions\":[...]}` (headline share plus a region list). The key set is not closed. Often null."
        },
        "production_capacity": {
          "type": [
            "string",
            "null"
          ],
          "description": "Manufacturing-capacity snapshot (e.g. \"30,000 sq.m; 3,000 part numbers; 10+ SMT lines\") — a capability signal for manufacturing/EMS prospects."
        },
        "site_point_lat": {
          "type": [
            "number",
            "null"
          ],
          "description": "Latitude of the company's street-address portal (WGS84). Spain only. Often null."
        },
        "site_point_lat_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `site_point_lat`."
        },
        "site_point_lon": {
          "type": [
            "number",
            "null"
          ],
          "description": "Longitude of the company's street-address portal (WGS84). Spain only. Often null."
        },
        "site_point_lon_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `site_point_lon`."
        },
        "site_refcat": {
          "type": [
            "string",
            "null"
          ],
          "description": "Cadastral parcel reference (first 14 characters of the Spanish referencia catastral) of the parcel holding the address portal. Often null."
        },
        "site_refcat_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `site_refcat`."
        },
        "site_building_use": {
          "type": [
            "string",
            "null"
          ],
          "description": "Cadastral use of the buildings on that parcel (`industrial` wins on a mixed parcel). Often null."
        },
        "site_building_use_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `site_building_use`."
        },
        "site_floor_area_m2": {
          "type": [
            "number",
            "null"
          ],
          "description": "Gross floor area in square metres summed over every building on the cadastral parcel, that is the WHOLE parcel, not the company's share (see `site_floor_area_m2_method`). Often null."
        },
        "site_floor_area_m2_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `site_floor_area_m2`."
        },
        "hazard_flood_fluvial_t10_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "Modelled river-flood depth in metres at the site for a 10-year return period. 0.0 = inside the mapped area and dry at that return period; null or absent = outside the mapped area, i.e. UNKNOWN (not mapped), never \"no risk\"."
        },
        "hazard_flood_fluvial_t10_m_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `hazard_flood_fluvial_t10_m`."
        },
        "hazard_flood_fluvial_t100_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "Modelled river-flood depth in metres at the site for a 100-year return period. 0.0 = inside the mapped area and dry at that return period; null or absent = outside the mapped area, i.e. UNKNOWN (not mapped), never \"no risk\"."
        },
        "hazard_flood_fluvial_t100_m_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `hazard_flood_fluvial_t100_m`."
        },
        "hazard_flood_fluvial_t500_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "Modelled river-flood depth in metres at the site for a 500-year return period. 0.0 = inside the mapped area and dry at that return period; null or absent = outside the mapped area, i.e. UNKNOWN (not mapped), never \"no risk\"."
        },
        "hazard_flood_fluvial_t500_m_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `hazard_flood_fluvial_t500_m`."
        },
        "hazard_flood_marine_t100_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "Modelled coastal-flood depth in metres at the site for a 100-year return period. 0.0 = inside the mapped area and dry at that return period; null or absent = outside the mapped area, i.e. UNKNOWN (not mapped), never \"no risk\"."
        },
        "hazard_flood_marine_t100_m_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `hazard_flood_marine_t100_m`."
        },
        "hazard_flood_marine_t500_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "Modelled coastal-flood depth in metres at the site for a 500-year return period. 0.0 = inside the mapped area and dry at that return period; null or absent = outside the mapped area, i.e. UNKNOWN (not mapped), never \"no risk\"."
        },
        "hazard_flood_marine_t500_m_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `hazard_flood_marine_t500_m`."
        },
        "hazard_dana2024_flooded": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "True when the site lies inside the area flooded by the DANA storm of October 2024 (Spain), false when it lies inside the mapped area but was not flooded. Absent when the site is outside the mapped area, so unknown and never \"no risk\"."
        },
        "hazard_dana2024_flooded_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `hazard_dana2024_flooded`."
        },
        "site_motorway_access_road_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "Road distance in metres, one-way streets respected, from the site's access on the nearest enterable road to the nearest motorway or trunk-road node (see `site_motorway_access_road_m_method`). Absent unless the figure is provably exact, so absent means not determined, never \"no motorway nearby\"."
        },
        "site_motorway_access_road_m_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `site_motorway_access_road_m`."
        },
        "site_motorway_access_class": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "motorway",
            "trunk",
            "motorway_link",
            "trunk_link",
            null
          ],
          "description": "Road class of the nearest motorway or trunk node that `site_motorway_access_road_m` reaches."
        },
        "site_motorway_access_class_source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Attribution (dataset, publisher and licence) for `site_motorway_access_class`."
        },
        "site_floor_area_m2_method": {
          "type": [
            "string",
            "null"
          ],
          "description": "How `site_floor_area_m2` was derived; it is the whole cadastral parcel, not the company's share."
        },
        "site_motorway_access_road_m_method": {
          "type": [
            "string",
            "null"
          ],
          "description": "How `site_motorway_access_road_m` was derived and the rule under which it is published only when provably exact."
        },
        "served_industries": {
          "type": [
            "array",
            "null"
          ],
          "description": "Verticals/end-markets the company states it serves — a multi-value companion to detected_industry.",
          "items": {
            "type": "string"
          }
        },
        "branch_footprint": {
          "type": [
            "array",
            "null"
          ],
          "description": "Multi-site branch/office city names the company publicly lists (GeoNames-gated) — a human-readable companion to the ISO-3166-2 branch_regions.",
          "items": {
            "type": "string"
          }
        },
        "events": {
          "type": [
            "array",
            "null"
          ],
          "description": "Trade fairs, conferences and similar events the company itself publicly lists taking part in, within the last 24 months or the next 12 (at most 2, the ones closest to today). Each entry was verified against a quote on the company's own site; `source_url` is that page. Null when none is on record.",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "The event's name as the company writes it."
              },
              "start_date": {
                "type": "string",
                "description": "ISO yyyy-MM-dd start date."
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "City the event takes place in."
              },
              "role": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The company's role at the event.",
                "enum": [
                  "EXHIBITOR",
                  "SPEAKER",
                  "SPONSOR",
                  "AWARD_WINNER",
                  "ORGANISER",
                  "OTHER",
                  "PARTNER",
                  null
                ]
              },
              "kind": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "What kind of event it is (a trade fair, a conference or a summit survive the extractor's filter).",
                "enum": [
                  "TRADE_FAIR",
                  "CONFERENCE",
                  "SUMMIT",
                  "WEBINAR",
                  "AWARD_CEREMONY",
                  "SHAREHOLDER_MEETING",
                  "OWN_EVENT",
                  "OTHER",
                  null
                ]
              },
              "source_url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The company page the participation was read from."
              }
            }
          }
        },
        "origin_country": {
          "type": [
            "string",
            "null"
          ],
          "description": "The company's inferred country of origin, as an ISO-3166-1 alpha-2 code. Helps distinguish a headquarters from a local subsidiary."
        },
        "facts": {
          "type": "array",
          "description": "Extracted business facts about the company — leadership, products/services, market positioning, history, and certifications — each as a short natural-language statement WITH provenance (origin + when it was extracted) for SDR briefing. Present on every prospect; an empty array when no facts are available. Capped per prospect to keep the response bounded.",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "description": "The business fact, as a short natural-language statement."
              },
              "source": {
                "type": "string",
                "description": "Origin the fact was derived from — `web` (extracted from the company's public web content), `wikidata` (a structured Wikidata claim), or `wikipedia` (the resolved Wikipedia article).",
                "enum": [
                  "web",
                  "wikidata",
                  "wikipedia"
                ]
              },
              "source_url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "description": "Stable click-through link to the company HOMEPAGE — the entry point to the company's public web content. This is NOT necessarily the exact sub-page the fact was extracted from; the exact per-page source URL is not retained, so this field is the company homepage rather than an overclaimed extraction URL."
              },
              "extracted_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "ISO-8601 timestamp of when the fact was extracted."
              },
              "first_party": {
                "type": "boolean",
                "description": "`true` when the fact is VERIFIED to come from the company's OWN web presence — a citation whose registrable (eTLD+1) domain equals the prospect's.\n`false` means \"not verified as first-party\", which covers TWO different situations and is never a positive claim of third-party origin: the fact was mined from a third-party page (a directory, aggregator, news site or filing, and note Wikipedia/Wikidata count as third-party here however well their entity was resolved), OR its provenance cannot be established because no citation host was ever stored for it. The second case is not marginal — MEASURED on the production corpus, 46% of facts carry no stored citation host at all; they are legacy points and the inspectable sample was model-derived rather than site-derived. A consumer must therefore read `false` as \"unconfirmed\", not as \"independently sourced\".\nWhy it is customer-visible: a first-party claim is the company describing itself, while a third-party claim is someone else describing it, and an SDR should weigh a self-description differently from an independent one before quoting it. Third-party facts also carry the residual entity-confusion risk that first-party facts cannot: DNS ownership is collision-free, whereas a shared brand token, ticker or surname is not. Off-domain facts pass an entity-identity check, but that check can let a fact through when it is unavailable — which is exactly why the customer still gets to see the distinction.\nABSENCE IS NOT `false`. The key is omitted on facts stored before it was introduced, and such a fact's provenance is UNKNOWN, not third-party — a consumer that defaults a missing value to `false` will silently mislabel every It is therefore deliberately NOT in `required`."
              }
            },
            "required": [
              "text",
              "source"
            ]
          }
        },
        "knowledge_graph": {
          "description": "Extracted knowledge-graph facts about the company (relationship triples). Returned only by the detail endpoint (`GET /api/v1/prospects/{domain}`).",
          "type": [
            "array",
            "null"
          ],
          "items": {}
        },
        "knowledge_graph_grouped": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true,
          "description": "The same knowledge-graph facts, grouped by relationship type for convenience. Returned only by the detail endpoint."
        },
        "pages": {
          "description": "References to the company web pages that were read during discovery. Returned only by the detail endpoint.",
          "type": [
            "array",
            "null"
          ],
          "items": {}
        },
        "semantic_score": {
          "type": [
            "number",
            "null"
          ],
          "description": "Relevance score for this company against the search query. Returned only by the search endpoint (`GET /api/v1/prospects/search`)."
        }
      }
    },
    "SuggestedCriteria": {
      "type": "object",
      "additionalProperties": false,
      "description": "A partial `DiscoveryCriteria` delta. Merge it over your original request (the delta wins) and start a new discovery. Every field is optional; only the changed values are present. An empty array (e.g. `sub_country_regions: []`) explicitly clears that field. When the run under-delivered, an LLM improvement pass may also rewrite the free-text `query` itself — when present, `query` REPLACES your original `query` verbatim (it is not merged token-wise); apply it alongside the other fields to re-run the improved ICP.",
      "properties": {
        "query": {
          "type": "string",
          "description": "LLM-rewritten replacement for the free-text `query`, refined from this run's outcome to surface more matching companies. Present only when the improvement pass produced a better query; use it as-is in place of your original `query` on the re-run."
        },
        "locations": {
          "type": "array",
          "description": "Suggested replacement for `locations` (e.g. a wider set of countries).",
          "items": {
            "type": "string"
          }
        },
        "company_sizes": {
          "type": "array",
          "description": "Suggested replacement for `company_sizes`.",
          "items": {
            "type": "string",
            "enum": [
              "micro",
              "small",
              "medium",
              "large",
              "enterprise"
            ]
          }
        },
        "sub_country_regions": {
          "type": "array",
          "description": "Suggested replacement for `sub_country_regions`. An empty array clears the field.",
          "items": {
            "type": "string"
          }
        },
        "industries": {
          "type": "array",
          "description": "Suggested replacement for `industries`.",
          "items": {
            "type": "string"
          }
        },
        "keywords": {
          "type": "array",
          "description": "Suggested replacement for `keywords`.",
          "items": {
            "type": "string"
          }
        },
        "maxResults": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "description": "Suggested replacement for `maxResults`."
        }
      }
    },
    "Suggestion": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false,
      "description": "A single customer-safe entry derived from THIS job's measured signals. Two kinds share this shape, distinguished by `code`: (1) a bounded ADVICE recommendation (never a rejection reason); and (2) a mandatory `FILTER_RELAXED` DISCLOSURE that a requested filter was relaxed to fill quota. In both cases the human-readable `message` carries the detail — no internal rejection classes, funnel counts, or structured disclosure internals are delivered. Every suggestion carries exactly `{code, message, suggested_parameters}`.",
      "properties": {
        "code": {
          "type": "string",
          "description": "Bounded code (NOT a rejection reason). The first seven values are advice codes; `FILTER_RELAXED` is a mandatory relaxation disclosure, `TRANSIENT_INTERRUPTION` advises a plain re-run after an infra stall, `PIPELINE_LIMITED` and `ALREADY_DELIVERED` are honest non-actionable outcomes that deliberately carry NO broadening advice, and `REGION_PREFERENCE_APPLIED` is an informational note that a `sub_country_regions` preference shaped this run.",
          "enum": [
            "WIDEN_LOCATION",
            "ALLOW_LARGER_SIZE",
            "ALLOW_SMALLER_SIZE",
            "BROADEN_QUERY",
            "LIMITED_MARKET_DATA",
            "LOWER_TARGET",
            "icp_realignment",
            "TRANSIENT_INTERRUPTION",
            "PIPELINE_LIMITED",
            "ALREADY_DELIVERED",
            "FILTER_RELAXED",
            "REGION_PREFERENCE_APPLIED"
          ],
          "x-code-notes": {
            "TRANSIENT_INTERRUPTION": "Under-delivery caused by a transient infrastructure stall (crawl-queue TTL expiry), NOT market thinness. Message-only, retry-oriented — re-running the same search will likely return more.",
            "PIPELINE_LIMITED": "Under-delivery whose dominant cause was candidates WE could not turn into a usable company record — an anti-bot wall, a crawl failure, a page that was not a company, a phantom entity, or a verdict we could not reach. The customer's criteria are NOT the binding constraint, so this code deliberately carries NO `suggested_parameters` and no broadening advice: telling a customer to widen their filters to compensate for our coverage gap would be misleading.",
            "ALREADY_DELIVERED": "Under-delivery whose dominant cause was candidates that MATCHED the criteria and were dropped only because they are already known — already delivered under this ICP, the customer's own domain, a competitor, or a duplicate. Supply exhaustion for this exact search profile; broadening would not have recovered them, so the code is message-only.",
            "FILTER_RELAXED": "Mandatory disclosure that a requested filter (`company_sizes` or `sub_country_regions`) was relaxed so some RETURNED prospects fall outside it. The `message` states which filter and by how much; the underlying detail (violating prospects, match counts) is never delivered. Carries `suggested_parameters` clearing that filter (e.g. `{sub_country_regions: []}`) as the one-tap correction.",
            "REGION_PREFERENCE_APPLIED": "Informational note emitted on a terminal run whose request carried a non-empty `sub_country_regions` when a quantified `FILTER_RELAXED` region disclosure did not fire (the region signal often finalizes only after async enrichment). Discloses that the regional filter is a PREFERENCE — in-region companies are ranked higher while out-of-region companies are still returned ranked lower — so results are more targeted but fewer. Carries the same `{sub_country_regions: []}` correction to broaden coverage across the whole country."
          }
        },
        "message": {
          "type": "string",
          "description": "Customer-safe, human-readable recommendation or disclosure. Contains no internal rejection reasons or funnel counts."
        },
        "suggested_parameters": {
          "description": "Optional criteria changes to apply and re-run. Absent when the advice needs no parameter change.",
          "$ref": "#/$defs/SuggestedCriteria"
        }
      }
    },
    "TerminalReason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "candidates_exhausted",
        "trailing_candidates_forgiven",
        "candidate_cap_reached",
        "candidate_search_failed",
        "time_limit_reached",
        "stalled_no_progress",
        "fan_in_incomplete",
        "target_reached",
        "saturated_known_set",
        "cancelled_by_customer",
        "processing_timeout",
        null
      ],
      "description": "Why the discovery stopped, once terminal; null while still running, and null on any job terminal before this field's writers shipped. Carried on BOTH the progressive status and the finalized result — they read the same durable value, so the two surfaces cannot disagree about why a run ended. `candidates_exhausted` = the market had no more matching candidates to evaluate, and every candidate it did dispatch was evaluated; `trailing_candidates_forgiven` = the run stopped while a small remainder of its own candidates (up to 5%) was still being evaluated, so the shortfall was forgiven rather than exhausted — reported separately from `candidates_exhausted` because the two call for OPPOSITE responses: a genuinely dry market wants a wider profile, whereas a forgiven remainder means the run was cut short and re-running the SAME profile may deliver; `candidate_cap_reached` = when a run's candidates ran out before your target, it fetched further batches of new candidates, and it stopped because it had screened the maximum number of candidates one run may evaluate — the sources were still returning new candidates, so the shortfall reflects the per-run screening limit, not an exhausted market; `candidate_search_failed` = the run's candidates ran out before your target and the search for further candidates failed repeatedly, so the market was never shown to be exhausted — re-running the SAME profile later may deliver; `time_limit_reached` = the run hit its time budget while still producing; `stalled_no_progress` = the run stopped producing results and was terminated early rather than hitting its budget (a different situation from either of the two above, and reported separately so it is not mistaken for a thin market or a short budget); `fan_in_incomplete` = a search step never finished, so the run was never able to ask for more candidates; `target_reached` = the run delivered everything you asked for; `saturated_known_set` = every delivered domain was already yours from an earlier search (refunded); `cancelled_by_customer` = you cancelled it via `POST /mcp/jobs/{jobId}/cancel`; `processing_timeout` = the run did not finish within the maximum processing time, so it was stopped and failed (refunded); re-running the SAME profile later may deliver. When credits are refunded, the refund reason matches this."
    }
  }
}