{
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "in": "header",
        "name": "api-key",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "Legal-entity intelligence API covering 35M+ companies, directors, ownership graphs, sanctions, sector benchmarks, and Markdown dossiers.",
    "title": "Folio API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/company/{country_code}/{id}.md": {
      "get": {
        "operationId": "getCompanyMarkdown",
        "parameters": [
          {
            "in": "path",
            "name": "country_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Markdown company dossier"
          },
          "404": {
            "description": "Company not found in local cache"
          }
        },
        "summary": "Fetch a compact Markdown company dossier (zero-auth, cache-only)"
      }
    },
    "/public/sources": {
      "get": {
        "operationId": "getPublicSources",
        "responses": {
          "200": {
            "description": "Source health and coverage"
          }
        },
        "summary": "List public data sources and freshness metadata"
      }
    },
    "/v1/benchmarks": {
      "get": {
        "operationId": "getSectorBenchmarks",
        "parameters": [
          {
            "in": "query",
            "name": "country_code",
            "schema": {
              "default": "FR",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "activity_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "year",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "revenue_band",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Financial benchmark cohorts"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Fetch sector financial benchmarks by activity code"
      }
    },
    "/v1/entity": {
      "get": {
        "operationId": "getEntity",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "default": "company",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated record types",
            "in": "query",
            "name": "records",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max records returned per record type",
            "in": "query",
            "name": "records_limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "max_age",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Canonical entity payload"
          },
          "404": {
            "description": "Entity not found"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Fetch a canonical entity with optional records",
        "x-openai-isConsequential": false
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "listEvents",
        "parameters": [
          {
            "description": "Comma-separated CC:ID pairs",
            "in": "query",
            "name": "entities",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "severity",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "since_date",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event stream"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "List corporate events and alerts"
      }
    },
    "/v1/graph": {
      "get": {
        "operationId": "getEntityGraph",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "default": "company",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "depth",
            "schema": {
              "default": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "edge_types",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 30,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Nodes and edges for the entity graph"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Fetch entity relationship graph"
      }
    },
    "/v1/records": {
      "get": {
        "operationId": "listRecords",
        "parameters": [
          {
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "schema": {
              "default": 25,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated records"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Query typed records such as sanctions listings or notices"
      }
    },
    "/v1/search": {
      "get": {
        "operationId": "searchEntities",
        "parameters": [
          {
            "description": "Search query",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "default": "company",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code",
            "schema": {
              "default": "FR",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "activity_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "postal_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "turnover_min",
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "turnover_max",
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "schema": {
              "default": 20,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Paginated search results"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Search companies, persons, or properties",
        "x-openai-isConsequential": false
      }
    },
    "/v1/vocabulary": {
      "get": {
        "operationId": "getVocabulary",
        "responses": {
          "200": {
            "description": "Canonical schema vocabulary"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "List supported countries, entity kinds, and record types"
      }
    }
  },
  "servers": [
    {
      "description": "Production",
      "url": "https://folio.ordalie.com"
    }
  ]
}
