{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "Datapublica Business Register API",
    "version": "1.0.0",
    "description": "Paid-plan access to Danish business-register search, entity, timeline, ownership, and read-only query data.",
    "termsOfService": "https://datapublica.dk/terms",
    "contact": {
      "url": "https://datapublica.dk/support"
    },
    "license": {
      "name": "Datapublica Terms of Service",
      "url": "https://datapublica.dk/terms"
    }
  },
  "externalDocs": {
    "description": "Datapublica API documentation",
    "url": "https://datapublica.dk/docs"
  },
  "servers": [
    {
      "url": "https://query.datapublica.dk",
      "description": "Canonical production API"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Companies",
      "description": "Company search, detail, timeline, and ownership portfolio."
    },
    {
      "name": "People",
      "description": "Person search, detail, timeline, and ownership portfolio."
    },
    {
      "name": "Other participants",
      "description": "Registry actors not resolved as a company or person."
    },
    {
      "name": "Ownership",
      "description": "Incremental ownership graph expansion."
    },
    {
      "name": "SQL",
      "description": "Read-only SQL execution and natural-language translation."
    }
  ],
  "paths": {
    "/api/companies/search": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "searchCompanies",
        "summary": "Search companies",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search text after trimming.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Zero-based result offset.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/companies/{identifier}": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompany",
        "summary": "Get a company bundle",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded company identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "financial_scope",
            "in": "query",
            "required": false,
            "description": "Optionally return only separate-company or consolidated-group rows in the additive scoped financial series.",
            "schema": {
              "type": "string",
              "enum": [
                "entity",
                "consolidated_group"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyBundleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access or usage decision denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Company not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset or usage-decision service unavailable.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/companies/{identifier}/financial-report-sections": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompanyFinancialReportSections",
        "summary": "Get annual-report text sections",
        "description": "Returns curated XBRL text blocks for thirteen canonical section keys in the business_and_development, risks_and_material_matters, and commitments_and_security groups; this is not the complete annual report. Boilerplate is suppressed and duplicate content across scopes is deduplicated, so absence does not prove the filer wrote nothing. contentPlain is capped at 20,000 characters per section; isTruncated marks an excerpt and excerpts cannot be paginated. Section language is usually da, and financialScope can be report_wide. sourceReportUrl can be null. Token-authenticated availableReports entries always have locked=false. Calls use company_lookup quota under companies.detail.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded company identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "filing_id",
            "in": "query",
            "required": false,
            "description": "Annual filing identifier. Defaults to the latest filing for the resolved financial scope.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "financial_scope",
            "in": "query",
            "required": false,
            "description": "Statement scope. Defaults to the company bundle's financialScopes.default value.",
            "schema": {
              "type": "string",
              "enum": [
                "entity",
                "consolidated_group"
              ]
            }
          },
          {
            "name": "reporting_period_start",
            "in": "query",
            "required": false,
            "description": "Optional ISO date used to disambiguate filings that share a filing_id.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "reporting_period_end",
            "in": "query",
            "required": false,
            "description": "Optional ISO date used to disambiguate filings that share a filing_id.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "x-company-lookup-request-id",
            "in": "header",
            "required": false,
            "description": "Optional request id from a successful company lookup for the same CVR. Compatible reuse avoids a second company lookup charge.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Curated sections for the selected annual filing. PDF-only filings return an empty sections array; callers must supply financial_scope when the company has no scoped numeric annual filing from which to derive a default.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialReportSectionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access or usage decision denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Financial report not aligned to the company and financial scope.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset or usage-decision service unavailable.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/companies/{identifier}/timeline": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompanyTimeline",
        "summary": "Get a company timeline",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded company identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum timeline events to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the previous response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimelineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Company not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/companies/{identifier}/portfolio": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompanyPortfolio",
        "summary": "Get a company ownership portfolio",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded company identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Company not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/people/search": {
      "get": {
        "tags": [
          "People"
        ],
        "operationId": "searchPeople",
        "summary": "Search people",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search text after trimming.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Zero-based result offset.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/people/{identifier}": {
      "get": {
        "tags": [
          "People"
        ],
        "operationId": "getPerson",
        "summary": "Get a person bundle",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded person identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonBundleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Person not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/people/{identifier}/timeline": {
      "get": {
        "tags": [
          "People"
        ],
        "operationId": "getPersonTimeline",
        "summary": "Get a person timeline",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded person identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum timeline events to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the previous response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimelineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Person not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/people/{identifier}/portfolio": {
      "get": {
        "tags": [
          "People"
        ],
        "operationId": "getPersonPortfolio",
        "summary": "Get a person ownership portfolio",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded person identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Person not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participants/search": {
      "get": {
        "tags": [
          "Other participants"
        ],
        "operationId": "searchParticipants",
        "summary": "Search other participants",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search text after trimming.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Zero-based result offset.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participants/{identifier}": {
      "get": {
        "tags": [
          "Other participants"
        ],
        "operationId": "getParticipant",
        "summary": "Get another participant's bundle",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded participant identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParticipantBundleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Participant not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participants/{identifier}/timeline": {
      "get": {
        "tags": [
          "Other participants"
        ],
        "operationId": "getParticipantTimeline",
        "summary": "Get another participant's timeline",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded participant identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum timeline events to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the previous response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimelineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Participant not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participants/{identifier}/portfolio": {
      "get": {
        "tags": [
          "Other participants"
        ],
        "operationId": "getParticipantPortfolio",
        "summary": "Get another participant's ownership portfolio",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "URL-encoded participant identifier.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Participant not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/entities/{entityType}/{id}/relations": {
      "get": {
        "tags": [
          "Ownership"
        ],
        "operationId": "getPortfolioEntityRelations",
        "summary": "Expand relations around a portfolio node",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "entityType",
            "in": "path",
            "required": true,
            "description": "Entity type.",
            "schema": {
              "type": "string",
              "enum": [
                "company",
                "person",
                "participant"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "URL-encoded entity identifier without a type prefix.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Expansion direction.",
            "schema": {
              "type": "string",
              "enum": [
                "up",
                "down",
                "both"
              ],
              "default": "both"
            }
          },
          {
            "name": "visibleNodeIds",
            "in": "query",
            "required": false,
            "description": "Comma-separated graph node IDs already visible.",
            "schema": {
              "type": "string",
              "maxLength": 20000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioExpansionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity not found.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset loaded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/sql": {
      "get": {
        "tags": [
          "SQL"
        ],
        "operationId": "executeSql",
        "summary": "Execute one read-only SQL statement",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Read-only SQL. Supply query or sql.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20000
            }
          },
          {
            "name": "sql",
            "in": "query",
            "required": false,
            "description": "Alias for query.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20000
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Query source. Use natural-language only when executing a translated query with the translation request's x-request-id; otherwise use direct.",
            "schema": {
              "type": "string",
              "enum": [
                "direct",
                "natural-language"
              ],
              "default": "direct"
            }
          },
          {
            "name": "rawInput",
            "in": "query",
            "required": false,
            "description": "Exact original question; required when source is natural-language and correlated with the translation request's x-request-id.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SqlQueryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access or usage decision denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset or usage-decision service unavailable.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/sql/translate": {
      "post": {
        "tags": [
          "SQL"
        ],
        "operationId": "translateSql",
        "summary": "Translate a natural-language question to read-only SQL",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-request-id",
            "in": "header",
            "required": false,
            "description": "Optional caller-generated request identifier. The server reflects a valid value or generates one. Reuse the same value when executing SQL returned by natural-language translation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,127}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslationSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked bearer token.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Account access or usage decision denied the request.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "The question needs clarification or requests unsupported behavior.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslationIssueResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No active dataset or usage-decision service unavailable.",
            "headers": {
              "x-request-id": {
                "description": "Request identifier for diagnostics.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Bucket": {
                "description": "Usage bucket, when applicable.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Usage-Limit": {
                "description": "Current limit, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Remaining": {
                "description": "Remaining units, when numeric.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Usage-Reset": {
                "description": "Usage reset timestamp, when applicable.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/UsageErrorResponse"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Personal API token created in Datapublica App settings for a paid-plan account."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UsageErrorResponse": {
        "type": "object",
        "required": [
          "error",
          "code"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "planKey": {
            "type": "string"
          },
          "quotaBucket": {
            "type": [
              "string",
              "null"
            ]
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used": {
            "type": "integer",
            "minimum": 0
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "windowStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "windowEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "resetAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "SearchResponse": {
        "type": "object",
        "required": [
          "query",
          "total",
          "limit",
          "offset",
          "rows"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "CompanyRelations": {
        "type": "object",
        "required": [
          "legalOwners",
          "previousLegalOwners",
          "beneficialOwners",
          "previousBeneficialOwners",
          "childCompanies",
          "previousChildCompanies",
          "relatedCompanies"
        ],
        "properties": {
          "legalOwners": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "previousLegalOwners": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "beneficialOwners": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "previousBeneficialOwners": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "childCompanies": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "previousChildCompanies": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "relatedCompanies": {
            "type": "array",
            "description": "Additional current company connections: siblings, owners of direct owners, and children of direct children. Current direct company owners and current direct child companies are excluded.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "ScopedFinancialRow": {
        "type": "object",
        "required": [
          "statement_scope",
          "reporting_currency"
        ],
        "properties": {
          "statement_scope": {
            "type": "string",
            "enum": [
              "entity",
              "consolidated_group",
              "unknown"
            ]
          },
          "reporting_currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject_cvr_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "reporting_entity_cvr_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "report_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_document_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxonomy_family": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope_classification_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope_evidence": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope_target": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "AnnualReportPeriodRow": {
        "type": "object",
        "required": [
          "cvr_number",
          "filing_id",
          "reporting_period_start",
          "reporting_period_end",
          "financial_data_status"
        ],
        "properties": {
          "cvr_number": {
            "type": "string"
          },
          "filing_id": {
            "type": "string"
          },
          "fiscal_year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reporting_period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "reporting_period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "publication_timestamp": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pdf_source_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "has_pdf_source": {
            "type": "boolean"
          },
          "has_machine_readable_source": {
            "type": "boolean"
          },
          "has_numeric_financials": {
            "type": "boolean"
          },
          "reported_document_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "observed_document_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "observed_annual_document_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source_failure_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "no_numeric_facts_for_reporting_period",
              "no_supported_numeric_facts",
              "unsupported_annual_document",
              "source_unavailable",
              null
            ]
          },
          "financial_data_status": {
            "type": "string",
            "enum": [
              "numeric",
              "pdf_only",
              "machine_readable_unmaterialized",
              "source_not_materialized",
              "source_unprocessable",
              "unclassified"
            ]
          }
        },
        "additionalProperties": false
      },
      "ScopedGrowthRow": {
        "type": "object",
        "required": [
          "statement_scope",
          "reporting_currency"
        ],
        "properties": {
          "statement_scope": {
            "type": "string",
            "enum": [
              "entity",
              "consolidated_group",
              "unknown"
            ]
          },
          "reporting_currency": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "CompanyFieldHistoryValue": {
        "type": "object",
        "required": [
          "value",
          "validFrom",
          "validTo"
        ],
        "properties": {
          "value": {
            "type": "string",
            "description": "Source value. Compound keys registered_capital, accounting_year and first_accounting_period encode a JSON object with left/right components (amount/currency or start/end); cvr_employees encodes count, interval, periodStart, periodEnd and source."
          },
          "validFrom": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "validTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        },
        "additionalProperties": false
      },
      "CompanyBundleResponse": {
        "type": "object",
        "required": [
          "cvr",
          "build_id",
          "profile",
          "latestStatus",
          "financialsAnnual",
          "financialsAnnualScoped",
          "annualReportPeriods",
          "financialScopes",
          "growth",
          "growthScoped",
          "ownership",
          "companyRelations",
          "contacts",
          "people",
          "auditors",
          "coverage",
          "financialDistressScore"
        ],
        "properties": {
          "cvr": {
            "type": "string"
          },
          "build_id": {
            "type": "string"
          },
          "profile": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "latestStatus": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "financialsAnnual": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "financialsAnnualScoped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScopedFinancialRow"
            }
          },
          "annualReportPeriods": {
            "type": "array",
            "description": "Canonical annual-report periods, including PDF-only filings that have no materialized numeric facts.",
            "items": {
              "$ref": "#/components/schemas/AnnualReportPeriodRow"
            }
          },
          "financialScopes": {
            "type": "object",
            "required": [
              "available",
              "default",
              "hasUnknown"
            ],
            "properties": {
              "available": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "entity",
                    "consolidated_group"
                  ]
                },
                "uniqueItems": true
              },
              "default": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "entity",
                  "consolidated_group",
                  null
                ]
              },
              "hasUnknown": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "growth": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "growthScoped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScopedGrowthRow"
            }
          },
          "ownership": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "companyRelations": {
            "$ref": "#/components/schemas/CompanyRelations"
          },
          "fieldHistory": {
            "type": "object",
            "description": "Changed company fields with source validity periods, newest first. Empty for free access; null dates preserve unknown validity.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/CompanyFieldHistoryValue"
              }
            }
          },
          "founders": {
            "type": "array",
            "description": "Founders from company role history, including ended roles. Available for free access.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "people": {
            "type": "array",
            "description": "Current company management and roles.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "auditors": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "coverage": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "financialDistressScore": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "financialDistressScoreAvailability": {
            "type": "object",
            "required": [
              "status",
              "reason",
              "legal_form_code",
              "legal_form_label",
              "scoring_as_of_date"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "unavailable"
                ]
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "legal_form_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "legal_form_label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scoring_as_of_date": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              }
            },
            "additionalProperties": false
          },
          "financialDistressAdminExplanation": {
            "type": "object",
            "description": "Pro-class and admin model evidence. Omitted for other users.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "FinancialReportSectionsResponse": {
        "type": "object",
        "required": [
          "cvr",
          "filingId",
          "reportExternalId",
          "reportingPeriodStart",
          "reportingPeriodEnd",
          "fiscalYear",
          "financialScope",
          "sourceReportUrl",
          "sections",
          "availableReports"
        ],
        "properties": {
          "cvr": {
            "type": "string"
          },
          "filingId": {
            "type": "string"
          },
          "reportExternalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reportingPeriodStart": {
            "type": [
              "string",
              "null"
            ]
          },
          "reportingPeriodEnd": {
            "type": [
              "string",
              "null"
            ]
          },
          "fiscalYear": {
            "type": [
              "integer",
              "null"
            ]
          },
          "financialScope": {
            "type": "string",
            "enum": [
              "entity",
              "consolidated_group"
            ]
          },
          "sourceReportUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FinancialReportSection"
            }
          },
          "availableReports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FinancialReportSectionAvailableReport"
            }
          }
        },
        "additionalProperties": false
      },
      "FinancialReportSection": {
        "type": "object",
        "required": [
          "sectionId",
          "canonicalSectionKey",
          "sectionGroup",
          "displayOrder",
          "financialScope",
          "contentPlain",
          "blocks",
          "language",
          "isTruncated"
        ],
        "properties": {
          "sectionId": {
            "type": "string"
          },
          "canonicalSectionKey": {
            "type": "string"
          },
          "sectionGroup": {
            "type": "string",
            "enum": [
              "business_and_development",
              "risks_and_material_matters",
              "commitments_and_security"
            ]
          },
          "displayOrder": {
            "type": "integer"
          },
          "financialScope": {
            "type": "string",
            "enum": [
              "entity",
              "consolidated_group",
              "unknown",
              "report_wide"
            ]
          },
          "contentPlain": {
            "type": "string",
            "maxLength": 20000,
            "description": "Plain-text excerpt capped at 20,000 characters. There is no pagination."
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FinancialReportTextBlock"
            }
          },
          "language": {
            "type": "string"
          },
          "isTruncated": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "FinancialReportTextBlock": {
        "type": "object",
        "required": [
          "kind",
          "content"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "paragraph",
              "list_item",
              "subheading"
            ]
          },
          "content": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "FinancialReportSectionAvailableReport": {
        "type": "object",
        "required": [
          "filingId",
          "reportExternalId",
          "reportingPeriodStart",
          "reportingPeriodEnd",
          "fiscalYear",
          "sourceReportUrl",
          "hasSections",
          "locked"
        ],
        "properties": {
          "filingId": {
            "type": "string"
          },
          "reportExternalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reportingPeriodStart": {
            "type": [
              "string",
              "null"
            ]
          },
          "reportingPeriodEnd": {
            "type": [
              "string",
              "null"
            ]
          },
          "fiscalYear": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sourceReportUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "hasSections": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean",
            "description": "UI compatibility field; always false for token-authenticated calls."
          }
        },
        "additionalProperties": false
      },
      "PersonBundleResponse": {
        "type": "object",
        "required": [
          "person_id",
          "build_id",
          "profile",
          "currentRoles",
          "roleHistory",
          "ownership",
          "auditorHistory",
          "contacts",
          "relatedCompanies"
        ],
        "properties": {
          "person_id": {
            "type": "string"
          },
          "build_id": {
            "type": "string"
          },
          "profile": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "currentRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "roleHistory": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "ownership": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "auditorHistory": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "relatedCompanies": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "ParticipantBundleResponse": {
        "type": "object",
        "required": [
          "participant_id",
          "build_id",
          "profile",
          "currentRoles",
          "roleHistory",
          "ownership",
          "relatedCompanies"
        ],
        "properties": {
          "participant_id": {
            "type": "string"
          },
          "build_id": {
            "type": "string"
          },
          "profile": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "currentRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "roleHistory": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "ownership": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "relatedCompanies": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "TimelineResponse": {
        "type": "object",
        "required": [
          "events",
          "next_cursor"
        ],
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "truncated_by_plan": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PortfolioNode": {
        "type": "object",
        "required": [
          "nodeId",
          "entityType",
          "displayName",
          "slug",
          "companyCvrNumber",
          "personId",
          "participantId",
          "displayHint",
          "countryCode",
          "primaryLabel",
          "secondaryLabel",
          "expandUpCount",
          "expandDownCount",
          "isRoot",
          "isExpandedUp",
          "isExpandedDown"
        ],
        "properties": {
          "nodeId": {
            "type": "string"
          },
          "entityType": {
            "type": "string",
            "enum": [
              "company",
              "person",
              "participant"
            ]
          },
          "displayName": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "companyCvrNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "personId": {
            "type": [
              "string",
              "null"
            ]
          },
          "participantId": {
            "type": [
              "string",
              "null"
            ]
          },
          "displayHint": {
            "type": [
              "string",
              "null"
            ]
          },
          "countryCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "primaryLabel": {
            "type": [
              "string",
              "null"
            ]
          },
          "secondaryLabel": {
            "type": [
              "string",
              "null"
            ]
          },
          "expandUpCount": {
            "type": "integer",
            "minimum": 0
          },
          "expandDownCount": {
            "type": "integer",
            "minimum": 0
          },
          "isRoot": {
            "type": "boolean"
          },
          "isExpandedUp": {
            "type": "boolean"
          },
          "isExpandedDown": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PortfolioEdge": {
        "type": "object",
        "required": [
          "edgeId",
          "sourceNodeId",
          "targetNodeId",
          "ownershipLabel",
          "ownershipPrecisionKind",
          "ownershipLowerPercent",
          "ownershipUpperPercent",
          "relationshipKind"
        ],
        "properties": {
          "edgeId": {
            "type": "string"
          },
          "sourceNodeId": {
            "type": "string"
          },
          "targetNodeId": {
            "type": "string"
          },
          "ownershipLabel": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownershipPrecisionKind": {
            "type": "string",
            "enum": [
              "exact",
              "interval",
              "unknown"
            ]
          },
          "ownershipLowerPercent": {
            "type": [
              "number",
              "null"
            ]
          },
          "ownershipUpperPercent": {
            "type": [
              "number",
              "null"
            ]
          },
          "relationshipKind": {
            "type": "string",
            "enum": [
              "legal_owner"
            ]
          }
        },
        "additionalProperties": false
      },
      "PortfolioResponse": {
        "type": "object",
        "required": [
          "root",
          "build_id",
          "truncated",
          "nodes",
          "edges"
        ],
        "properties": {
          "root": {
            "type": "string"
          },
          "build_id": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioNode"
            }
          },
          "edges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioEdge"
            }
          }
        },
        "additionalProperties": false
      },
      "PortfolioExpansionResponse": {
        "type": "object",
        "required": [
          "targetNodeId",
          "truncated",
          "nodes",
          "edges",
          "updatedNode"
        ],
        "properties": {
          "targetNodeId": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioNode"
            }
          },
          "edges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioEdge"
            }
          },
          "updatedNode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PortfolioNode"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "SqlQueryResponse": {
        "type": "object",
        "required": [
          "query",
          "columns",
          "rowCount",
          "rows"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rowCount": {
            "type": "integer",
            "minimum": 0
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "TranslationRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "locale": {
            "type": "string",
            "enum": [
              "da",
              "en"
            ],
            "default": "en"
          },
          "maxRows": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 100
          },
          "priorTurns": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "required": [
                "question"
              ],
              "properties": {
                "question": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "sql": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20000
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "TranslationMetadata": {
        "type": "object",
        "required": [
          "provider",
          "model",
          "buildId",
          "schemaVersion",
          "referencedTables",
          "interpretedFilters"
        ],
        "properties": {
          "provider": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "buildId": {
            "type": "string"
          },
          "schemaVersion": {
            "type": "string"
          },
          "referencedTables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "interpretedFilters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "limit": {
            "type": "object",
            "required": [
              "kind",
              "rowCount"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "semantic",
                  "default_preview"
                ]
              },
              "rowCount": {
                "type": "integer",
                "minimum": 1
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "TranslationSuccessResponse": {
        "type": "object",
        "required": [
          "status",
          "sql",
          "exportSql",
          "resolvedQuestion",
          "description",
          "notes",
          "assumptions",
          "warnings",
          "metadata"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "ok"
          },
          "sql": {
            "type": "string"
          },
          "exportSql": {
            "type": "string"
          },
          "resolvedQuestion": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/TranslationMetadata"
          }
        },
        "additionalProperties": false
      },
      "TranslationIssueResponse": {
        "type": "object",
        "required": [
          "status",
          "sql",
          "resolvedQuestion",
          "description",
          "notes",
          "assumptions",
          "warnings",
          "metadata",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "unsupported",
              "needs_clarification"
            ]
          },
          "sql": {
            "type": "null"
          },
          "resolvedQuestion": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/TranslationMetadata"
          },
          "error": {
            "type": "object",
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      }
    }
  }
}
