{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/companydata-dk/json-schema/companydata-dk-saved-screen-response-schema.json",
  "title": "SavedScreenResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/companydata-dk-screening-api-openapi.yml#/components/schemas/SavedScreenResponse",
  "properties": {
    "screen_id": {
      "type": "string",
      "title": "Screen Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "filters": {
      "$ref": "#/$defs/ScreenFilters"
    },
    "webhook_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Webhook Id"
    },
    "active": {
      "type": "boolean",
      "title": "Active"
    },
    "matched_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Matched Count",
      "description": "Match count at the last evaluation"
    },
    "last_evaluated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Evaluated At"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "screen_id",
    "name",
    "filters",
    "active",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "DateRange": {
      "properties": {
        "from": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "From",
          "description": "Inclusive start date"
        },
        "to": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "To",
          "description": "Inclusive end date"
        }
      },
      "type": "object",
      "title": "DateRange",
      "description": "Inclusive date range. At least one bound must be set."
    },
    "FinancialMetric": {
      "type": "string",
      "enum": [
        "revenue",
        "gross_profit",
        "operating_profit",
        "profit_loss",
        "equity",
        "total_assets",
        "equity_ratio",
        "current_ratio",
        "return_on_equity",
        "profit_margin",
        "revenue_growth",
        "gross_profit_growth",
        "equity_growth"
      ],
      "title": "FinancialMetric",
      "description": "Key figures available as screening criteria.\n\nEach value is a key in the `latest_financials` subdocument. Amounts are\nDKK from the company's most recent annual report; ratios are fractions\n(equity_ratio 0.15 = 15% soliditetsgrad)."
    },
    "GeoRadius": {
      "properties": {
        "lat": {
          "type": "number",
          "maximum": 90.0,
          "minimum": -90.0,
          "title": "Lat",
          "description": "Latitude of center"
        },
        "lng": {
          "type": "number",
          "maximum": 180.0,
          "minimum": -180.0,
          "title": "Lng",
          "description": "Longitude of center"
        },
        "radius": {
          "type": "integer",
          "maximum": 50000.0,
          "minimum": 50.0,
          "title": "Radius",
          "description": "Radius in meters (50-50000)"
        }
      },
      "type": "object",
      "required": [
        "lat",
        "lng",
        "radius"
      ],
      "title": "GeoRadius",
      "description": "Circular geographic area (same bounds as /v1/companies geo search)."
    },
    "NumericRange": {
      "properties": {
        "min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min",
          "description": "Inclusive lower bound"
        },
        "max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max",
          "description": "Inclusive upper bound"
        }
      },
      "type": "object",
      "title": "NumericRange",
      "description": "Inclusive min/max range. At least one bound must be set."
    },
    "ScreenFilters": {
      "properties": {
        "industry_codes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 20,
          "title": "Industry Codes",
          "description": "DB07 industry codes, 2-6 digits. Codes shorter than 6 digits match as prefixes: `47` matches every retail code. Matches primary or secondary industry."
        },
        "company_types": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 20,
          "title": "Company Types",
          "description": "Company type codes, e.g. A/S, ApS, ENK"
        },
        "statuses": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 4,
          "title": "Statuses",
          "description": "Company statuses to include. Defaults to active companies only. Valid values: active, dissolved, under_bankruptcy, liquidation."
        },
        "founded": {
          "anyOf": [
            {
              "$ref": "#/$defs/DateRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Founding date range (inclusive)"
        },
        "municipality_codes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 99,
          "title": "Municipality Codes",
          "description": "Municipality codes"
        },
        "postal_codes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 100,
          "title": "Postal Codes",
          "description": "Postal codes"
        },
        "region_codes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 5,
          "title": "Region Codes",
          "description": "Region codes (resolved to the region's municipalities)"
        },
        "geo": {
          "anyOf": [
            {
              "$ref": "#/$defs/GeoRadius"
            },
            {
              "type": "null"
            }
          ],
          "description": "Circular geographic area around a coordinate"
        },
        "employees": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Employee count range. Uses the best known headcount (max of CVR-reported and annual-report FTE)."
        },
        "financials": {
          "additionalProperties": {
            "$ref": "#/$defs/NumericRange"
          },
          "propertyNames": {
            "$ref": "#/$defs/FinancialMetric"
          },
          "type": "object",
          "title": "Financials",
          "description": "Key figure ranges, e.g. `{\"equity_ratio\": {\"min\": 0.15}}`. Valid keys: revenue, gross_profit, operating_profit, profit_loss, equity, total_assets, equity_ratio, current_ratio, return_on_equity, profit_margin, revenue_growth, gross_profit_growth, equity_growth. Amounts in DKK; ratios and growth rates as fractions. Note that most small companies (reporting class B) do not publish revenue, only gross profit. A company only matches a metric filter if its latest annual report contains that metric."
        },
        "reporting_classes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 4,
          "title": "Reporting Classes",
          "description": "Reporting classes (regnskabsklasse) to include: A, B, C, D"
        },
        "financial_period_end_after": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Financial Period End After",
          "description": "Only match companies whose latest annual report period ends on or after this date (freshness guard)"
        },
        "late_filings": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Number of the last 5 annual reports filed after the statutory deadline (ÅRL § 138). Only companies with computed reporting signals match."
        },
        "auditor_changes": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Auditor firm changes across the last 5 annual reports"
        },
        "has_overdue_filing": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Overdue Filing",
          "description": "Active companies whose next expected annual report has passed its statutory deadline without being published"
        },
        "has_going_concern": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Going Concern",
          "description": "The latest report carries a going concern emphasis from the auditor"
        },
        "has_qualified_opinion": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Qualified Opinion",
          "description": "The latest auditor opinion is not unqualified"
        },
        "cds_score": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "CDS (CompanyData Score) range, 0-100. Only companies with a computed score match."
        },
        "cds_ratings": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 5,
          "title": "Cds Ratings",
          "description": "CDS rating buckets to include: excellent, good, moderate, high_risk, critical"
        },
        "has_phone": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Phone",
          "description": "Company has a phone number"
        },
        "has_email": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Email",
          "description": "Company has an email address"
        },
        "has_website": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Website",
          "description": "Company has a website"
        },
        "has_properties": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Properties",
          "description": "Company owns properties"
        },
        "property_area": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Total building area (m²) across owned properties"
        },
        "property_zones": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 3,
          "title": "Property Zones",
          "description": "Planzone of owned properties: byzone, landzone and/or sommerhusomraade. Matches companies owning at least one property in any selected zone."
        },
        "has_flood_risk_properties": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Flood Risk Properties",
          "description": "Company owns at least one property with elevated flood risk (in a cloudburst depression or flooded at a storm surge of 3 m or less, per Klimadatastyrelsen's DHM models)"
        },
        "has_poor_energy_label": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Poor Energy Label",
          "description": "Company owns at least one property whose current energy label is D, E, F or G (per Energistyrelsen's EMOData register)"
        },
        "auditor_cvrs": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 10,
          "title": "Auditor Cvrs",
          "description": "Companies whose current registered auditor is one of these audit firms (CVR numbers)"
        },
        "contact_role_categories": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 9,
          "title": "Contact Role Categories",
          "description": "Companies with an enriched contact person in any of these role categories (management, sales, marketing, it, hr, finance, operations, procurement, customer_service). Sourced from the company's own website."
        },
        "has_livestock": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Livestock",
          "description": "Company has at least one active livestock herd in CHR. Companies with a CHR marketing protection are excluded."
        },
        "livestock_species_codes": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "maxItems": 20,
          "title": "Livestock Species Codes",
          "description": "CHR species (dyreart) codes, e.g. 12=Kvæg, 15=Svin, 13=Får. Matches companies with at least one active herd of any selected species. Implies the CHR marketing protection exclusion."
        },
        "exclude_advertising_protected": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exclude Advertising Protected",
          "description": "Exclude companies with CVR advertising protection (reklamebeskyttelse). Required when results are used for direct marketing."
        }
      },
      "type": "object",
      "title": "ScreenFilters",
      "description": "Screening criteria. All given filters are combined with AND.\n\nAt least one filter beyond `statuses` must be set."
    }
  }
}