{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reqbeat-com/json-schema/reqbeat-com-watch-response-schema.json",
  "title": "WatchResponse",
  "description": "One live watch, as its owner sees it (signalsapi-3963). `criteria` is\nechoed exactly as it was authored -- `watch_criteria.parse()` normalizes on\nthe read side at fan-out, so the row is the customer's own text.\n\nThe three rate fields (signalsapi-4442) are what tell a CAPPED watch from a\nquiet one: without them a watch saturating its declared\n`max_fires_per_hour` -- whose excess fires are dropped, not queued -- looked\nbyte-identical to one nobody is hiring against.\n\nThe four heartbeat fields (signalsapi-4443) answer the question one rung\nbefore that: a watch firing NOTHING was indistinguishable from one that is\nbroken, wall-blocked, or matching a criteria set that can never match.\n`last_fired_at` is when it last matched anything (`null` if never) and\n`status` is one of `watch_service.WATCH_STATUSES` -- the one-word reason,\nnever a boolean, because \"upgrade the plan\", \"raise your own cap\" and \"fix\nyour endpoint\" are three different fixes that must not render the same.\n\n`POST /v1/watches` returns this same shape (signalsapi-5505) rather than\na bare `{id}` -- a fresh watch's health fields are well-defined (zero\nfires, not yet rate-limited) and a caller that wants to show the new\nwatch immediately would otherwise have to round-trip `GET /v1/watches`\nfor a response its own create call already has the data for.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reqbeat-com-openapi.json#/components/schemas/WatchResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "company_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Company Id"
    },
    "criteria": {
      "anyOf": [
        {
          "$ref": "#/$defs/Criteria"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_types": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Event Types"
    },
    "webhook_endpoint_id": {
      "type": "integer",
      "title": "Webhook Endpoint Id"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "fires_last_hour": {
      "type": "integer",
      "title": "Fires Last Hour"
    },
    "max_fires_per_hour": {
      "type": "integer",
      "title": "Max Fires Per Hour"
    },
    "rate_limited": {
      "type": "boolean",
      "title": "Rate Limited"
    },
    "last_fired_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Fired At"
    },
    "fires_last_7d": {
      "type": "integer",
      "title": "Fires Last 7D"
    },
    "fires_last_30d": {
      "type": "integer",
      "title": "Fires Last 30D"
    },
    "status": {
      "type": "string",
      "title": "Status"
    }
  },
  "type": "object",
  "required": [
    "id",
    "event_types",
    "webhook_endpoint_id",
    "created_at",
    "fires_last_hour",
    "max_fires_per_hour",
    "rate_limited",
    "fires_last_7d",
    "fires_last_30d",
    "status"
  ],
  "$defs": {
    "Criteria": {
      "properties": {
        "event": {
          "$ref": "#/$defs/CriteriaEvent"
        },
        "req": {
          "$ref": "#/$defs/CriteriaReq"
        },
        "company": {
          "$ref": "#/$defs/CriteriaCompany"
        },
        "max_fires_per_hour": {
          "type": "integer",
          "maximum": 10000.0,
          "minimum": 1.0,
          "title": "Max Fires Per Hour"
        },
        "dedup_window_days": {
          "type": "integer",
          "maximum": 90.0,
          "minimum": 1.0,
          "title": "Dedup Window Days"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "Criteria",
      "description": "A closed AND-of-ORs over three namespaced groups. At least one field must be constrained."
    },
    "CriteriaCompany": {
      "properties": {
        "industry": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Industry"
        },
        "company_kind": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Company Kind"
        },
        "country": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Country"
        },
        "headcount_band": {
          "items": {
            "type": "string",
            "enum": [
              "1-10",
              "11-50",
              "51-200",
              "201-500",
              "501-1000",
              "1001-5000",
              "5001+"
            ]
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Headcount Band"
        },
        "industry_terms": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Industry Terms"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "CriteriaCompany",
      "description": "The `company` criteria group: AND across fields, OR within a field."
    },
    "CriteriaEvent": {
      "properties": {
        "company_id": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Company Id"
        },
        "event_type": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Event Type"
        },
        "board": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Board"
        },
        "source_type": {
          "items": {
            "type": "string",
            "enum": [
              "ats_tenant",
              "board"
            ]
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Source Type"
        },
        "ats_vendor": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Ats Vendor"
        },
        "function": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Function"
        },
        "country": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Country"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "CriteriaEvent",
      "description": "The `event` criteria group: AND across fields, OR within a field."
    },
    "CriteriaReq": {
      "properties": {
        "seniority_level": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Seniority Level"
        },
        "function": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Function"
        },
        "remote_type": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Remote Type"
        },
        "skills": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Skills"
        },
        "q": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Q"
        },
        "location": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Location"
        },
        "q_excludes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 64,
          "minItems": 1,
          "title": "Q Excludes"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "CriteriaReq",
      "description": "The `req` criteria group: AND across fields, OR within a field."
    }
  }
}