{
  "openapi": "3.1.0",
  "info": {
    "title": "Delta Registry — UK HSE Convictions + Notices - Enforcement Delta API",
    "description": "Track UK HSE enforcement action: prosecutions and fines from the register of convictions, plus Improvement and Prohibition notices. Filter by company name, region, industry, fine amount, notice type and date. Delta mode flags new and updated compliance risk. Pay per record, no proxy needed.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jV35qppM82fjyjsle/runs": {
      "post": {
        "operationId": "startUkHseEnforcementMonitorRun",
        "summary": "Start an async run of: Track UK HSE enforcement action: prosecutions and fines from the register of convictions, plus Improvement and Prohibition notices. Filter by company name, region, industry, fine amount, notice type and date. Delta mode flags new and updated compliance risk. Pay per record, no proxy needed.",
        "x-async-pattern-reason": "No production run history exists for this actor — defaulting to the async run+poll pattern as a precaution, not a measurement. Re-run this generator once real telemetry exists to potentially switch it to sync.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "datasets": {
                    "type": "array",
                    "description": "Convictions = successful prosecutions (defendant, fine, costs, breaches, court, hearing date; HSE keeps 5 years). Notices = Improvement and Prohibition enforcement notices (recipient, type, served/compliance dates, result; HSE keeps 10 years).",
                    "default": [
                      "convictions",
                      "notices"
                    ],
                    "items": {
                      "type": "string",
                      "enum": [
                        "convictions",
                        "notices"
                      ]
                    },
                    "minItems": 1
                  },
                  "nameContains": {
                    "type": "string",
                    "description": "Substring match on the defendant's (convictions) or recipient's (notices) name, e.g. 'Skanska' or 'Balfour Beatty'. The contractor-vetting filter. Quotes are treated as single-character wildcards."
                  },
                  "descriptionContains": {
                    "type": "string",
                    "description": "Full-text substring over the case description (convictions) or notice summary (notices), e.g. 'asbestos', 'scaffold', 'silica'."
                  },
                  "localAuthorityContains": {
                    "type": "string",
                    "description": "Local authority where the offence occurred, e.g. 'Bradford', 'Cardiff UA'."
                  },
                  "mainActivityContains": {
                    "type": "string",
                    "description": "A numeric value matches the SIC 2007 code of the offence location; any other text matches the activity description ('ROOFING', 'MACHINING'). The site keeps the two in different columns, so a code never matches as text and vice versa. The code match is a CONTAINS match on the register: use a full 5-digit code for one class ('43910' = roofing) or a 4-digit group ('4391'); 2-3 digit values also match every code that merely contains those digits ('43' returns 14310, 24310, 46430 ...) - use the industry filter for broad selections."
                  },
                  "region": {
                    "type": "string",
                    "description": "HSE's seven UK regions.",
                    "default": "",
                    "enum": [
                      "",
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7"
                    ]
                  },
                  "country": {
                    "type": "string",
                    "description": "Country of the offence location.",
                    "default": "",
                    "enum": [
                      "",
                      "8",
                      "9",
                      "10",
                      "11"
                    ]
                  },
                  "industry": {
                    "type": "string",
                    "description": "HSE's five industry groups.",
                    "default": "",
                    "enum": [
                      "",
                      "12",
                      "13",
                      "14",
                      "15",
                      "16"
                    ]
                  },
                  "hseDivision": {
                    "type": "string",
                    "description": "HSE's operational division (finer than region).",
                    "default": "",
                    "enum": [
                      "",
                      "17",
                      "18",
                      "19",
                      "20",
                      "21",
                      "22",
                      "23",
                      "24",
                      "25",
                      "26",
                      "27"
                    ]
                  },
                  "dateFrom": {
                    "type": "string",
                    "description": "Offence date (convictions) / date the notice was served (notices). Absolute (2026-01-01) or relative ('30 days', '6 months', '1 year' back from today, UK calendar). Note: both dates lag publication on the register by weeks to years - for 'what is new on the register' use delta mode instead."
                  },
                  "dateTo": {
                    "type": "string",
                    "description": "Absolute or relative upper bound of the same date. Leave empty for 'today'."
                  },
                  "hseReference": {
                    "type": "string",
                    "description": "Everything about one party: the numeric HSE Reference shown on a defendant or recipient page (the same id is used on both registers), e.g. 4392330.",
                    "pattern": "^\\s*\\d+\\s*$"
                  },
                  "recordNumber": {
                    "type": "string",
                    "description": "Look up one record by its case number (convictions) or notice number (notices), e.g. 4883993 or 316005113.",
                    "pattern": "^\\s*\\d+\\s*$"
                  },
                  "defendantStatus": {
                    "type": "string",
                    "description": "Legal form of the defendant. Convictions only.",
                    "default": "",
                    "enum": [
                      "",
                      "1980",
                      "1972",
                      "1981",
                      "1974",
                      "1976",
                      "1978",
                      "1977",
                      "1973",
                      "1975",
                      "1979"
                    ]
                  },
                  "resultingFromFatality": {
                    "type": "string",
                    "description": "Only cases that resulted from the investigation of a (RIDDOR-reportable) fatality. Convictions only.",
                    "default": "any",
                    "enum": [
                      "any",
                      "yes",
                      "no"
                    ]
                  },
                  "minTotalFineGbp": {
                    "type": "integer",
                    "description": "Only cases with a total fine of at least this amount. Tip: 100000 leaves about 50 of the 210 cases.",
                    "minimum": 0
                  },
                  "maxTotalFineGbp": {
                    "type": "integer",
                    "description": "Only cases with a total fine of at most this amount.",
                    "minimum": 0
                  },
                  "noticeTypes": {
                    "type": "array",
                    "description": "HSE's nine notice-type codes (labels verified against the register, 2026-09-07). '03' is the ordinary Improvement Notice (22,000+); '01' and '02' are the rare Crown / FEPA variants. Select several to get their union. Notices only.",
                    "default": [],
                    "items": {
                      "type": "string",
                      "enum": [
                        "01",
                        "02",
                        "03",
                        "04",
                        "05",
                        "06",
                        "07",
                        "08",
                        "09"
                      ]
                    }
                  },
                  "act": {
                    "type": "string",
                    "description": "Primary legislation of the breach. Notices only (labels are the register's own, some truncated by the site).",
                    "default": "",
                    "enum": [
                      "",
                      "502",
                      "517",
                      "519",
                      "518",
                      "491",
                      "512",
                      "490",
                      "481",
                      "488",
                      "504",
                      "500",
                      "513",
                      "507",
                      "479",
                      "482",
                      "515",
                      "487",
                      "505",
                      "516",
                      "501",
                      "514",
                      "499",
                      "497",
                      "489",
                      "495",
                      "478",
                      "494",
                      "511",
                      "509",
                      "521",
                      "520",
                      "483",
                      "485",
                      "486",
                      "506",
                      "503",
                      "493",
                      "492",
                      "484",
                      "496",
                      "510",
                      "508",
                      "480"
                    ]
                  },
                  "eventTypes": {
                    "type": "array",
                    "description": "SANCTION = a conviction not delivered before; NEW_LISTING = a notice not delivered before; UPDATED = a record you already received whose case/notice page changed (a notice complied with, a revised compliance date, a breach or hearing added) - delta mode only. Applied by the delta engine, not by the site: changing it later does not fork the delta memory.",
                    "default": [
                      "SANCTION",
                      "NEW_LISTING",
                      "UPDATED"
                    ],
                    "items": {
                      "type": "string",
                      "enum": [
                        "SANCTION",
                        "NEW_LISTING",
                        "UPDATED"
                      ]
                    }
                  },
                  "onlyNew": {
                    "type": "boolean",
                    "description": "Remembers every record it has delivered (per filter set, in a named key-value store) and returns only records that are new or whose page changed since. Convictions (~210 records) are always walked in full; notices stop at the first two pages of already-known records, so a scheduled run costs a few pages.",
                    "default": false
                  },
                  "recheckDays": {
                    "type": "integer",
                    "description": "In delta mode, known records that are still open (Improvement Notices with Result 'Ongoing', and every conviction) are re-read for this many days after they were first delivered (or after their register date, whichever is later) to detect UPDATED events - the register has no 'last updated' field, so this is the only way to see a notice being complied with or a hearing being added. 0 disables re-checks. Up to 2,000 records are re-checked per run.",
                    "default": 180,
                    "minimum": 0
                  },
                  "deltaStateName": {
                    "type": "string",
                    "description": "Optional label for the memory of a monitoring task. Defaults to a fingerprint of your filters, so different schedules never interfere. Set the same name on two tasks to make them share one memory.",
                    "pattern": "^[A-Za-z0-9-]{1,30}$"
                  },
                  "resetState": {
                    "type": "boolean",
                    "description": "Forget every previously delivered record for this delta state and re-baseline (the run then returns up to 'Max records per register' most recently entered records).",
                    "default": false
                  },
                  "maxItemsPerDataset": {
                    "type": "integer",
                    "description": "Hard cap on delivered records per selected register (and therefore on cost: you pay per record). On the very first delta run the cap defines the baseline: the oldest record that run delivers is remembered per register, and records entered before it are history - later delta runs never deliver or charge for them, whatever the cap (run once with onlyNew=false, or set a high cap on the first run, if you want the history). On every later delta run the overflow is a backlog: the walk remembers where it stopped (a per-register watermark in the delta memory) and the next run walks down to that point instead of stopping at the records already delivered.",
                    "default": 100,
                    "minimum": 1
                  },
                  "fetchDetail": {
                    "type": "boolean",
                    "description": "Opens each record's own page for the description, dates, fine and costs, result, address, industry and HSE admin fields (plus, for convictions, the per-case breach list). Off = listing-row-only records (name, date, local authority, main activity, notice type) at the cheaper 'result-summary' price; no UPDATED detection is possible without it.",
                    "default": true
                  },
                  "fetchBreachDetail": {
                    "type": "boolean",
                    "description": "Convictions: opens each breach's page for the court, Act section / Regulation paragraph, hearing date, result and per-breach fine. Notices: fetches the breach list (Act / regulation / paragraph per breach). Off = the cheaper 'result-summary' price.",
                    "default": true
                  },
                  "fetchPartyDetail": {
                    "type": "boolean",
                    "description": "Opens the party's page (registered address, Status such as 'Private Company' or 'Individual', HSE Reference) and its case and notice lists on both registers - the repeat-offender signal (3 extra requests per record, no extra charge).",
                    "default": true
                  },
                  "maxConcurrency": {
                    "type": "integer",
                    "description": "Run-wide cap on simultaneous HTTP requests (listing, detail, breach and party pages together - never more than this in flight). The register is a classic-ASP site that answered 17 concurrent requests without throttling; 5 keeps a 100-record run around a minute.",
                    "default": 5,
                    "minimum": 1
                  },
                  "dateRange": {
                    "type": "string",
                    "description": "Kept for tasks created with version 1: '24h', '7d' or '30d' are interpreted as 'Date from'.",
                    "pattern": "^(24h|7d|30d)$"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Run started. Poll GET /actor-runs/{runId} with the returned run id until status is SUCCEEDED, then fetch its dataset items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-openai-isConsequential": false
      }
    },
    "/actor-runs/{runId}": {
      "get": {
        "operationId": "getUkHseEnforcementMonitorRunStatus",
        "summary": "Poll the status of a previously started run.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current run status. When status is SUCCEEDED, fetch the dataset via GET /datasets/{datasetId}/items, passing this response's defaultDatasetId field as {datasetId}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "defaultDatasetId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-openai-isConsequential": false
      }
    },
    "/datasets/{datasetId}/items": {
      "get": {
        "operationId": "getUkHseEnforcementMonitorDatasetItems",
        "summary": "Fetch the dataset items produced by a completed run.",
        "parameters": [
          {
            "name": "datasetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of normalized records from the actor run.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "actorSpecification": 1,
                    "title": "UK HSE enforcement records",
                    "description": "One item per conviction (recordType 'conviction') or enforcement notice (recordType 'notice') from the HSE public registers. Raw site strings are kept verbatim next to normalised siblings (ISO dates, numeric GBP, postcode, SIC code, booleans) so the data drops straight into a warehouse, CRM or spreadsheet. Within a run, UPDATED events are appended first, then new records oldest-first; read newest-first with ?desc=true.",
                    "fields": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "record_id": {
                          "type": "string",
                          "title": "Record ID",
                          "description": "caseNumber or noticeNumber - stable across runs."
                        },
                        "event_type": {
                          "type": "string",
                          "title": "Event type",
                          "description": "SANCTION (conviction not delivered before), NEW_LISTING (notice not delivered before) or UPDATED (a previously delivered record whose case/notice page changed).",
                          "enum": [
                            "SANCTION",
                            "NEW_LISTING",
                            "UPDATED"
                          ]
                        },
                        "scraped_at": {
                          "type": "string",
                          "title": "Scraped at",
                          "description": "ISO-8601 UTC timestamp of this extraction."
                        },
                        "is_new": {
                          "type": "boolean",
                          "title": "Is new",
                          "description": "true when this record was never delivered by a previous run of this delta state."
                        },
                        "source_url": {
                          "type": "string",
                          "title": "Source URL",
                          "description": "The official HSE register page."
                        },
                        "data_source": {
                          "type": "string",
                          "title": "Data source",
                          "description": "Open Government Licence v3.0 attribution string."
                        },
                        "recordType": {
                          "type": "string",
                          "title": "Record type",
                          "enum": [
                            "conviction",
                            "notice"
                          ]
                        },
                        "caseNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Case number",
                          "description": "Convictions only."
                        },
                        "noticeNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Notice number",
                          "description": "Notices only."
                        },
                        "defendantName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Defendant",
                          "description": "Convictions only."
                        },
                        "defendantId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Defendant ID (HSE reference)"
                        },
                        "recipientName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Recipient",
                          "description": "Notices only."
                        },
                        "recipientId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Recipient ID (HSE reference)"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Description"
                        },
                        "offenceDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Offence date (raw)",
                          "example": "27/07/2021"
                        },
                        "offenceDateIso": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Offence date",
                          "description": "YYYY-MM-DD."
                        },
                        "hearingDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Latest hearing date (raw)"
                        },
                        "hearingDateIso": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Latest hearing date",
                          "description": "Newest Date of Hearing across the case's breaches - the closest thing to a publication date."
                        },
                        "totalFine": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Total fine (raw)",
                          "example": "£400,000.00"
                        },
                        "totalFineGbp": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "title": "Total fine (GBP)"
                        },
                        "totalCosts": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Costs awarded to HSE (raw)"
                        },
                        "totalCostsGbp": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "title": "Costs awarded to HSE (GBP)"
                        },
                        "totalPenaltyGbp": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "title": "Fine + costs (GBP)"
                        },
                        "resultingFromFatality": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Resulting from a fatality",
                          "description": "true when the case page states it resulted from the investigation of a fatality."
                        },
                        "hasCustodialSentence": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Custodial sentence",
                          "description": "true when any breach result is a prison sentence (including suspended)."
                        },
                        "breachCount": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "title": "Number of breaches"
                        },
                        "legislationBreached": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "title": "Legislation breached",
                          "items": {
                            "type": "string"
                          }
                        },
                        "courtLevel": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Court level",
                          "example": "Magistrates Court"
                        },
                        "breaches": {
                          "type": "array",
                          "title": "Breaches",
                          "description": "Convictions: breachId, court, courtLevel, act, regulation, dateOfHearing(Iso), result, resultListing, resultCategory, isCustodial, fine, fineGbp, actName/actSection/actSubSection, regulationName/regulationNumber/regulationParagraph, legislation/provision/paragraph, source_url. Notices: breachId, actOrRegulation, legislation, provision, paragraph.",
                          "items": {
                            "type": "object"
                          }
                        },
                        "noticeType": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Notice type",
                          "example": "Immediate Prohibition Notice"
                        },
                        "noticeTypeListing": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Notice type (listing wording)"
                        },
                        "noticeCategory": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Notice category",
                          "enum": [
                            "Improvement",
                            "Prohibition",
                            null
                          ]
                        },
                        "isProhibition": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Is prohibition notice"
                        },
                        "isImprovement": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Is improvement notice"
                        },
                        "isImmediate": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Is immediate prohibition"
                        },
                        "isDeferred": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Is deferred prohibition"
                        },
                        "isCrown": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Crown notice"
                        },
                        "isComah": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "COMAH notice"
                        },
                        "isFepa": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "FEPA notice"
                        },
                        "servedDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Served on (raw)"
                        },
                        "servedDateIso": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Served on"
                        },
                        "complianceDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Compliance date (raw)",
                          "description": "From the notice page, or from the listing when an Improvement notice type is selected (8-column listing)."
                        },
                        "complianceDateIso": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Compliance date"
                        },
                        "revisedComplianceDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Revised compliance date (raw)"
                        },
                        "revisedComplianceDateIso": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Revised compliance date"
                        },
                        "effectiveComplianceDateIso": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Effective compliance date",
                          "description": "Revised date when one exists, else the original."
                        },
                        "daysToComply": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "title": "Days given to comply"
                        },
                        "daysUntilCompliance": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "title": "Days until compliance",
                          "description": "Negative once the effective compliance date has passed."
                        },
                        "hasRevisedComplianceDate": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Has revised compliance date"
                        },
                        "result": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Result",
                          "example": "Ongoing",
                          "description": "Ongoing / Complied with (Improvement Notices only). From the notice page, or from the listing when an Improvement notice type is selected."
                        },
                        "isOngoing": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Is ongoing"
                        },
                        "isCompliedWith": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Complied with"
                        },
                        "isOverdue": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Is overdue",
                          "description": "Ongoing and past its effective compliance date."
                        },
                        "descriptionItemIds": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "title": "Notice numbers in the description",
                          "description": "Per-item notice numbers embedded in multi-item descriptions.",
                          "items": {
                            "type": "string"
                          }
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Offence address"
                        },
                        "postcode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Postcode"
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Country"
                        },
                        "region": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "UK region"
                        },
                        "localAuthority": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Local authority"
                        },
                        "industry": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Industry"
                        },
                        "mainActivity": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Main activity (raw)",
                          "example": "43910 - ROOFING ACTIVITIES"
                        },
                        "sicCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "SIC code"
                        },
                        "sicDescription": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "SIC description"
                        },
                        "typeOfLocation": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Type of location"
                        },
                        "hseGroup": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "HSE group"
                        },
                        "hseDirectorate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "HSE directorate"
                        },
                        "hseArea": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "HSE area",
                          "description": "Always empty on the live register; kept for compatibility."
                        },
                        "hseDivision": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "HSE division"
                        },
                        "partyStatus": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Party status",
                          "example": "Private Company"
                        },
                        "partyEntityType": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Party entity type",
                          "enum": [
                            "company",
                            "individual",
                            "partnership",
                            "public_body",
                            "other",
                            null
                          ]
                        },
                        "partyAddress": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Party registered address"
                        },
                        "partyPostcode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Party postcode"
                        },
                        "partyHseReference": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Party HSE reference"
                        },
                        "partyUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Party page"
                        },
                        "partyConvictionCount": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "title": "Party convictions (all time on register)"
                        },
                        "partyNoticeCount": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "title": "Party notices (all time on register)"
                        },
                        "partyOtherCaseNumbers": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "title": "Party's other case numbers",
                          "items": {
                            "type": "string"
                          }
                        },
                        "partyOtherNoticeNumbers": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "title": "Party's other notice numbers",
                          "items": {
                            "type": "string"
                          }
                        },
                        "isRepeatOffender": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "title": "Repeat offender",
                          "description": "true when the party has more than one conviction or notice on the registers."
                        },
                        "detailFetched": {
                          "type": "boolean",
                          "title": "Detail fetched"
                        },
                        "detailError": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Detail error",
                          "description": "NOT_FOUND when the page was withdrawn between listing and detail."
                        },
                        "breachDetailFetched": {
                          "type": "boolean",
                          "title": "Breach detail fetched"
                        },
                        "partyDetailFetched": {
                          "type": "boolean",
                          "title": "Party detail fetched"
                        },
                        "partyDetailError": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Party detail error"
                        },
                        "contentHash": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Content hash",
                          "description": "The delta engine's change key for this record."
                        },
                        "firstSeenAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "First delivered on",
                          "description": "YYYY-MM-DD, from the delta memory."
                        }
                      }
                    },
                    "views": {
                      "overview": {
                        "title": "Overview",
                        "description": "Both registers side by side - who, what, when, where, how much.",
                        "transformation": {
                          "fields": [
                            "event_type",
                            "recordType",
                            "record_id",
                            "defendantName",
                            "recipientName",
                            "noticeType",
                            "offenceDateIso",
                            "servedDateIso",
                            "totalFineGbp",
                            "result",
                            "localAuthority",
                            "region",
                            "industry",
                            "partyStatus",
                            "source_url"
                          ]
                        },
                        "display": {
                          "component": "table",
                          "properties": {
                            "event_type": {
                              "label": "Event",
                              "format": "text"
                            },
                            "recordType": {
                              "label": "Register",
                              "format": "text"
                            },
                            "record_id": {
                              "label": "Number",
                              "format": "text"
                            },
                            "defendantName": {
                              "label": "Defendant",
                              "format": "text"
                            },
                            "recipientName": {
                              "label": "Recipient",
                              "format": "text"
                            },
                            "noticeType": {
                              "label": "Notice type",
                              "format": "text"
                            },
                            "offenceDateIso": {
                              "label": "Offence date",
                              "format": "date"
                            },
                            "servedDateIso": {
                              "label": "Served",
                              "format": "date"
                            },
                            "totalFineGbp": {
                              "label": "Fine (GBP)",
                              "format": "number"
                            },
                            "result": {
                              "label": "Result",
                              "format": "text"
                            },
                            "localAuthority": {
                              "label": "Local authority",
                              "format": "text"
                            },
                            "region": {
                              "label": "Region",
                              "format": "text"
                            },
                            "industry": {
                              "label": "Industry",
                              "format": "text"
                            },
                            "partyStatus": {
                              "label": "Status",
                              "format": "text"
                            },
                            "source_url": {
                              "label": "Record",
                              "format": "link"
                            }
                          }
                        }
                      },
                      "convictions": {
                        "title": "Convictions & fines",
                        "description": "Prosecutions: defendant, offence and hearing dates, fine, costs, fatality and custodial flags, legislation.",
                        "transformation": {
                          "filter": {
                            "recordType": "conviction"
                          },
                          "fields": [
                            "caseNumber",
                            "defendantName",
                            "partyStatus",
                            "offenceDateIso",
                            "hearingDateIso",
                            "totalFineGbp",
                            "totalCostsGbp",
                            "resultingFromFatality",
                            "hasCustodialSentence",
                            "breachCount",
                            "legislationBreached",
                            "courtLevel",
                            "localAuthority",
                            "sicDescription",
                            "source_url"
                          ]
                        },
                        "display": {
                          "component": "table",
                          "properties": {
                            "caseNumber": {
                              "label": "Case",
                              "format": "text"
                            },
                            "defendantName": {
                              "label": "Defendant",
                              "format": "text"
                            },
                            "partyStatus": {
                              "label": "Status",
                              "format": "text"
                            },
                            "offenceDateIso": {
                              "label": "Offence",
                              "format": "date"
                            },
                            "hearingDateIso": {
                              "label": "Hearing",
                              "format": "date"
                            },
                            "totalFineGbp": {
                              "label": "Fine (GBP)",
                              "format": "number"
                            },
                            "totalCostsGbp": {
                              "label": "Costs (GBP)",
                              "format": "number"
                            },
                            "resultingFromFatality": {
                              "label": "Fatality",
                              "format": "boolean"
                            },
                            "hasCustodialSentence": {
                              "label": "Custodial",
                              "format": "boolean"
                            },
                            "breachCount": {
                              "label": "Breaches",
                              "format": "number"
                            },
                            "legislationBreached": {
                              "label": "Legislation",
                              "format": "array"
                            },
                            "courtLevel": {
                              "label": "Court",
                              "format": "text"
                            },
                            "localAuthority": {
                              "label": "Local authority",
                              "format": "text"
                            },
                            "sicDescription": {
                              "label": "Activity",
                              "format": "text"
                            },
                            "source_url": {
                              "label": "Record",
                              "format": "link"
                            }
                          }
                        }
                      },
                      "notices": {
                        "title": "Enforcement notices",
                        "description": "Improvement and Prohibition notices: recipient, type, served and compliance dates, result, legislation.",
                        "transformation": {
                          "filter": {
                            "recordType": "notice"
                          },
                          "fields": [
                            "noticeNumber",
                            "recipientName",
                            "partyStatus",
                            "noticeType",
                            "servedDateIso",
                            "complianceDateIso",
                            "result",
                            "isImmediate",
                            "legislationBreached",
                            "localAuthority",
                            "sicDescription",
                            "region",
                            "source_url"
                          ]
                        },
                        "display": {
                          "component": "table",
                          "properties": {
                            "noticeNumber": {
                              "label": "Notice",
                              "format": "text"
                            },
                            "recipientName": {
                              "label": "Recipient",
                              "format": "text"
                            },
                            "partyStatus": {
                              "label": "Status",
                              "format": "text"
                            },
                            "noticeType": {
                              "label": "Type",
                              "format": "text"
                            },
                            "servedDateIso": {
                              "label": "Served",
                              "format": "date"
                            },
                            "complianceDateIso": {
                              "label": "Comply by",
                              "format": "date"
                            },
                            "result": {
                              "label": "Result",
                              "format": "text"
                            },
                            "isImmediate": {
                              "label": "Immediate",
                              "format": "boolean"
                            },
                            "legislationBreached": {
                              "label": "Legislation",
                              "format": "array"
                            },
                            "localAuthority": {
                              "label": "Local authority",
                              "format": "text"
                            },
                            "sicDescription": {
                              "label": "Activity",
                              "format": "text"
                            },
                            "region": {
                              "label": "Region",
                              "format": "text"
                            },
                            "source_url": {
                              "label": "Record",
                              "format": "link"
                            }
                          }
                        }
                      },
                      "compliance": {
                        "title": "Compliance tracker",
                        "description": "Open notices and their deadlines - what is ongoing, overdue, revised or complied with.",
                        "transformation": {
                          "filter": {
                            "recordType": "notice"
                          },
                          "fields": [
                            "event_type",
                            "noticeNumber",
                            "recipientName",
                            "noticeCategory",
                            "servedDateIso",
                            "effectiveComplianceDateIso",
                            "daysUntilCompliance",
                            "isOngoing",
                            "isOverdue",
                            "isCompliedWith",
                            "hasRevisedComplianceDate",
                            "firstSeenAt",
                            "source_url"
                          ]
                        },
                        "display": {
                          "component": "table",
                          "properties": {
                            "event_type": {
                              "label": "Event",
                              "format": "text"
                            },
                            "noticeNumber": {
                              "label": "Notice",
                              "format": "text"
                            },
                            "recipientName": {
                              "label": "Recipient",
                              "format": "text"
                            },
                            "noticeCategory": {
                              "label": "Category",
                              "format": "text"
                            },
                            "servedDateIso": {
                              "label": "Served",
                              "format": "date"
                            },
                            "effectiveComplianceDateIso": {
                              "label": "Comply by",
                              "format": "date"
                            },
                            "daysUntilCompliance": {
                              "label": "Days left",
                              "format": "number"
                            },
                            "isOngoing": {
                              "label": "Ongoing",
                              "format": "boolean"
                            },
                            "isOverdue": {
                              "label": "Overdue",
                              "format": "boolean"
                            },
                            "isCompliedWith": {
                              "label": "Complied",
                              "format": "boolean"
                            },
                            "hasRevisedComplianceDate": {
                              "label": "Revised",
                              "format": "boolean"
                            },
                            "firstSeenAt": {
                              "label": "First seen",
                              "format": "date"
                            },
                            "source_url": {
                              "label": "Record",
                              "format": "link"
                            }
                          }
                        }
                      },
                      "parties": {
                        "title": "Defendants & recipients",
                        "description": "Who was sanctioned: legal status, registered address, HSE reference and repeat-offender counts across both registers.",
                        "transformation": {
                          "fields": [
                            "recordType",
                            "record_id",
                            "defendantName",
                            "recipientName",
                            "partyStatus",
                            "partyEntityType",
                            "partyAddress",
                            "partyPostcode",
                            "partyHseReference",
                            "partyConvictionCount",
                            "partyNoticeCount",
                            "isRepeatOffender",
                            "partyUrl"
                          ]
                        },
                        "display": {
                          "component": "table",
                          "properties": {
                            "recordType": {
                              "label": "Register",
                              "format": "text"
                            },
                            "record_id": {
                              "label": "Number",
                              "format": "text"
                            },
                            "defendantName": {
                              "label": "Defendant",
                              "format": "text"
                            },
                            "recipientName": {
                              "label": "Recipient",
                              "format": "text"
                            },
                            "partyStatus": {
                              "label": "Status",
                              "format": "text"
                            },
                            "partyEntityType": {
                              "label": "Entity type",
                              "format": "text"
                            },
                            "partyAddress": {
                              "label": "Registered address",
                              "format": "text"
                            },
                            "partyPostcode": {
                              "label": "Postcode",
                              "format": "text"
                            },
                            "partyHseReference": {
                              "label": "HSE ref",
                              "format": "text"
                            },
                            "partyConvictionCount": {
                              "label": "Convictions",
                              "format": "number"
                            },
                            "partyNoticeCount": {
                              "label": "Notices",
                              "format": "number"
                            },
                            "isRepeatOffender": {
                              "label": "Repeat",
                              "format": "boolean"
                            },
                            "partyUrl": {
                              "label": "Party page",
                              "format": "link"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-openai-isConsequential": false
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApifyBearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "ApifyBearerAuth": []
    }
  ]
}