{
  "openapi": "3.0.0",
  "info": {
    "description": "iAML REST API zapewnia dostęp do usług AML i Compliance: weryfikacji osób i podmiotów względem baz PEP i RCA, ponad 75 list sankcyjnych oraz list ostrzegawczych, danych z rejestrów publicznych, a także oceny ryzyka — poprzez jedno spójne API.",
    "version": "1.0",
    "title": "iAML REST API",
    "contact": {
      "email": "pomoc@iaml.com.pl"
    }
  },
  "tags": [
    {
      "name": "Rejestry publiczne",
      "description": "Dostęp do danych z rejestrów publicznych: Centralny Rejestr Beneficjentów Rzeczywistych (CRBR) oraz Biała Lista Podatników VAT."
    },
    {
      "name": "Bazy Compliance i AML",
      "description": "Autorskie bazy compliance: PEP, RCA, ponad 75 list sankcyjnych, Lista Ostrzeżeń KNF oraz EURO-BOZON."
    },
    {
      "name": "Źródła ryzyka i listy specjalistyczne",
      "description": "Kraje i branże podwyższonego ryzyka oraz rejestry specjalistyczne: rejestr walut wirtualnych, rejestr domen hazardowych, rejestr MiCA."
    },
    {
      "name": "Usługi iAML",
      "description": "Usługi platformy iAML: Record Check oraz Risk Engine."
    }
  ],
  "paths": {
    "/real_beneficiary": {
      "get": {
        "tags": [
          "Rejestry publiczne"
        ],
        "summary": "znajdź beneficjentów rzeczywistych spółki (CRBR)",
        "description": "Zwraca beneficjentów rzeczywistych spółki zarejestrowanej w CRBR na podstawie numeru NIP, REGON lub KRS.",
        "operationId": "findBeneficiary",
        "parameters": [
          {
            "in": "query",
            "name": "number",
            "description": "NIP/REGON/KRS",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Beneficiary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable – rejestr źródłowy (CRBR lub GUS) jest chwilowo niedostępny; zapytanie nie zostało naliczone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailable"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/company_beneficiary": {
      "get": {
        "tags": [
          "Rejestry publiczne"
        ],
        "summary": "znajdź spółki beneficjenta rzeczywistego (CRBR)",
        "description": "Zwraca spółki, w których osoba o podanym numerze PESEL figuruje w CRBR jako beneficjent rzeczywisty.",
        "operationId": "findCompanyBeneficiary",
        "parameters": [
          {
            "in": "query",
            "name": "number",
            "description": "PESEL",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyBeneficiary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable – rejestr źródłowy (CRBR lub GUS) jest chwilowo niedostępny; zapytanie nie zostało naliczone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailable"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/company_beneficiary2": {
      "get": {
        "tags": [
          "Rejestry publiczne"
        ],
        "summary": "znajdź spółki beneficjenta rzeczywistego (CRBR)",
        "description": "Zwraca spółki, w których osoba o podanym imieniu, nazwisku i dacie urodzenia figuruje w CRBR jako beneficjent rzeczywisty.",
        "operationId": "findCompanyBeneficiary2",
        "parameters": [
          {
            "in": "query",
            "name": "first_name",
            "description": "Imię",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "surname",
            "description": "Nazwisko",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "birthday",
            "description": "Dzień urodzenia",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyBeneficiary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable – rejestr źródłowy (CRBR lub GUS) jest chwilowo niedostępny; zapytanie nie zostało naliczone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailable"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/vat_white_list": {
      "get": {
        "tags": [
          "Rejestry publiczne"
        ],
        "summary": "sprawdź Białą Listę Podatników VAT",
        "description": "Sprawdza na Białej Liście Podatników VAT, czy podany rachunek bankowy (nrb) jest przypisany do podatnika (nip) w danym dniu. Zwraca TAK lub NIE w polu result.accountAssigned.",
        "operationId": "checkWhiteVatList",
        "parameters": [
          {
            "in": "query",
            "name": "nip",
            "description": "NIP",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "nrb",
            "description": "Numer Rachunku Bankowego",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatWhiteList"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/peps": {
      "get": {
        "tags": [
          "Bazy Compliance i AML"
        ],
        "summary": "znajdź osobę w bazie PEP",
        "description": "Wyszukuje osoby w bazie PEP po imieniu i nazwisku, opcjonalnie zawężając wyniki po dacie urodzenia lub numerze PESEL (PESEL służy wyłącznie do wyznaczenia daty urodzenia). Wywołany bez parametrów przekierowuje do pełnego eksportu bazy PEP.",
        "operationId": "findPep",
        "parameters": [
          {
            "in": "query",
            "name": "name",
            "description": "Imię i Nazwisko PEPa",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "birth_date",
            "description": "Data urodzenia",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pesel",
            "description": "PESEL",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fuzziness",
            "description": "Włącza dopasowanie rozmyte (tolerujące literówki i różnice w zapisie) obok wyszukiwania ścisłego. Wartość to minimalny wynik dopasowania w procentach.\n\n**Wartości**\n- Liczba całkowita od `50` do `100`. Niższa wartość zwraca więcej, ale słabszych dopasowań.\n- Parametr pominięty lub pusty (`fuzziness=`): wykonywane jest tylko wyszukiwanie ścisłe. Odpowiedź ma taki sam format jak bez tego parametru: rekordy nie zawierają klucza `match`.\n- Wartość spoza zakresu lub niebędąca liczbą całkowitą (np. `49`, `101`, `70.5`, `abc`): `412 Precondition Failed`, opis błędu w `errors`. Wyszukiwanie nie jest wykonywane.\n\n**Dostęp**\n- Wymaga usługi `api_fuzzy_search` na licencji organizacji. Usługa działa dla każdego klucza API organizacji i nie przypisuje się jej do klucza.\n- Bez usługi każda niepusta wartość zwraca `403 Forbidden`. Licencja jest sprawdzana przed poprawnością wartości.\n- Nie zużywa dodatkowego limitu: żądanie jest liczone jak zwykłe zapytanie do `/v1/peps`.\n\n**Odpowiedź**\n\nKażdy rekord w tablicy `peps` ma klucz `match`, który opisuje, jak go znaleziono:\n- `strict`: `true`, jeśli rekord zwróciło wyszukiwanie ścisłe, w przeciwnym razie `false`.\n- `similarity`: podobieństwo z dopasowania rozmytego w procentach, liczba całkowita od podanej wartości `fuzziness` do `100`. `null`, jeśli dopasowanie rozmyte nie zwróciło rekordu.\n\nRekord znaleziony przez oba wyszukiwania występuje w odpowiedzi raz, z `strict: true` i swoim `similarity`.\n\nNajpierw są wyniki wyszukiwania ścisłego, potem rekordy znalezione tylko dopasowaniem rozmytym, posortowane malejąco po `similarity`, a przy równym wyniku po nazwie. Dopasowanie rozmyte zwraca najwyżej 100 rekordów. Liczba wyników ścisłych nie jest ograniczona.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 50,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "peps"
                  ],
                  "properties": {
                    "peps": {
                      "type": "array",
                      "description": "Znalezione osoby PEP.",
                      "items": {
                        "$ref": "#/components/schemas/Person"
                      }
                    }
                  }
                },
                "examples": {
                  "response": {
                    "summary": "Bez `fuzziness`",
                    "value": {
                      "peps": [
                        {
                          "id": 104233,
                          "type": "individual",
                          "name": "JAN KOWALSKI",
                          "names": {
                            "first": "JAN",
                            "middle": null,
                            "third": null,
                            "father": null,
                            "last": "KOWALSKI",
                            "full": "JAN KOWALSKI"
                          },
                          "aliases": [
                            "JAN KOWALSKI"
                          ],
                          "gender": "m",
                          "title": null,
                          "remarks": null,
                          "nationalities": [
                            {
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "birth_places": [
                            {
                              "place": "Warszawa",
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "birth_dates": [
                            {
                              "date": "1965-03-12",
                              "year": 1965,
                              "month": 3,
                              "day": 12
                            }
                          ],
                          "addresses": [
                            {
                              "address": null,
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "passports": [],
                          "identifiers": [
                            {
                              "type": "pseudoPESEL",
                              "number": "65031200012",
                              "country_name": "",
                              "country_code": "",
                              "info": ""
                            }
                          ],
                          "sources": [
                            {
                              "organization": "Ministerstwo Obrony Narodowej",
                              "function": "Sekretarz stanu",
                              "reason": "Członek rządu",
                              "since": "2023-12-13",
                              "to": null,
                              "clause_url": "Źródło: BIP Ministerstwa Obrony Narodowej"
                            }
                          ],
                          "decease_on": null,
                          "created_on": "2024-05-10",
                          "reviewed_on": "2026-09-30",
                          "updated_on": "2026-09-30",
                          "deleted_at": null,
                          "deactivated_on": null
                        }
                      ]
                    }
                  },
                  "fuzziness": {
                    "summary": "Z `fuzziness=70`",
                    "value": {
                      "peps": [
                        {
                          "id": 104233,
                          "type": "individual",
                          "name": "JAN KOWALSKI",
                          "names": {
                            "first": "JAN",
                            "middle": null,
                            "third": null,
                            "father": null,
                            "last": "KOWALSKI",
                            "full": "JAN KOWALSKI"
                          },
                          "aliases": [
                            "JAN KOWALSKI"
                          ],
                          "gender": "m",
                          "title": null,
                          "remarks": null,
                          "nationalities": [],
                          "birth_places": [],
                          "birth_dates": [
                            {
                              "date": "1965-03-12",
                              "year": 1965,
                              "month": 3,
                              "day": 12
                            }
                          ],
                          "addresses": [],
                          "passports": [],
                          "identifiers": [
                            {
                              "type": "pseudoPESEL",
                              "number": "65031200012",
                              "country_name": "",
                              "country_code": "",
                              "info": ""
                            }
                          ],
                          "sources": [
                            {
                              "organization": "Ministerstwo Obrony Narodowej",
                              "function": "Sekretarz stanu",
                              "reason": "Członek rządu",
                              "since": "2023-12-13",
                              "to": null,
                              "clause_url": "Źródło: BIP Ministerstwa Obrony Narodowej"
                            }
                          ],
                          "decease_on": null,
                          "created_on": "2024-05-10",
                          "reviewed_on": "2026-09-30",
                          "updated_on": "2026-09-30",
                          "deleted_at": null,
                          "deactivated_on": null,
                          "match": {
                            "strict": true,
                            "similarity": 100
                          }
                        },
                        {
                          "id": 98712,
                          "type": "individual",
                          "name": "JAN KOWALSKY",
                          "names": {
                            "first": "JAN",
                            "middle": "PIOTR",
                            "third": null,
                            "father": null,
                            "last": "KOWALSKY",
                            "full": "JAN KOWALSKY"
                          },
                          "aliases": [
                            "JAN KOWALSKY",
                            "JAN PIOTR KOWALSKY"
                          ],
                          "gender": "m",
                          "title": null,
                          "remarks": null,
                          "nationalities": [
                            {
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "birth_places": [
                            {
                              "place": "Gdańsk",
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "birth_dates": [],
                          "addresses": [
                            {
                              "address": "ul. Długa 5, Gdańsk",
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "passports": [],
                          "identifiers": [],
                          "sources": [
                            {
                              "organization": "Rada Miasta Gdańska",
                              "function": "Radny",
                              "reason": "Członek organu samorządu",
                              "since": "2018-11-21",
                              "to": "2024-05-06",
                              "clause_url": "Źródło: BIP Miasta Gdańska"
                            }
                          ],
                          "decease_on": null,
                          "created_on": "2024-05-10",
                          "reviewed_on": "2026-09-30",
                          "updated_on": "2026-09-30",
                          "deleted_at": null,
                          "deactivated_on": "2025-05-06",
                          "match": {
                            "strict": false,
                            "similarity": 82
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/rcas": {
      "get": {
        "tags": [
          "Bazy Compliance i AML"
        ],
        "summary": "znajdź osobę w bazie RCA",
        "description": "Wyszukuje osoby w bazie RCA po imieniu i nazwisku, opcjonalnie zawężając wyniki po dacie urodzenia lub numerze PESEL (PESEL służy wyłącznie do wyznaczenia daty urodzenia). Wywołany bez parametrów przekierowuje do pełnego eksportu bazy RCA.",
        "operationId": "findRca",
        "parameters": [
          {
            "in": "query",
            "name": "name",
            "description": "Imię i nazwisko RCA",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "birth_date",
            "description": "Data urodzenia",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pesel",
            "description": "PESEL",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fuzziness",
            "description": "Włącza dopasowanie rozmyte (tolerujące literówki i różnice w zapisie) obok wyszukiwania ścisłego. Wartość to minimalny wynik dopasowania w procentach.\n\n**Wartości**\n- Liczba całkowita od `50` do `100`. Niższa wartość zwraca więcej, ale słabszych dopasowań.\n- Parametr pominięty lub pusty (`fuzziness=`): wykonywane jest tylko wyszukiwanie ścisłe. Odpowiedź ma taki sam format jak bez tego parametru: rekordy nie zawierają klucza `match`.\n- Wartość spoza zakresu lub niebędąca liczbą całkowitą (np. `49`, `101`, `70.5`, `abc`): `412 Precondition Failed`, opis błędu w `errors`. Wyszukiwanie nie jest wykonywane.\n\n**Dostęp**\n- Wymaga usługi `api_fuzzy_search` na licencji organizacji. Usługa działa dla każdego klucza API organizacji i nie przypisuje się jej do klucza.\n- Bez usługi każda niepusta wartość zwraca `403 Forbidden`. Licencja jest sprawdzana przed poprawnością wartości.\n- Nie zużywa dodatkowego limitu: żądanie jest liczone jak zwykłe zapytanie do `/v1/rcas`.\n\n**Odpowiedź**\n\nKażdy rekord w tablicy `rcas` ma klucz `match`, który opisuje, jak go znaleziono:\n- `strict`: `true`, jeśli rekord zwróciło wyszukiwanie ścisłe, w przeciwnym razie `false`.\n- `similarity`: podobieństwo z dopasowania rozmytego w procentach, liczba całkowita od podanej wartości `fuzziness` do `100`. `null`, jeśli dopasowanie rozmyte nie zwróciło rekordu.\n\nRekord znaleziony przez oba wyszukiwania występuje w odpowiedzi raz, z `strict: true` i swoim `similarity`.\n\nNajpierw są wyniki wyszukiwania ścisłego, potem rekordy znalezione tylko dopasowaniem rozmytym, posortowane malejąco po `similarity`, a przy równym wyniku po nazwie. Dopasowanie rozmyte zwraca najwyżej 100 rekordów. Liczba wyników ścisłych nie jest ograniczona.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 50,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rcas"
                  ],
                  "properties": {
                    "rcas": {
                      "type": "array",
                      "description": "Znalezione osoby RCA.",
                      "items": {
                        "$ref": "#/components/schemas/Rca"
                      }
                    }
                  }
                },
                "examples": {
                  "response": {
                    "summary": "Bez `fuzziness`",
                    "value": {
                      "rcas": [
                        {
                          "id": 55120,
                          "type": "individual",
                          "name": "ANNA NOWAK",
                          "names": {
                            "first": "ANNA",
                            "middle": null,
                            "third": null,
                            "father": null,
                            "last": "NOWAK",
                            "full": "ANNA NOWAK"
                          },
                          "aliases": [
                            "ANNA NOWAK"
                          ],
                          "gender": "f",
                          "title": null,
                          "remarks": null,
                          "nationalities": [
                            {
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "birth_places": [],
                          "birth_dates": [
                            {
                              "date": "1972-08-04",
                              "year": 1972,
                              "month": 8,
                              "day": 4
                            }
                          ],
                          "addresses": [
                            {
                              "address": null,
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "passports": [],
                          "identifiers": [
                            {
                              "type": "pseudoPESEL",
                              "number": "72080400003",
                              "country_name": "",
                              "country_code": "",
                              "info": ""
                            }
                          ],
                          "sources": [
                            {
                              "pep": "JAN KOWALSKI",
                              "company": "ACME SP. Z O.O.",
                              "type": "associate",
                              "ex": false,
                              "since": "2019-06-01",
                              "to": null,
                              "clause": "Źródło: Krajowy Rejestr Sądowy"
                            }
                          ],
                          "decease_on": null,
                          "created_on": "2024-06-21",
                          "reviewed_on": "2026-09-30",
                          "updated_on": "2026-09-30",
                          "deleted_at": null,
                          "deactivated_on": null
                        }
                      ]
                    }
                  },
                  "fuzziness": {
                    "summary": "Z `fuzziness=70`",
                    "value": {
                      "rcas": [
                        {
                          "id": 55120,
                          "type": "individual",
                          "name": "ANNA NOWAK",
                          "names": {
                            "first": "ANNA",
                            "middle": null,
                            "third": null,
                            "father": null,
                            "last": "NOWAK",
                            "full": "ANNA NOWAK"
                          },
                          "aliases": [
                            "ANNA NOWAK"
                          ],
                          "gender": "f",
                          "title": null,
                          "remarks": null,
                          "nationalities": [
                            {
                              "country_name": "Poland",
                              "country_code": "PL"
                            }
                          ],
                          "birth_places": [],
                          "birth_dates": [],
                          "addresses": [],
                          "passports": [],
                          "identifiers": [],
                          "sources": [
                            {
                              "pep": "JAN KOWALSKI",
                              "company": "ACME SP. Z O.O.",
                              "type": "associate",
                              "ex": false,
                              "since": "2019-06-01",
                              "to": null,
                              "clause": "Źródło: Krajowy Rejestr Sądowy"
                            }
                          ],
                          "decease_on": null,
                          "created_on": "2024-05-10",
                          "reviewed_on": "2026-09-30",
                          "updated_on": "2026-09-30",
                          "deleted_at": null,
                          "deactivated_on": null,
                          "match": {
                            "strict": true,
                            "similarity": 100
                          }
                        },
                        {
                          "id": 61877,
                          "type": "individual",
                          "name": "ANNA NOWACK",
                          "names": {
                            "first": "ANNA",
                            "middle": null,
                            "third": null,
                            "father": null,
                            "last": "NOWACK",
                            "full": "ANNA NOWACK"
                          },
                          "aliases": [
                            "ANNA NOWACK"
                          ],
                          "gender": "f",
                          "title": null,
                          "remarks": null,
                          "nationalities": [],
                          "birth_places": [],
                          "birth_dates": [
                            {
                              "date": "1972-08-04",
                              "year": 1972,
                              "month": 8,
                              "day": 4
                            }
                          ],
                          "addresses": [],
                          "passports": [],
                          "identifiers": [
                            {
                              "type": "pseudoPESEL",
                              "number": "72080400003",
                              "country_name": "",
                              "country_code": "",
                              "info": ""
                            }
                          ],
                          "sources": [
                            {
                              "pep": "JAN KOWALSKY",
                              "company": "",
                              "type": "associate",
                              "ex": true,
                              "since": "2010-01-01",
                              "to": "2022-12-31",
                              "clause": "Źródło: Krajowy Rejestr Sądowy"
                            }
                          ],
                          "decease_on": null,
                          "created_on": "2024-05-10",
                          "reviewed_on": "2026-09-30",
                          "updated_on": "2026-09-30",
                          "deleted_at": null,
                          "deactivated_on": null,
                          "match": {
                            "strict": false,
                            "similarity": 76
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/sanctions": {
      "get": {
        "tags": [
          "Bazy Compliance i AML"
        ],
        "summary": "znajdź osobę lub podmiot na listach sankcyjnych",
        "description": "Wyszukuje osoby i podmioty po nazwie na listach sankcyjnych włączonych dla organizacji. Wywołany bez parametru name przekierowuje do pełnego eksportu sankcji.",
        "operationId": "findSanction",
        "parameters": [
          {
            "in": "query",
            "name": "name",
            "description": "Nazwa osoby lub podmiotu",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fuzziness",
            "description": "Włącza dopasowanie rozmyte (tolerujące literówki i różnice w zapisie) obok wyszukiwania ścisłego. Wartość to minimalny wynik dopasowania w procentach.\n\n**Wartości**\n- Liczba całkowita od `50` do `100`. Niższa wartość zwraca więcej, ale słabszych dopasowań.\n- Parametr pominięty lub pusty (`fuzziness=`): wykonywane jest tylko wyszukiwanie ścisłe. Odpowiedź ma taki sam format jak bez tego parametru: rekordy nie zawierają klucza `match`.\n- Wartość spoza zakresu lub niebędąca liczbą całkowitą (np. `49`, `101`, `70.5`, `abc`): `412 Precondition Failed`, opis błędu w `errors`. Wyszukiwanie nie jest wykonywane.\n\n**Dostęp**\n- Wymaga usługi `api_fuzzy_search` na licencji organizacji. Usługa działa dla każdego klucza API organizacji i nie przypisuje się jej do klucza.\n- Bez usługi każda niepusta wartość zwraca `403 Forbidden`. Licencja jest sprawdzana przed poprawnością wartości.\n- Nie zużywa dodatkowego limitu: żądanie jest liczone jak zwykłe zapytanie do `/v1/sanctions`.\n\n**Odpowiedź**\n\nKażdy rekord w tablicy `sanctions` ma klucz `match`, który opisuje, jak go znaleziono:\n- `strict`: `true`, jeśli rekord zwróciło wyszukiwanie ścisłe, w przeciwnym razie `false`.\n- `similarity`: podobieństwo z dopasowania rozmytego w procentach, liczba całkowita od podanej wartości `fuzziness` do `100`. `null`, jeśli dopasowanie rozmyte nie zwróciło rekordu.\n\nRekord znaleziony przez oba wyszukiwania występuje w odpowiedzi raz, z `strict: true` i swoim `similarity`.\n\nNajpierw są wyniki wyszukiwania ścisłego, potem rekordy znalezione tylko dopasowaniem rozmytym, posortowane malejąco po `similarity`, a przy równym wyniku po `id`. Dopasowanie rozmyte zwraca najwyżej 100 rekordów. Liczba wyników ścisłych nie jest ograniczona.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 50,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "sanctions"
                  ],
                  "properties": {
                    "sanctions": {
                      "type": "array",
                      "description": "Znalezione rekordy z list sankcyjnych.",
                      "items": {
                        "$ref": "#/components/schemas/Sanction"
                      }
                    }
                  }
                },
                "examples": {
                  "response": {
                    "summary": "Bez `fuzziness`",
                    "value": {
                      "sanctions": [
                        {
                          "id": "a1b2c3d4e5f60718",
                          "name": "IVAN PETROV",
                          "type": "individual",
                          "names": {
                            "full": "IVAN PETROV",
                            "last": "PETROV",
                            "first": "IVAN",
                            "third": "",
                            "father": "",
                            "middle": ""
                          },
                          "title": "",
                          "gender": null,
                          "aliases": [
                            "IWAN PIETROW",
                            "Ivan Petrov"
                          ],
                          "remarks": null,
                          "sources": [
                            {
                              "reason": "UKR",
                              "function": "Członek kierownictwa przedsiębiorstwa sektora obronnego.",
                              "organization": "Rada Unii Europejskiej"
                            }
                          ],
                          "addresses": [],
                          "passports": [
                            {
                              "info": "",
                              "type": "passport",
                              "number": "7512345678",
                              "country_code": "RU",
                              "country_name": ""
                            }
                          ],
                          "created_on": "2025-01-15T10:22:31.000+01:00",
                          "deleted_at": null,
                          "updated_on": "2026-09-30T08:05:12.000+02:00",
                          "birth_dates": [
                            {
                              "day": 21,
                              "date": "1970-05-21",
                              "year": 1970,
                              "month": 5
                            }
                          ],
                          "identifiers": [],
                          "reviewed_on": "2026-09-30T08:05:12.000+02:00",
                          "birth_places": [
                            {
                              "country_name": null,
                              "country_code": null,
                              "place": "Moskwa"
                            }
                          ],
                          "nationalities": [],
                          "deactivated_on": null
                        }
                      ]
                    }
                  },
                  "fuzziness": {
                    "summary": "Z `fuzziness=70`",
                    "value": {
                      "sanctions": [
                        {
                          "id": "a1b2c3d4e5f60718",
                          "name": "IVAN PETROV",
                          "type": "individual",
                          "names": {
                            "full": "IVAN PETROV",
                            "last": "PETROV",
                            "first": "IVAN",
                            "third": "",
                            "father": "",
                            "middle": ""
                          },
                          "title": "",
                          "gender": null,
                          "aliases": [],
                          "remarks": null,
                          "sources": [
                            {
                              "reason": "UKR",
                              "function": "Członek kierownictwa przedsiębiorstwa sektora obronnego.",
                              "organization": "Rada Unii Europejskiej"
                            }
                          ],
                          "addresses": [],
                          "passports": [
                            {
                              "info": "",
                              "type": "passport",
                              "number": "7512345678",
                              "country_code": "RU",
                              "country_name": ""
                            }
                          ],
                          "created_on": "2025-01-15T10:22:31.000+01:00",
                          "deleted_at": null,
                          "updated_on": "2026-09-30T08:05:12.000+02:00",
                          "birth_dates": [],
                          "identifiers": [],
                          "reviewed_on": "2026-09-30T08:05:12.000+02:00",
                          "birth_places": [],
                          "nationalities": [],
                          "deactivated_on": null,
                          "match": {
                            "strict": true,
                            "similarity": 100
                          }
                        },
                        {
                          "id": "f9e8d7c6b5a40312",
                          "name": "IWAN PETROW",
                          "type": "individual",
                          "names": {
                            "full": "IWAN PETROW",
                            "last": "PETROW",
                            "first": "IWAN",
                            "third": "",
                            "father": "",
                            "middle": ""
                          },
                          "title": "",
                          "gender": null,
                          "aliases": [
                            "IVAN PETROFF"
                          ],
                          "remarks": null,
                          "sources": [
                            {
                              "reason": "BLR",
                              "function": "Funkcjonariusz aparatu państwowego.",
                              "organization": "Rada Unii Europejskiej"
                            }
                          ],
                          "addresses": [],
                          "passports": [],
                          "created_on": "2025-01-15T10:22:31.000+01:00",
                          "deleted_at": null,
                          "updated_on": "2026-09-30T08:05:12.000+02:00",
                          "birth_dates": [
                            {
                              "day": 2,
                              "date": "1968-11-02",
                              "year": 1968,
                              "month": 11
                            }
                          ],
                          "identifiers": [],
                          "reviewed_on": "2026-09-30T08:05:12.000+02:00",
                          "birth_places": [
                            {
                              "country_name": null,
                              "country_code": null,
                              "place": "Mińsk"
                            }
                          ],
                          "nationalities": [],
                          "deactivated_on": null,
                          "match": {
                            "strict": false,
                            "similarity": 71
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/sanction_lists": {
      "get": {
        "tags": [
          "Bazy Compliance i AML"
        ],
        "summary": "lista dostępnych list sankcyjnych",
        "description": "Zwraca listy sankcyjne dostępne w grupie organizacji wywołującego, każdą z flagą enabled wskazującą, czy jest włączona w ustawieniach organizacji (i tym samym przeszukiwana przez POST /scan). Wartości source odpowiadają kodom zwracanym w meta.sanction_sources odpowiedzi POST /scan. Endpoint jest tylko do odczytu i nie zużywa limitu zapytań.",
        "operationId": "getSanctionLists",
        "parameters": [
          {
            "in": "header",
            "name": "Accept-Language",
            "description": "Język tłumaczeń pola name (pl, en). Domyślnie pl.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listy sankcyjne dostępne dla organizacji",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SanctionListItem"
                  }
                },
                "examples": {
                  "response": {
                    "value": [
                      {
                        "source": "eu_fsf",
                        "name": "Skonsolidowana lista sankcji finansowych Unii Europejskiej (UE)",
                        "enabled": true
                      },
                      {
                        "source": "un_sc_sanctions",
                        "name": "Skonsolidowana lista sankcji Rady Bezpieczeństwa ONZ (ONZ)",
                        "enabled": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/knfs": {
      "get": {
        "tags": [
          "Bazy Compliance i AML"
        ],
        "summary": "znajdź ostrzeżenie na Liście Ostrzeżeń KNF",
        "description": "Wyszukuje ostrzeżenia na Liście Ostrzeżeń Publicznych KNF po nazwie osoby lub podmiotu. Wywołany bez parametru name zwraca wszystkie ostrzeżenia.",
        "operationId": "findKnf",
        "parameters": [
          {
            "in": "query",
            "name": "name",
            "description": "Nazwa osoby lub podmiotu",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnfWarrning"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/eurobozon": {
      "get": {
        "tags": [
          "Bazy Compliance i AML"
        ],
        "summary": "znajdź ostrzeżenie w bazie EURO-BOZON",
        "description": "Wyszukuje podmioty po nazwie w bazie EURO-BOZON (ostrzeżenia zagranicznych organów nadzoru) i zwraca dopasowane rekordy w tablicy records.",
        "operationId": "findEurobozon",
        "parameters": [
          {
            "in": "query",
            "name": "name",
            "description": "Nazwa podmiotu",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eurobozon"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/countries": {
      "get": {
        "tags": [
          "Źródła ryzyka i listy specjalistyczne"
        ],
        "summary": "lista krajów podwyższonego ryzyka",
        "description": "Zwraca pełną listę krajów oznaczonych przynajmniej jedną kategorią ryzyka AML (FATF, ryzyko podatkowe, Komisja Europejska, korupcja, Basel AML Index, sponsorowanie terroryzmu itp.).",
        "operationId": "listCountries",
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "countries"
                  ],
                  "properties": {
                    "countries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Country"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/pkds": {
      "get": {
        "tags": [
          "Źródła ryzyka i listy specjalistyczne"
        ],
        "summary": "lista branż (kodów PKD) podwyższonego ryzyka",
        "description": "Zwraca pełną listę kodów PKD oznaczonych jako podwyższone ryzyko AML.",
        "operationId": "listPkds",
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "pkds"
                  ],
                  "properties": {
                    "pkds": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Pkd"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/crypto_service_registry": {
      "get": {
        "tags": [
          "Źródła ryzyka i listy specjalistyczne"
        ],
        "summary": "znajdź podmiot w rejestrze walut wirtualnych",
        "description": "Wyszukuje podmioty w Rejestrze działalności w zakresie walut wirtualnych po numerze wpisu, nazwie, numerze NIP lub KRS i zwraca dopasowane rekordy w tablicy records.",
        "operationId": "findCryptoServiceRegistry",
        "parameters": [
          {
            "in": "query",
            "name": "registry_number",
            "description": "Numer wpisu w rejestrze",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "description": "Nazwa podmiotu (wyszukiwanie częściowe)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "nip",
            "description": "NIP podmiotu",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "krs",
            "description": "KRS podmiotu",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CryptoServiceRegistry"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/hazard_domains": {
      "get": {
        "tags": [
          "Źródła ryzyka i listy specjalistyczne"
        ],
        "summary": "znajdź domenę w rejestrze domen hazardowych",
        "description": "Wyszukuje domeny w Rejestrze Domen Służących do Oferowania Gier Hazardowych po nazwie domeny i zwraca dopasowane rekordy w tablicy records.",
        "operationId": "findHazardDomain",
        "parameters": [
          {
            "in": "query",
            "name": "domain",
            "description": "Nazwa domeny",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HazardDomain"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/mica": {
      "get": {
        "tags": [
          "Źródła ryzyka i listy specjalistyczne"
        ],
        "summary": "przeszukaj rejestr MiCA",
        "description": "Przeszukuje Rejestr tymczasowy MiCA tym samym mechanizmem wyszukiwania pełnotekstowego, którego używa skaner. Parametr q jest wymagany. Wyniki są pogrupowane wg rejestru (emtwp, artzz, casps, other, ncasp) — zestaw pól poszczególnych rekordów zależy od rejestru, do którego należą. Endpoint zużywa limit zapytań.",
        "operationId": "getMica",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "description": "Szukana fraza (np. nazwa podmiotu).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Accept-Language",
            "description": "Język tłumaczeń pola name (pl, en). Domyślnie pl.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rekordy Rejestru MiCA pogrupowane wg rejestru",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicaResponse"
                },
                "examples": {
                  "response": {
                    "value": {
                      "meta": {
                        "count": 1,
                        "term": "acme"
                      },
                      "records": {
                        "emtwp": [],
                        "artzz": [],
                        "casps": [
                          {
                            "register": "casps",
                            "ac_entityLegalName": "Acme sp. z o.o.",
                            "ac_serviceCode": [
                              "custody"
                            ]
                          }
                        ],
                        "other": [],
                        "ncasp": []
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicaBadRequest"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Parametr zapytania 'q' jest wymagany.",
                      "errors": [
                        "q is required"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation or limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/scan": {
      "post": {
        "tags": [
          "Usługi iAML"
        ],
        "summary": "Record Check – skanuj osobę lub podmiot",
        "description": "Skanuje jedną spółkę albo jedną osobę względem wszystkich obsługiwanych list i rejestrów — wyłącznie na podstawie danych podanych w żądaniu (usługa nie wyszukuje danych w rejestrach zewnętrznych; w szczególności nie pobiera beneficjentów rzeczywistych). Endpoint przyjmuje dwa opcjonalne klucze — companies, people:\n\n- companies → spółka do przeskanowania jako tablica jednoelementowa.\n- people → osoba do przeskanowania jako tablica jednoelementowa.\n\nPodaj dokładnie jeden z nich — albo companies, albo people, ale nie oba naraz; każdy przyjmuje maksymalnie jedną pozycję. Pominięcie obu, podanie obu lub przesłanie więcej niż jednej pozycji zwraca 400. Odpowiedź ma zawsze kształt ScanResponse z tablicami companies[]/persons[]/company_scans[]/person_scans[]/relationships[]. Tablica relationships[] jest obecnie zawsze pusta i zostanie wypełniona w przyszłości na podstawie danych KRS.",
        "operationId": "scan",
        "parameters": [
          {
            "in": "header",
            "name": "Accept-Language",
            "description": "Język tłumaczeń pola message (pl, en). Domyślnie pl.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/scan/{scan_id}/pdf": {
      "post": {
        "tags": [
          "Usługi iAML"
        ],
        "summary": "Record Check – wydrukuj raport PDF ze skanowania",
        "description": "Generuje raport PDF dla skanowania zidentyfikowanego przez scan_id (meta.scan_id odpowiedzi POST /scan) i zwraca sam plik PDF. Żądanie zawiera meta.scan_secret tego skanowania: wyniki skanowania są przechowywane zaszyfrowane tym sekretem, a iAML nie przechowuje jego kopii, więc bez niego nikt (także iAML) nie może ich odczytać. Przechowuj sekret razem ze scan_id tak długo, jak raport może być potrzebny. Wyniki są przechowywane przez 30 minut od skanowania; później raportu nie da się już wydrukować i skanowanie trzeba wykonać ponownie. Każde wywołanie generuje raport od nowa; żaden PDF nie jest przechowywany. Jest to ten sam raport, który drukuje Skaner iAML dla skanowania wykonanego w aplikacji. Język raportu jest dziedziczony z wywołania POST /scan (zgodnie z nagłówkiem Accept-Language użytym przy skanowaniu) — tutaj nie da się go zmienić. Semantyka kodów:\n\n- 200: plik PDF.\n- 404: brak skanowania o tym scan_id i scan_secret — scan_id jest nieznany, sekret do niego nie pasuje albo wyniki skanowania już wygasły.",
        "operationId": "printScanPdf",
        "parameters": [
          {
            "in": "path",
            "name": "scan_id",
            "description": "Identyfikator skanowania zwrócony w meta.scan_id z odpowiedzi POST /scan.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanPdfRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "scan_secret": "q3W8vZ1x0kNfR2s9cD4hT6yB7mJ5pL1aE0uG3iK8oQw"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Raport PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Brak lub nieprawidłowy klucz API."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Twój klucz API nie ma dostępu do tego skanowania."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Brak skanowania o tym scan_id i scan_secret albo jego wyniki wygasły",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFound"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Nie znaleziono skanowania o podanym scan_id i scan_secret albo jego wyniki już wygasły."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/complex": {
      "post": {
        "tags": [
          "Usługi iAML"
        ],
        "summary": "Record Check – kompleksowe przeszukanie baz",
        "description": "Sprawdza przesłany podmiot (osobę lub firmę) jednocześnie względem baz PEP, RCA, list sankcyjnych oraz Listy Ostrzeżeń KNF i zwraca wyniki dla poszczególnych list w obiekcie entity.",
        "operationId": "complex",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplexRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplexResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/risk": {
      "get": {
        "tags": [
          "Usługi iAML"
        ],
        "summary": "Risk Engine – oceń poziom ryzyka",
        "description": "Ocenia poziom ryzyka dla osoby lub firmy: trafienie na listach sankcyjnych zwraca poziom 3 (nieakceptowalne), na Liście Ostrzeżeń KNF poziom 2 (wysokie), w bazach PEP lub RCA poziom 1 (duże), a brak trafień poziom 0 (niskie). Wynik zwracany jest w obiekcie risk.",
        "operationId": "assessRisk",
        "parameters": [
          {
            "in": "query",
            "name": "name",
            "description": "Nazwa osoby lub firmy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Risk"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreconditionFailed"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/risk2": {
      "get": {
        "tags": [
          "Usługi iAML"
        ],
        "summary": "Risk Engine – oceń poziom ryzyka biznesowego",
        "description": "Wylicza ważony wskaźnik ryzyka biznesowego na podstawie kodu kraju, formy prawnej, kodu PKD oraz kategorii produktów i zwraca go w polu sc.",
        "operationId": "assessRisk2",
        "parameters": [
          {
            "in": "query",
            "name": "cc",
            "description": "dwuznakowy kod kraju",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ec",
            "description": "dwuznakowy kod formy prawnej",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pc",
            "description": "kod pkd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pc_version",
            "description": "wersja klasyfikacji PKD dla parametru pc: 2007 albo 2025 (domyślnie 2007)",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2007",
                "2025"
              ],
              "default": "2007"
            }
          },
          {
            "in": "query",
            "name": "rp",
            "description": "kategoria produktu",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Risk2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Forbidden"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.aml.pl/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "X-Api-Key",
        "in": "header"
      }
    },
    "schemas": {
      "BadRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "PreconditionFailed": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Unauthorized": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "Forbidden": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "ComplexRequest": {
        "type": "object",
        "properties": {
          "entity": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "origin_country": {
                "type": "string"
              },
              "operation_country": {
                "type": "string"
              },
              "pkds": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "string",
                      "description": "Kod PKD (np. \"62.01.Z\" lub \"6201Z\")."
                    },
                    {
                      "type": "object",
                      "description": "Kod PKD z podaną wersją klasyfikacji.",
                      "required": [
                        "number"
                      ],
                      "properties": {
                        "number": {
                          "type": "string",
                          "description": "Kod PKD (np. \"62.01.Z\" lub \"6201Z\")."
                        },
                        "version": {
                          "type": "string",
                          "enum": [
                            "2007",
                            "2025"
                          ],
                          "default": "2007",
                          "description": "Wersja klasyfikacji PKD: \"2007\" albo \"2025\". Pomijalna — bez niej kod traktowany jest jako PKD 2007."
                        }
                      }
                    }
                  ]
                },
                "description": "Kody PKD podmiotu. Element może być stringiem (kod PKD 2007, jak dotychczas) albo obiektem z polami number i version."
              },
              "id_number": {
                "type": "string"
              }
            }
          }
        }
      },
      "ComplexResponse": {
        "type": "object",
        "properties": {
          "entity": {
            "type": "object",
            "properties": {
              "sanctions": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              },
              "pep": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              },
              "geo": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              },
              "pkd": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              },
              "knf": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              },
              "rca": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "VatWhiteList": {
        "type": "object",
        "properties": {
          "accountAssigned": {
            "type": "string"
          }
        }
      },
      "Risk": {
        "type": "object",
        "properties": {
          "risk": {
            "type": "object",
            "properties": {
              "pl": {
                "type": "string"
              },
              "lvl": {
                "type": "integer",
                "format": "int64"
              }
            }
          }
        }
      },
      "Risk2": {
        "type": "object",
        "properties": {
          "sc": {
            "type": "string"
          }
        }
      },
      "Beneficiary": {
        "type": "object",
        "properties": {
          "beneficiaries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "first_name": {
                  "type": "string"
                },
                "middle_names": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "last_name": {
                  "type": "string"
                },
                "pesel": {
                  "type": "string"
                },
                "birthday": {
                  "type": "string"
                },
                "citizenship": {
                  "type": "string"
                },
                "shares": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string"
                      },
                      "info": {
                        "type": "string"
                      },
                      "unit": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "representatives": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "pesel": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "CompanyBeneficiary": {
        "type": "object",
        "properties": {
          "companies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "nip": {
                  "type": "string"
                },
                "krs": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "KnfWarrning": {
        "type": "object",
        "properties": {
          "info": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "judgment": {
            "type": "string"
          },
          "prosecutor": {
            "type": "string"
          },
          "notification_type": {
            "type": "string"
          }
        }
      },
      "HazardDomain": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "registry_number": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Numer wpisu w rejestrze"
                },
                "domain": {
                  "type": "string",
                  "description": "Nazwa domeny"
                },
                "registered_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data wpisu do rejestru"
                }
              }
            }
          }
        }
      },
      "Eurobozon": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator wpisu"
          },
          "company": {
            "type": "string",
            "description": "Nazwa podmiotu"
          },
          "otherCompanyNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Inne nazwy podmiotu"
          },
          "country": {
            "type": "string",
            "description": "Kraj"
          },
          "warningTitle": {
            "type": "string",
            "description": "Tytuł ostrzeżenia"
          },
          "regulatorName": {
            "type": "string",
            "description": "Nazwa regulatora"
          },
          "announcementDate": {
            "type": "string",
            "format": "date",
            "description": "Data ogłoszenia"
          }
        }
      },
      "CryptoServiceRegistry": {
        "type": "object",
        "properties": {
          "registry_number": {
            "type": "string",
            "description": "Numer wpisu w rejestrze"
          },
          "name": {
            "type": "string",
            "description": "Nazwa podmiotu"
          },
          "krs": {
            "type": "string",
            "description": "Numer KRS. W odpowiedzi /scan zwracany w kanonicznej 10-cyfrowej postaci z zerami wiodącymi (np. \"0000968535\"); GET /crypto_service_registry usuwa zera wiodące (np. \"968535\")."
          },
          "nip": {
            "type": "string",
            "description": "Numer NIP"
          },
          "registration_date": {
            "type": "string",
            "format": "date",
            "description": "Data wpisu do rejestru"
          },
          "services": {
            "type": "string",
            "description": "Zakres świadczonych usług"
          }
        }
      },
      "Rca": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "names": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string"
              },
              "last": {
                "type": "string"
              },
              "middle": {
                "type": "string"
              },
              "full": {
                "type": "string"
              },
              "third": {
                "type": "string"
              },
              "father": {
                "type": "string"
              }
            }
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gender": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "remarks": {
            "type": "string"
          },
          "nationalities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "birth_places": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "place": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "birth_dates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "integer"
                },
                "date": {
                  "type": "string"
                },
                "year": {
                  "type": "integer"
                },
                "month": {
                  "type": "integer"
                }
              }
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "passports": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "info": {
                  "type": "string"
                },
                "number": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "identifiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "info": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "number": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pep": {
                  "type": "string"
                },
                "company": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "ex": {
                  "type": "boolean"
                },
                "since": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "clause": {
                  "type": "string"
                }
              }
            }
          },
          "decease_on": {
            "type": "string"
          },
          "created_on": {
            "type": "string"
          },
          "reviewed_on": {
            "type": "string"
          },
          "updated_on": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          },
          "deactivated_on": {
            "type": "string"
          },
          "match": {
            "type": "object",
            "description": "Jak wyszukiwanie znalazło rekord. Występuje tylko po wysłaniu `fuzziness`.",
            "properties": {
              "strict": {
                "type": "boolean",
                "description": "Czy rekord zwróciło wyszukiwanie ścisłe."
              },
              "similarity": {
                "type": "integer",
                "minimum": 50,
                "maximum": 100,
                "nullable": true,
                "description": "Podobieństwo z dopasowania rozmytego w procentach, od wysłanej wartości `fuzziness` do `100`. `null`, jeśli dopasowanie rozmyte nie zwróciło rekordu."
              }
            }
          }
        }
      },
      "Person": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "names": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string"
              },
              "last": {
                "type": "string"
              },
              "middle": {
                "type": "string"
              },
              "full": {
                "type": "string"
              },
              "third": {
                "type": "string"
              },
              "father": {
                "type": "string"
              }
            }
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gender": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "remarks": {
            "type": "string"
          },
          "nationalities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "birth_places": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "place": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "birth_dates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "integer"
                },
                "date": {
                  "type": "string"
                },
                "year": {
                  "type": "integer"
                },
                "month": {
                  "type": "integer"
                }
              }
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "passports": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "info": {
                  "type": "string"
                },
                "number": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "identifiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "info": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "number": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "organization": {
                  "type": "string"
                },
                "function": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "since": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "clause_url": {
                  "type": "string"
                }
              }
            }
          },
          "decease_on": {
            "type": "string"
          },
          "created_on": {
            "type": "string"
          },
          "reviewed_on": {
            "type": "string"
          },
          "updated_on": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          },
          "deactivated_on": {
            "type": "string"
          },
          "match": {
            "type": "object",
            "description": "Jak wyszukiwanie znalazło rekord. Występuje tylko po wysłaniu `fuzziness`.",
            "properties": {
              "strict": {
                "type": "boolean",
                "description": "Czy rekord zwróciło wyszukiwanie ścisłe."
              },
              "similarity": {
                "type": "integer",
                "minimum": 50,
                "maximum": 100,
                "nullable": true,
                "description": "Podobieństwo z dopasowania rozmytego w procentach, od wysłanej wartości `fuzziness` do `100`. `null`, jeśli dopasowanie rozmyte nie zwróciło rekordu."
              }
            }
          }
        }
      },
      "Sanction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "names": {
            "type": "object",
            "properties": {
              "full": {
                "type": "string"
              },
              "last": {
                "type": "string"
              },
              "first": {
                "type": "string"
              },
              "third": {
                "type": "string"
              },
              "father": {
                "type": "string"
              },
              "middle": {
                "type": "string"
              }
            }
          },
          "title": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "remarks": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": "string"
                },
                "function": {
                  "type": "string"
                },
                "organization": {
                  "type": "string"
                }
              }
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "passports": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "info": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "number": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "created_on": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          },
          "updated_on": {
            "type": "string"
          },
          "birth_dates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "integer"
                },
                "date": {
                  "type": "string"
                },
                "year": {
                  "type": "integer"
                },
                "month": {
                  "type": "integer"
                }
              }
            }
          },
          "identifiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "info": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "number": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "reviewed_on": {
            "type": "string"
          },
          "birth_places": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "place": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "nationalities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "country_code": {
                  "type": "string"
                },
                "country_name": {
                  "type": "string"
                }
              }
            }
          },
          "deactivated_on": {
            "type": "string"
          },
          "match": {
            "type": "object",
            "description": "Jak wyszukiwanie znalazło rekord. Występuje tylko po wysłaniu `fuzziness`.",
            "properties": {
              "strict": {
                "type": "boolean",
                "description": "Czy rekord zwróciło wyszukiwanie ścisłe."
              },
              "similarity": {
                "type": "integer",
                "minimum": 50,
                "maximum": 100,
                "nullable": true,
                "description": "Podobieństwo z dopasowania rozmytego w procentach, od wysłanej wartości `fuzziness` do `100`. `null`, jeśli dopasowanie rozmyte nie zwróciło rekordu."
              }
            }
          }
        }
      },
      "PersonInput": {
        "type": "object",
        "description": "Dane osoby podane bezpośrednio w żądaniu — używane jako podmiot skanowania (kind=person).",
        "required": [
          "full_name"
        ],
        "properties": {
          "full_name": {
            "type": "string",
            "description": "Imię i nazwisko"
          },
          "identifiers": {
            "type": "array",
            "description": "Numery identyfikujące osobę.",
            "items": {
              "$ref": "#/components/schemas/PersonIdentifier"
            }
          },
          "birth_dates": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
            },
            "description": "Daty urodzenia w formacie ISO 8601. Dozwolone są częściowe daty: YYYY, YYYY-MM, YYYY-MM-DD. Można podać kilka wariantów, jeśli dokładna data nie jest znana."
          },
          "residence": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "description": "Kraje zamieszkania (ISO 3166-1 alpha-2)."
          },
          "citizenship": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "description": "Obywatelstwa (ISO 3166-1 alpha-2)."
          }
        }
      },
      "PersonIdentifier": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PESEL"
            ],
            "description": "Rodzaj identyfikatora osoby. Obecnie obsługiwane: PESEL (PL — country można pominąć). Wartości takie jak SSN, paszport czy tax id mogą zostać dodane w przyszłości."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Kraj wydania identyfikatora (ISO 3166-1 alpha-2). Pomijalny dla type=PESEL (przyjmowane jest PL)."
          },
          "value": {
            "type": "string",
            "description": "Wartość identyfikatora."
          }
        }
      },
      "CompanyIdentifier": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Rodzaj identyfikatora. Obsługiwane wartości: NIP (PL — country można pominąć), REGON (PL — country można pominąć), KRS (PL — country można pominąć), VAT_UE (numer VAT UE — wymaga country). Pole otwarte na nowe wartości w przyszłości."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Kraj wydania identyfikatora (ISO 3166-1 alpha-2). Wymagany dla type=VAT_UE, pomijalny dla type=NIP/REGON/KRS (przyjmowane jest PL)."
          },
          "value": {
            "type": "string",
            "description": "Wartość identyfikatora."
          }
        }
      },
      "IndustryCode": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PKD"
            ],
            "description": "Klasyfikacja działalności. Obecnie obsługiwane: PKD (Polska Klasyfikacja Działalności). Wartości takie jak NACE, NAICS, WZ mogą zostać dodane w przyszłości."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Kraj klasyfikacji (ISO 3166-1 alpha-2). Pomijalny dla type=PKD (przyjmowane jest PL)."
          },
          "value": {
            "type": "string",
            "description": "Kod w wybranej klasyfikacji (np. 62.01.Z dla PKD)."
          }
        }
      },
      "BankAccount": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "IBAN"
            ],
            "description": "Format identyfikatora rachunku. Obecnie obsługiwane: IBAN. Wartości takie jak US_ACH, SWIFT/BIC mogą zostać dodane w przyszłości."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Kraj rachunku (ISO 3166-1 alpha-2). Obecnie obsługiwane: PL."
          },
          "value": {
            "type": "string",
            "description": "Numer rachunku w formacie określonym przez type (np. dla IBAN: PL61109010140000071219812874)."
          }
        }
      },
      "CompanyInput": {
        "type": "object",
        "description": "Dane spółki podane bezpośrednio w żądaniu — używane jako podmiot skanowania (kind=company). Skanowanie wykorzystuje wyłącznie te dane; usługa nie wyszukuje danych w rejestrach zewnętrznych.",
        "required": [
          "names"
        ],
        "properties": {
          "names": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "Nazwy spółki w kolejności od bieżącej do najstarszej. Pierwszy element to aktualna nazwa, kolejne to nazwy historyczne."
          },
          "identifiers": {
            "type": "array",
            "description": "Numery identyfikujące spółkę (NIP, REGON, KRS, VAT_UE).",
            "items": {
              "$ref": "#/components/schemas/CompanyIdentifier"
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "description": "Kraje rejestracji / działalności spółki (ISO 3166-1 alpha-2)."
          },
          "address": {
            "type": "string",
            "description": "Adres"
          },
          "industry_codes": {
            "type": "array",
            "description": "Kody klasyfikacji działalności spółki (np. PKD).",
            "items": {
              "$ref": "#/components/schemas/IndustryCode"
            }
          },
          "bank_accounts": {
            "type": "array",
            "description": "Rachunki bankowe spółki (np. do sprawdzenia w białej liście VAT).",
            "items": {
              "$ref": "#/components/schemas/BankAccount"
            }
          }
        }
      },
      "Country": {
        "type": "object",
        "description": "Kraj z listy ryzyka AML — flagi wskazują kategorie ryzyka, dla których kraj został oznaczony. Wpis zawsze ma co najmniej jedną flagę w stanie true.",
        "required": [
          "iso2"
        ],
        "properties": {
          "iso2": {
            "type": "string",
            "pattern": "^[a-z]{2}$",
            "description": "Kod kraju ISO 3166-1 alpha-2 (małe litery)."
          },
          "fatf": {
            "type": "boolean",
            "description": "Kraj znajduje się na liście jurysdykcji FATF (Financial Action Task Force)."
          },
          "tax_risk": {
            "type": "boolean",
            "description": "Kraj sklasyfikowany jako jurysdykcja ryzyka podatkowego."
          },
          "other_risks": {
            "type": "boolean",
            "description": "Kraj oznaczony innym, nieskategoryzowanym ryzykiem AML."
          },
          "european_commission": {
            "type": "boolean",
            "description": "Kraj na liście państw trzecich wysokiego ryzyka Komisji Europejskiej."
          },
          "corruption": {
            "type": "boolean",
            "description": "Kraj oznaczony ryzykiem korupcji."
          },
          "basel_index": {
            "type": "boolean",
            "description": "Kraj oznaczony przez Basel AML Index."
          },
          "sponsoring_terrorism": {
            "type": "boolean",
            "description": "Kraj sklasyfikowany jako sponsorujący terroryzm."
          },
          "unclassified": {
            "type": "boolean",
            "description": "Kraj ma ryzyko nieobjęte powyższymi kategoriami."
          }
        }
      },
      "Pkd": {
        "type": "object",
        "description": "Kod PKD (Polska Klasyfikacja Działalności) oznaczony jako podwyższone ryzyko AML.",
        "required": [
          "number",
          "version",
          "description"
        ],
        "properties": {
          "number": {
            "type": "string",
            "description": "Kod PKD (np. \"62.01.Z\")."
          },
          "version": {
            "type": "string",
            "enum": [
              "2007",
              "2025"
            ],
            "description": "Wersja klasyfikacji PKD, do której należy kod: \"2007\" albo \"2025\". Ten sam symbol (np. 6020Z) może występować w obu wersjach pod inną nazwą."
          },
          "description": {
            "type": "string",
            "description": "Opis działalności."
          }
        }
      },
      "ScanRequest": {
        "type": "object",
        "description": "Żądanie dla endpointu POST /scan. Dwa opcjonalne klucze: companies, people. Podaj dokładnie jeden z nich — albo jedną firmę, albo jedną osobę, ale nie oba naraz (wymóg egzekwowany przez API; OpenAPI 2.0 nie pozwala wyrazić zasady albo/albo w schemacie). Każdy klucz to tablica zawierająca maksymalnie jedną pozycję; format tablicy zachowano na potrzeby przyszłej rozbudowy. Skanowanie używa wyłącznie podanych danych, bez wyszukiwania w rejestrach zewnętrznych (m.in. nie pobiera beneficjentów rzeczywistych). Pominięcie obu, podanie obu lub przesłanie więcej niż jednej pozycji zwraca 400.",
        "properties": {
          "companies": {
            "type": "array",
            "maxItems": 1,
            "description": "Firma do przeskanowania jako tablica jednoelementowa. Wzajemnie wyklucza się z people.",
            "items": {
              "$ref": "#/components/schemas/CompanyInput"
            }
          },
          "people": {
            "type": "array",
            "maxItems": 1,
            "description": "Osoba do przeskanowania jako tablica jednoelementowa. Wzajemnie wyklucza się z companies.",
            "items": {
              "$ref": "#/components/schemas/PersonInput"
            }
          }
        }
      },
      "ScanBucketBase": {
        "type": "object",
        "description": "Wspólne pola każdego bucketu w odpowiedzi /scan. Konkretne buckety (SanctionBucket, PepBucket, …) rozszerzają ten schemat o pole records typowane do właściwego rekordu listy. Bucket jest zawsze obecny w odpowiedzi — records może być pusty.",
        "required": [
          "terms",
          "status",
          "outcome",
          "match_count",
          "message"
        ],
        "properties": {
          "terms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Wartości użyte do przeszukania tej konkretnej listy (różne listy mogą być przeszukiwane różnymi wyrażeniami — np. nazwami, numerami NIP, kodami PKD)."
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "not_checked",
              "not_applicable",
              "error"
            ],
            "description": "Maszynowy kod statusu wykonania sprawdzenia (czy w ogóle się odbyło): ok (sprawdzono), not_checked (usługa niedostępna w planie), not_applicable (brak danych wejściowych dla tej listy), error (błąd źródła)."
          },
          "outcome": {
            "type": "string",
            "enum": [
              "clear",
              "match",
              "skipped",
              "error"
            ],
            "description": "Maszynowy kod wyniku (czy są trafienia): clear (sprawdzono, brak trafień), match (sprawdzono, są trafienia), skipped (nie sprawdzono — status=not_checked|not_applicable), error (status=error)."
          },
          "match_count": {
            "type": "integer",
            "description": "Liczba trafień (równe records.length). Wygodne do podsumowań i webhooków bez parsowania records."
          },
          "message": {
            "type": "string",
            "description": "Komunikat dla użytkownika — przetłumaczony zgodnie z nagłówkiem Accept-Language."
          }
        }
      },
      "SanctionCryptoWallet": {
        "type": "object",
        "description": "Portfel kryptowalutowy powiązany z rekordem sankcyjnym.",
        "properties": {
          "currency": {
            "type": "string",
            "description": "Kod waluty (np. BTC, ETH)."
          },
          "public_key": {
            "type": "string",
            "description": "Klucz publiczny / adres portfela."
          },
          "topics": {
            "type": "string",
            "description": "Tematy / etykiety portfela."
          }
        }
      },
      "SanctionIdentification": {
        "type": "object",
        "description": "Dokument identyfikacyjny (paszport, dowód itp.) powiązany z rekordem sankcyjnym.",
        "properties": {
          "country": {
            "type": "string",
            "description": "Kraj wydania."
          },
          "identification_type": {
            "type": "string",
            "description": "Rodzaj dokumentu."
          },
          "number": {
            "type": "string",
            "description": "Numer dokumentu."
          },
          "start_date": {
            "type": "string",
            "description": "Data wydania."
          },
          "end_date": {
            "type": "string",
            "description": "Data ważności."
          },
          "authority": {
            "type": "string",
            "description": "Organ wydający."
          },
          "summary": {
            "type": "string",
            "description": "Podsumowanie."
          }
        }
      },
      "SanctionFlatConnection": {
        "type": "object",
        "description": "Płaskie powiązanie z innym elementem ze schematu pełnej sankcji: opisowa etykieta roli oraz source_id powiązanego elementu.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Opis powiązania (np. \"director of organization\")."
          },
          "source_id": {
            "type": "string",
            "description": "Identyfikator źródłowy powiązanego elementu."
          }
        }
      },
      "FullSanctionRecord": {
        "type": "object",
        "description": "Rekord sankcyjny w odpowiedzi /scan w płaskim schemacie „pełnej sankcji\" (zgodnym z hurtowym zrzutem danych z iaml-pep-manager). Pola tablicowe grupują wszystkie warianty wartości dla rekordu (np. nazwy, aliasy). Wewnętrzne identyfikatory bazodanowe (całkowite id, old_id) nie są ujawniane — rekord identyfikuje source_id. Pola tablicowe są null, gdy brak wartości.",
        "required": [
          "source_id",
          "sanction_type",
          "db_created",
          "db_updated"
        ],
        "properties": {
          "source": {
            "type": "string",
            "description": "Nazwa źródła (listy sankcyjnej)."
          },
          "source_id": {
            "type": "string",
            "description": "Identyfikator rekordu w źródle."
          },
          "sanction_type": {
            "type": "string",
            "description": "Typ encji/sankcji (np. Person, Organization, Company, Vessel)."
          },
          "reason": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Powody nałożenia sankcji (null, gdy brak)."
          },
          "sanction_source_url": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Adresy URL źródła sankcji (null, gdy brak)."
          },
          "provisions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Podstawy / przepisy sankcji (null, gdy brak)."
          },
          "authority_id": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Numery referencyjne nadane przez organ wydający: numer wpisu na liście sankcyjnej (np. OFAC ent_num „23845”, EU FSF „EU.13592.53”) albo odwołanie do aktu prawnego, na którym opiera się wpis (np. „88 FR 13675”). Format zależy od źródła i nie jest ujednolicony; może zawierać kilka wartości. Występuje tylko dla części źródeł (null, gdy brak)."
          },
          "name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwy encji (null, gdy brak)."
          },
          "alias": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Aliasy (null, gdy brak)."
          },
          "weak_alias": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Słabe aliasy (null, gdy brak)."
          },
          "father_name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Imię ojca (null, gdy brak)."
          },
          "gender": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Płeć (null, gdy brak)."
          },
          "birth_date": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Daty urodzenia (null, gdy brak)."
          },
          "birth_place": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Miejsca urodzenia (null, gdy brak)."
          },
          "birth_country": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kraje urodzenia (null, gdy brak)."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dodatkowe uwagi (null, gdy brak)."
          },
          "website": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strony internetowe (null, gdy brak)."
          },
          "tax_number": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Numery podatkowe (null, gdy brak)."
          },
          "registration_number": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Numery rejestrowe (null, gdy brak)."
          },
          "country": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kraje (null, gdy brak)."
          },
          "source_url": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Adresy URL źródła rekordu (null, gdy brak)."
          },
          "inn_code": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody INN (null, gdy brak)."
          },
          "kpp_code": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody KPP (null, gdy brak)."
          },
          "legal_form": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Forma prawna (null, gdy brak)."
          },
          "jurisdiction": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Jurysdykcja (null, gdy brak)."
          },
          "type": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Typ encji (null, gdy brak)."
          },
          "call_sign": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sygnał wywoławczy (null, gdy brak)."
          },
          "gross_registered_tonnage": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Pojemność rejestrowa brutto (null, gdy brak)."
          },
          "model": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Model (null, gdy brak)."
          },
          "build_date": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Data budowy (null, gdy brak)."
          },
          "serial_number": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Numer seryjny (null, gdy brak)."
          },
          "address": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Adresy."
          },
          "crypto_wallet": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SanctionCryptoWallet"
            },
            "description": "Portfele kryptowalutowe."
          },
          "identification": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SanctionIdentification"
            },
            "description": "Dokumenty identyfikacyjne."
          },
          "additional_info": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dodatkowe informacje (null, gdy brak)."
          },
          "connection": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SanctionFlatConnection"
            },
            "description": "Powiązania z innymi encjami (opisowa etykieta + source_id powiązanego elementu)."
          },
          "end_date": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Data zakończenia sankcji (null, gdy brak)."
          },
          "db_created": {
            "type": "string",
            "description": "Znacznik czasu utworzenia rekordu w bazie (UTC, format YYYY-MM-DD HH:MM:SS)."
          },
          "db_updated": {
            "type": "string",
            "description": "Znacznik czasu ostatniej aktualizacji rekordu w bazie (UTC, format YYYY-MM-DD HH:MM:SS)."
          },
          "db_deleted": {
            "type": "string",
            "description": "Znacznik czasu usunięcia rekordu w bazie (null, gdy rekord aktywny)."
          }
        }
      },
      "SanctionConnection": {
        "type": "object",
        "description": "Powiązanie rekordu sankcyjnego z inną encją (krawędź grafu powiązań). Pole wyłączne dla /scan — nie występuje w GET /sanctions.",
        "required": [
          "relation",
          "role",
          "id",
          "sanctioned"
        ],
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "directorship",
              "ownership",
              "membership",
              "representation",
              "unknownlink",
              "family",
              "security"
            ],
            "description": "Rodzaj powiązania."
          },
          "role": {
            "type": "string",
            "description": "Rola encji powiązanej w ramach relacji (np. director, organization, owner, member, agent, client, person, relative, issuer, isin)."
          },
          "id": {
            "type": "string",
            "description": "Identyfikator encji powiązanej."
          },
          "sanctioned": {
            "type": "boolean",
            "description": "Czy encja powiązana sama znajduje się na liście sankcyjnej."
          },
          "record": {
            "$ref": "#/components/schemas/FullSanctionRecord"
          },
          "name": {
            "type": "string",
            "description": "Nazwa encji powiązanej (obecna, gdy sanctioned=false)."
          }
        }
      },
      "ScanSanction": {
        "description": "Rekord sankcyjny w odpowiedzi /scan — płaski rekord pełnej sankcji (FullSanctionRecord) rozszerzony o connections (graf powiązań z osadzonymi rekordami sankcyjnymi). GET /sanctions zwraca starszy format Sanction.",
        "allOf": [
          {
            "$ref": "#/components/schemas/FullSanctionRecord"
          },
          {
            "type": "object",
            "required": [
              "connections"
            ],
            "properties": {
              "connections": {
                "type": "array",
                "description": "Graf powiązań tego rekordu z innymi encjami (pusta tablica, gdy brak powiązań). Uzupełnia płaskie pole connection o rolę, informację o objęciu sankcją oraz osadzony rekord encji powiązanej.",
                "items": {
                  "$ref": "#/components/schemas/SanctionConnection"
                }
              }
            }
          }
        ]
      },
      "SanctionBucket": {
        "description": "Bucket sankcji — records to wpisy z list sankcyjnych (EU/US/UN/PL).",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ScanSanction"
                }
              }
            }
          }
        ]
      },
      "PepRcaPerson": {
        "type": "object",
        "description": "Wspólne pola rekordu PEP/RCA w odpowiedzi /scan, zgodne z kształtem elementów peps[]/rcas[] z dziennego pełnego zrzutu list z iaml-pep-manager. Pola wyłącznie wewnętrzne (type, title, remarks, addresses, passports, match_score) nie są udostępniane. GET /peps oraz /rcas zwracają starszy format Person/Rca.",
        "required": [
          "id",
          "names",
          "db_created",
          "db_updated"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Identyfikator rekordu w bazie PEP/RCA."
          },
          "names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Znane nazwy/imiona osoby (nazwa główna oraz aliasy)."
          },
          "gender": {
            "type": "string",
            "description": "Płeć osoby (pomijane, gdy nieznana)."
          },
          "identifiers": {
            "type": "array",
            "description": "Dokumenty tożsamości.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "number": {
                  "type": "string"
                }
              }
            }
          },
          "nationality": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Obywatelstwa jako kody krajów ISO 3166-1 alpha-2 (null, gdy brak)."
          },
          "birth_place": {
            "type": "object",
            "description": "Miejsce urodzenia (null, gdy nieznane).",
            "properties": {
              "place": {
                "type": "string"
              },
              "country_code": {
                "type": "string",
                "description": "Kod kraju ISO 3166-1 alpha-2."
              }
            }
          },
          "birth_date": {
            "type": "object",
            "description": "Data urodzenia; każda część jest null, gdy nieznana.",
            "properties": {
              "year": {
                "type": "integer"
              },
              "month": {
                "type": "integer"
              },
              "day": {
                "type": "integer"
              }
            }
          },
          "decease_on": {
            "type": "string",
            "description": "Data zgonu, YYYY-MM-DD (null, gdy osoba żyje)."
          },
          "deactivated_on": {
            "type": "string",
            "description": "Data dezaktywacji, YYYY-MM-DD (null, gdy aktywny)."
          },
          "old_id": {
            "type": "integer",
            "description": "Dawny identyfikator rekordu z tabeli record_ids (null, gdy brak)."
          },
          "db_created": {
            "type": "string",
            "description": "Znacznik czasu utworzenia rekordu w bazie."
          },
          "db_updated": {
            "type": "string",
            "description": "Znacznik czasu ostatniej aktualizacji w bazie."
          },
          "db_deleted": {
            "type": "string",
            "description": "Znacznik czasu usunięcia rekordu w bazie (null, gdy rekord aktywny)."
          }
        }
      },
      "ScanPep": {
        "description": "Rekord PEP w odpowiedzi /scan — wspólne pola osoby (PepRcaPerson) rozszerzone o źródła potwierdzające status PEP. GET /peps zwraca starszy format Person.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PepRcaPerson"
          },
          {
            "type": "object",
            "required": [
              "sources"
            ],
            "properties": {
              "sources": {
                "type": "array",
                "description": "Źródła potwierdzające status PEP.",
                "items": {
                  "type": "object",
                  "required": [
                    "organization",
                    "function",
                    "reason"
                  ],
                  "properties": {
                    "organization": {
                      "type": "string"
                    },
                    "function": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "since": {
                      "type": "string",
                      "description": "Data początkowa, YYYY-MM-DD (null, gdy brak)."
                    },
                    "to": {
                      "type": "string",
                      "description": "Data końcowa, YYYY-MM-DD (null, gdy brak)."
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "ScanRca": {
        "description": "Rekord RCA w odpowiedzi /scan — wspólne pola osoby (PepRcaPerson) rozszerzone o powiązane osoby PEP. GET /rcas zwraca starszy format Rca.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PepRcaPerson"
          },
          {
            "type": "object",
            "required": [
              "related_peps"
            ],
            "properties": {
              "related_peps": {
                "type": "array",
                "description": "Powiązane osoby na eksponowanych stanowiskach politycznych (PEP).",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "type",
                    "company"
                  ],
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Identyfikator powiązanej osoby PEP."
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "description": "Rodzaj powiązania."
                    },
                    "company": {
                      "type": "string"
                    },
                    "since": {
                      "type": "string",
                      "description": "Data początkowa powiązania, YYYY-MM-DD (null, gdy brak)."
                    },
                    "to": {
                      "type": "string",
                      "description": "Data końcowa powiązania, YYYY-MM-DD (null, gdy brak)."
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "PepBucket": {
        "description": "Bucket PEP — records to wpisy z listy osób na ważnych stanowiskach publicznych.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ScanPep"
                }
              }
            }
          }
        ]
      },
      "RcaBucket": {
        "description": "Bucket współpracowników PEP (RCA) — records to wpisy z listy RCA.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ScanRca"
                }
              }
            }
          }
        ]
      },
      "KnfBucket": {
        "description": "Bucket KNF — records to wpisy z listy ostrzeżeń publicznych Komisji Nadzoru Finansowego.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/KnfWarrning"
                }
              }
            }
          }
        ]
      },
      "BozonBucket": {
        "description": "Bucket Euro-bozon — records to wpisy z listy ostrzeżeń Euro-bozon.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Eurobozon"
                }
              }
            }
          }
        ]
      },
      "CountryBucket": {
        "description": "Bucket krajów ryzyka — records to wpisy z listy krajów oznaczonych przynajmniej jedną kategorią ryzyka AML (powiązane z polami citizenship/residence osoby albo countries spółki).",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Country"
                }
              }
            }
          }
        ]
      },
      "IndustryCodeMatch": {
        "type": "object",
        "description": "Pojedyncze trafienie w bucketie industry_code. Zawiera kontekst klasyfikacji (type + country), żeby konsument mógł odróżnić np. polskie PKD od innych klasyfikacji (NACE/NAICS) w przyszłości — pomimo że konkretne wartości kodów mogą być podobne.",
        "required": [
          "type",
          "country",
          "value",
          "description"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PKD"
            ],
            "description": "Klasyfikacja, do której należy kod. Obecnie obsługiwane: PKD. Wartości NACE, NAICS, WZ mogą zostać dodane w przyszłości — zgodne z polem type w IndustryCode."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Kraj klasyfikacji (ISO 3166-1 alpha-2). Pozwala odróżnić ten sam numer w klasyfikacjach różnych krajów."
          },
          "value": {
            "type": "string",
            "description": "Wartość kodu, na którym wystąpiło trafienie (np. \"62.01.Z\")."
          },
          "description": {
            "type": "string",
            "description": "Opis działalności dla danego kodu — w języku zgodnym z nagłówkiem Accept-Language, jeśli dostępne tłumaczenie."
          }
        }
      },
      "IndustryCodeBucket": {
        "description": "Bucket kodów branżowych ryzyka — records to konkretne kody (np. PKD), na które trafiono. Każdy rekord zawiera kontekst klasyfikacji (type + country), bo różne kraje mogą używać własnych klasyfikacji.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IndustryCodeMatch"
                }
              }
            }
          }
        ]
      },
      "VatWhiteListBucket": {
        "description": "Bucket białej listy VAT — records to wpisy z białej listy podatników VAT.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VatWhiteList"
                }
              }
            }
          }
        ]
      },
      "CryptoServiceRegistryBucket": {
        "description": "Bucket Rejestru działalności w zakresie walut wirtualnych — records to wpisy z rejestru.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanBucketBase"
          },
          {
            "type": "object",
            "required": [
              "records"
            ],
            "properties": {
              "records": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CryptoServiceRegistry"
                }
              }
            }
          }
        ]
      },
      "ScanMeta": {
        "type": "object",
        "description": "Podsumowanie całej odpowiedzi — jedno miejsce, w którym klient może odczytać, czy warto patrzeć dalej w results / person_scans. Liczniki agregują wyniki ze wszystkich podmiotów skanowania (spółka + wszystkie osoby).",
        "required": [
          "scan_id",
          "scan_secret",
          "checked_at",
          "report_date",
          "subject",
          "outcome",
          "buckets",
          "matches",
          "matched_subjects",
          "sanction_sources"
        ],
        "properties": {
          "scan_id": {
            "type": "string",
            "description": "Stabilny identyfikator tego skanowania. Pozwala odwołać się do tej odpowiedzi w późniejszych wywołaniach API — np. do wydrukowania raportu PDF (POST /scan/{scan_id}/pdf), razem ze scan_secret."
          },
          "scan_secret": {
            "type": "string",
            "description": "Sekret, którym zaszyfrowane są przechowywane wyniki skanowania, wymagany do wydrukowania raportu PDF (POST /scan/{scan_id}/pdf). iAML nie przechowuje jego kopii: utraconego sekretu nie da się odzyskać i raportu nie można już wtedy wydrukować. Traktuj go jak hasło."
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": "Znacznik czasu wykonania skanowania (ISO 8601 / RFC 3339)."
          },
          "report_date": {
            "type": "string",
            "format": "date",
            "description": "Data, której dotyczą dane raportu (\"stan na dzień\"). Obecnie jest to dzień przed wykonaniem skanowania (ISO 8601, RRRR-MM-DD)."
          },
          "subject": {
            "type": "object",
            "required": [
              "kind",
              "id"
            ],
            "description": "Podmiot, o który pytał wywołujący. Pozostałe podmioty w odpowiedzi (companies/persons) są kontekstem (powiązania, depth=1).",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "company",
                  "person"
                ],
                "description": "Rodzaj zapytanego podmiotu — wynika z tego, który klucz podano w żądaniu (company → company, person → person)."
              },
              "id": {
                "type": "string",
                "description": "Identyfikator podmiotu w obrębie tej odpowiedzi — wskazuje wpis w companies[] lub persons[]."
              }
            }
          },
          "outcome": {
            "type": "string",
            "enum": [
              "clear",
              "match",
              "partial",
              "error"
            ],
            "description": "Zbiorczy maszynowy werdykt: clear (wszystkie sprawdzone listy bez trafień), match (przynajmniej jedna lista zwróciła trafienie), partial (brak trafień, ale część list nie została sprawdzona — np. plan, brak danych), error (przynajmniej jedna lista zakończyła się błędem)."
          },
          "buckets": {
            "type": "object",
            "required": [
              "checked",
              "matched",
              "skipped",
              "failed"
            ],
            "description": "Liczniki bucketów wg statusu/wyniku — sumarycznie po wszystkich podmiotach skanowania.",
            "properties": {
              "checked": {
                "type": "integer",
                "description": "Liczba bucketów ze status=ok (niezależnie od wyniku)."
              },
              "matched": {
                "type": "integer",
                "description": "Liczba bucketów z outcome=match."
              },
              "skipped": {
                "type": "integer",
                "description": "Liczba bucketów ze status=not_checked|not_applicable."
              },
              "failed": {
                "type": "integer",
                "description": "Liczba bucketów ze status=error."
              }
            }
          },
          "matches": {
            "type": "object",
            "description": "Łączna liczba trafień per bucket (klucz = nazwa bucketu, wartość = match_count zsumowany po wszystkich podmiotach). Zawiera tylko buckety z trafieniami. Pozwala klientowi szybko ocenić wagę alertu — trafienie w sanction waży inaczej niż w industry_code — bez iterowania po results.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "matched_subjects": {
            "type": "array",
            "description": "Lista podmiotów (spółek i/lub osób), które wniosły trafienia. Pozwala wskazać konkretną osobę/spółkę bez iterowania po company_scans/person_scans. Pusta, gdy outcome=clear.",
            "items": {
              "type": "object",
              "required": [
                "kind",
                "id",
                "matches"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "company",
                    "person"
                  ],
                  "description": "Rodzaj podmiotu, którego dotyczą trafienia."
                },
                "id": {
                  "type": "string",
                  "description": "Identyfikator podmiotu (zgodny z companies[].id lub persons[].id)."
                },
                "matches": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  },
                  "description": "Mapa bucket → match_count dla tego konkretnego podmiotu."
                }
              }
            }
          },
          "sanction_sources": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody źródeł list sankcyjnych faktycznie przeszukanych w tym skanowaniu. Pusta tablica, gdy skanowanie sankcji się nie odbyło."
          }
        }
      },
      "ScanPdfRequest": {
        "type": "object",
        "description": "Treść żądania POST /scan/{scan_id}/pdf.",
        "required": [
          "scan_secret"
        ],
        "properties": {
          "scan_secret": {
            "type": "string",
            "description": "Sekret zwrócony w meta.scan_secret z odpowiedzi POST /scan."
          }
        }
      },
      "PersonScanResults": {
        "type": "object",
        "description": "Wynik sprawdzeń osoby — każdy bucket to inna lista/rejestr. Powiązania z innymi spółkami (np. w których osoba jest beneficjentem) nie znajdują się tutaj — są reprezentowane przez relationships oraz wpisy w companies[] / company_scans[] na poziomie ScanResponse.",
        "required": [
          "sanction",
          "pep",
          "rca",
          "knf",
          "bozon",
          "country"
        ],
        "properties": {
          "sanction": {
            "$ref": "#/components/schemas/SanctionBucket"
          },
          "pep": {
            "$ref": "#/components/schemas/PepBucket"
          },
          "rca": {
            "$ref": "#/components/schemas/RcaBucket"
          },
          "knf": {
            "$ref": "#/components/schemas/KnfBucket"
          },
          "bozon": {
            "$ref": "#/components/schemas/BozonBucket"
          },
          "country": {
            "$ref": "#/components/schemas/CountryBucket"
          }
        }
      },
      "CompanyScanResults": {
        "type": "object",
        "description": "Wynik sprawdzeń spółki — każdy bucket to inna lista/rejestr. Beneficjenci rzeczywiści spółki nie są bucketem — są reprezentowani przez relationships oraz wpisy w persons[] / person_scans[] na poziomie ScanResponse.",
        "required": [
          "sanction",
          "knf",
          "bozon",
          "country",
          "industry_code",
          "vat_white_list",
          "crypto_service_registry"
        ],
        "properties": {
          "sanction": {
            "$ref": "#/components/schemas/SanctionBucket"
          },
          "knf": {
            "$ref": "#/components/schemas/KnfBucket"
          },
          "bozon": {
            "$ref": "#/components/schemas/BozonBucket"
          },
          "country": {
            "$ref": "#/components/schemas/CountryBucket"
          },
          "industry_code": {
            "$ref": "#/components/schemas/IndustryCodeBucket"
          },
          "vat_white_list": {
            "$ref": "#/components/schemas/VatWhiteListBucket"
          },
          "crypto_service_registry": {
            "$ref": "#/components/schemas/CryptoServiceRegistryBucket"
          }
        }
      },
      "ScanPerson": {
        "type": "object",
        "description": "Osoba — encja występująca w odpowiedzi /scan (podmiot zapytania albo encja powiązana, np. beneficjent). Sam wynik skanowania osoby nie jest tutaj, tylko w person_scans (klucz: id). Schemat odrębny od Person (wpis listy PEP).",
        "required": [
          "id",
          "full_name",
          "identifiers",
          "birth_dates",
          "citizenship",
          "residence"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator osoby unikalny w obrębie tej odpowiedzi. Używany do korelacji z person_scans, relationships i meta.matched_subjects."
          },
          "full_name": {
            "type": "string",
            "description": "Imię i nazwisko (forma tożsama z polem full_name w żądaniu)."
          },
          "identifiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonIdentifier"
            }
          },
          "birth_dates": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
            },
            "description": "Daty urodzenia (ISO 8601, dozwolone częściowe: YYYY, YYYY-MM, YYYY-MM-DD)."
          },
          "citizenship": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          "residence": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          }
        }
      },
      "ScanCompany": {
        "type": "object",
        "description": "Spółka — encja występująca w odpowiedzi /scan (podmiot zapytania albo encja powiązana, np. spółka, w której skanowana osoba jest beneficjentem). Sam wynik skanowania spółki nie jest tutaj, tylko w company_scans (klucz: id).",
        "required": [
          "id",
          "names",
          "identifiers",
          "countries",
          "industry_codes",
          "bank_accounts"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator spółki unikalny w obrębie tej odpowiedzi. Używany do korelacji z company_scans, relationships i meta.matched_subjects."
          },
          "names": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "Nazwy spółki w kolejności od bieżącej do najstarszej. Pierwszy element to aktualna nazwa, kolejne to nazwy historyczne."
          },
          "identifiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanyIdentifier"
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "description": "Kraje rejestracji / działalności spółki (ISO 3166-1 alpha-2)."
          },
          "address": {
            "type": "string",
            "description": "Adres spółki (opcjonalny — może nie zostać ustalony)."
          },
          "industry_codes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IndustryCode"
            }
          },
          "bank_accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankAccount"
            }
          }
        }
      },
      "PersonScanEntry": {
        "type": "object",
        "description": "Wynik skanowania pojedynczej osoby w kontekście wspólnej odpowiedzi. meta dla tej osoby jest agregowane na poziomie root ScanResponse.meta — tu są tylko buckets w results.",
        "required": [
          "person_id",
          "results"
        ],
        "properties": {
          "person_id": {
            "type": "string",
            "description": "Klucz korelacji z persons[].id."
          },
          "results": {
            "$ref": "#/components/schemas/PersonScanResults"
          }
        }
      },
      "CompanyScanEntry": {
        "type": "object",
        "description": "Wynik skanowania pojedynczej spółki w kontekście wspólnej odpowiedzi. meta dla tej spółki jest agregowane na poziomie root ScanResponse.meta — tu są tylko buckets w results.",
        "required": [
          "company_id",
          "results"
        ],
        "properties": {
          "company_id": {
            "type": "string",
            "description": "Klucz korelacji z companies[].id."
          },
          "results": {
            "$ref": "#/components/schemas/CompanyScanResults"
          }
        }
      },
      "Relationship": {
        "type": "object",
        "description": "Powiązanie między osobą a spółką. Obecnie obsługiwane: beneficiary_of (osoba jest beneficjentem rzeczywistym spółki). W przyszłości może zostać dodane np. representative_of.",
        "required": [
          "kind",
          "person_id",
          "company_id"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "beneficiary_of"
            ],
            "description": "Rodzaj powiązania."
          },
          "person_id": {
            "type": "string",
            "description": "Klucz korelacji z persons[].id."
          },
          "company_id": {
            "type": "string",
            "description": "Klucz korelacji z companies[].id."
          },
          "role": {
            "type": "string",
            "description": "Rola w spółce (np. udziałowiec, członek zarządu) — specyficzna dla kind=beneficiary_of."
          },
          "share": {
            "type": "string",
            "description": "Udział lub liczba akcji (string ze względu na format CRBR, np. \"55%\") — specyficzne dla kind=beneficiary_of."
          }
        }
      },
      "ScanResponse": {
        "type": "object",
        "description": "Odpowiedź endpointu POST /scan. Zawiera graf encji (spółek i osób), wyniki skanowań oraz powiązania między nimi. meta.subject wskazuje encję, o którą pytał wywołujący. Obecna głębokość: 1 (skanujemy podmiot + jego bezpośrednie powiązania). W przyszłości może zostać dodany parametr żądania kontrolujący głębokość.",
        "required": [
          "meta",
          "companies",
          "persons",
          "company_scans",
          "person_scans",
          "relationships"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/ScanMeta"
          },
          "companies": {
            "type": "array",
            "description": "Wszystkie spółki w odpowiedzi (zapytana + powiązane). Każda ma unikalne id w obrębie tej odpowiedzi.",
            "items": {
              "$ref": "#/components/schemas/ScanCompany"
            }
          },
          "persons": {
            "type": "array",
            "description": "Wszystkie osoby w odpowiedzi (zapytana lub powiązane, np. beneficjenci rzeczywiści zapytanej spółki). Każda ma unikalne id w obrębie tej odpowiedzi.",
            "items": {
              "$ref": "#/components/schemas/ScanPerson"
            }
          },
          "company_scans": {
            "type": "array",
            "description": "Wyniki skanowania dla spółek, dla których wykonano sprawdzenie (zwykle tylko podmiot zapytania w obecnej głębokości). Klucz korelacji: company_id.",
            "items": {
              "$ref": "#/components/schemas/CompanyScanEntry"
            }
          },
          "person_scans": {
            "type": "array",
            "description": "Wyniki skanowania dla osób, dla których wykonano sprawdzenie. Klucz korelacji: person_id.",
            "items": {
              "$ref": "#/components/schemas/PersonScanEntry"
            }
          },
          "relationships": {
            "type": "array",
            "description": "Powiązania między spółkami a osobami (graph edges). Pole zawsze obecne — pusta tablica, jeśli nie wykryto powiązań.",
            "items": {
              "$ref": "#/components/schemas/Relationship"
            }
          }
        }
      },
      "SanctionListItem": {
        "type": "object",
        "description": "Pojedyncza lista sankcyjna dostępna w grupie organizacji, wraz z informacją, czy organizacja ma ją włączoną.",
        "required": [
          "source",
          "name",
          "enabled"
        ],
        "properties": {
          "source": {
            "type": "string",
            "description": "Kod źródła listy sankcyjnej. Ten sam kod pojawia się w meta.sanction_sources odpowiedzi POST /scan."
          },
          "name": {
            "type": "string",
            "description": "Przetłumaczona nazwa listy sankcyjnej (język wg nagłówka Accept-Language)."
          },
          "enabled": {
            "type": "boolean",
            "description": "Czy lista jest włączona w ustawieniach organizacji i tym samym uwzględniana w skanowaniach."
          }
        }
      },
      "NotFound": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "MicaBadRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MicaEmtRecord": {
        "type": "object",
        "properties": {
          "register": {
            "type": "string",
            "enum": [
              "emtwp"
            ],
            "description": "EMT — emitent tokenów będących e-pieniądzem."
          },
          "competent_authority": {
            "type": "string",
            "description": "Właściwy organ."
          },
          "home_member_state": {
            "type": "string",
            "description": "Państwo członkowskie pochodzenia."
          },
          "name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwa prawna emitenta/podmiotu."
          },
          "lei": {
            "type": "string",
            "description": "LEI."
          },
          "national_code": {
            "type": "string",
            "description": "Kod krajowy."
          },
          "commercial_name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwy handlowe."
          },
          "address": {
            "type": "string",
            "description": "Adres."
          },
          "website": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strona internetowa."
          },
          "authorisation_date": {
            "type": "string",
            "description": "Data autoryzacji (dd/mm/yyyy)."
          },
          "withdrawal_date": {
            "type": "string",
            "description": "Data wycofania (dd/mm/yyyy)."
          },
          "exemption_48_4": {
            "type": "string",
            "description": "Wyłączenie na podstawie art. 48 ust. 4."
          },
          "exemption_48_5": {
            "type": "string",
            "description": "Wyłączenie na podstawie art. 48 ust. 5."
          },
          "authorisation_type": {
            "type": "string",
            "description": "Autoryzowany jako."
          },
          "dti_ffg": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody DTI FFG (ISO 24165)."
          },
          "dti": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody DTI (ISO 24165)."
          },
          "white_paper_url": {
            "type": "string",
            "description": "Biała księga."
          },
          "offer_start_date": {
            "type": "string",
            "description": "Data rozpoczęcia oferty publicznej lub dopuszczenia do obrotu (dd/mm/yyyy)."
          },
          "comments": {
            "type": "string",
            "description": "Uwagi."
          },
          "last_update": {
            "type": "string",
            "description": "Ostatnia aktualizacja (dd/mm/yyyy)."
          }
        }
      },
      "MicaArtRecord": {
        "type": "object",
        "properties": {
          "register": {
            "type": "string",
            "enum": [
              "artzz"
            ],
            "description": "ART — emitent tokenów powiązanych z aktywami."
          },
          "competent_authority": {
            "type": "string",
            "description": "Właściwy organ."
          },
          "home_member_state": {
            "type": "string",
            "description": "Państwo członkowskie pochodzenia."
          },
          "name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwa prawna emitenta/podmiotu."
          },
          "lei": {
            "type": "string",
            "description": "LEI."
          },
          "national_code": {
            "type": "string",
            "description": "Kod krajowy."
          },
          "commercial_name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwy handlowe."
          },
          "address": {
            "type": "string",
            "description": "Adres."
          },
          "website": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strona internetowa."
          },
          "authorisation_date": {
            "type": "string",
            "description": "Data autoryzacji (dd/mm/yyyy)."
          },
          "withdrawal_date": {
            "type": "string",
            "description": "Data wycofania (dd/mm/yyyy)."
          },
          "credit_institution": {
            "type": "string",
            "description": "Instytucja kredytowa."
          },
          "dti_ffg": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody DTI FFG (ISO 24165)."
          },
          "dti": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody DTI (ISO 24165)."
          },
          "white_paper_url": {
            "type": "string",
            "description": "Biała księga."
          },
          "offer_start_date": {
            "type": "string",
            "description": "Data rozpoczęcia oferty publicznej lub dopuszczenia do obrotu (dd/mm/yyyy)."
          },
          "offer_countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kraje oferty."
          },
          "comments": {
            "type": "string",
            "description": "Uwagi."
          },
          "last_update": {
            "type": "string",
            "description": "Ostatnia aktualizacja (dd/mm/yyyy)."
          }
        }
      },
      "MicaCaspRecord": {
        "type": "object",
        "properties": {
          "register": {
            "type": "string",
            "enum": [
              "casps"
            ],
            "description": "CASP — dostawca usług w zakresie kryptoaktywów."
          },
          "competent_authority": {
            "type": "string",
            "description": "Właściwy organ."
          },
          "home_member_state": {
            "type": "string",
            "description": "Państwo członkowskie pochodzenia."
          },
          "name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwa prawna emitenta/podmiotu."
          },
          "lei": {
            "type": "string",
            "description": "LEI."
          },
          "national_code": {
            "type": "string",
            "description": "Kod krajowy."
          },
          "commercial_name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwy handlowe."
          },
          "address": {
            "type": "string",
            "description": "Adres."
          },
          "website": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strona internetowa."
          },
          "trading_platform_website": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Platforma obrotu."
          },
          "authorisation_date": {
            "type": "string",
            "description": "Data autoryzacji (dd/mm/yyyy)."
          },
          "withdrawal_date": {
            "type": "string",
            "description": "Data wycofania (dd/mm/yyyy)."
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "custody",
                "trading_platform",
                "crypto_to_funds",
                "crypto_to_crypto",
                "order_execution",
                "placement",
                "order_routing",
                "advisory",
                "portfolio_management",
                "transfer"
              ]
            },
            "description": "Usługi."
          },
          "service_countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kraje świadczenia usług."
          },
          "comments": {
            "type": "string",
            "description": "Uwagi."
          },
          "last_update": {
            "type": "string",
            "description": "Ostatnia aktualizacja (dd/mm/yyyy)."
          }
        }
      },
      "MicaOtherRecord": {
        "type": "object",
        "properties": {
          "register": {
            "type": "string",
            "enum": [
              "other"
            ],
            "description": "Inne kryptoaktywo (biała księga)."
          },
          "competent_authority": {
            "type": "string",
            "description": "Właściwy organ."
          },
          "home_member_state": {
            "type": "string",
            "description": "Państwo członkowskie pochodzenia."
          },
          "name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwa prawna emitenta/podmiotu."
          },
          "lei": {
            "type": "string",
            "description": "LEI."
          },
          "national_code": {
            "type": "string",
            "description": "Kod krajowy."
          },
          "casp_name": {
            "type": "string",
            "description": "Nazwa CASP."
          },
          "casp_lei": {
            "type": "string",
            "description": "LEI CASP."
          },
          "offer_countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kraje oferty."
          },
          "dti_ffg": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody DTI FFG (ISO 24165)."
          },
          "dti": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kody DTI (ISO 24165)."
          },
          "white_paper_url": {
            "type": "string",
            "description": "Biała księga."
          },
          "comments": {
            "type": "string",
            "description": "Uwagi."
          },
          "last_update": {
            "type": "string",
            "description": "Ostatnia aktualizacja (dd/mm/yyyy)."
          }
        }
      },
      "MicaNcaspRecord": {
        "type": "object",
        "properties": {
          "register": {
            "type": "string",
            "enum": [
              "ncasp"
            ],
            "description": "Podmiot niezgodny z przepisami."
          },
          "competent_authority": {
            "type": "string",
            "description": "Właściwy organ."
          },
          "home_member_state": {
            "type": "string",
            "description": "Państwo członkowskie pochodzenia."
          },
          "name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwa prawna emitenta/podmiotu."
          },
          "lei": {
            "type": "string",
            "description": "LEI."
          },
          "national_code": {
            "type": "string",
            "description": "Kod krajowy."
          },
          "commercial_name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Nazwy handlowe."
          },
          "website": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strona internetowa."
          },
          "infringement": {
            "type": "string",
            "description": "Naruszenie (art. 17)."
          },
          "reason": {
            "type": "string",
            "description": "Powód niezgodności."
          },
          "decision_date": {
            "type": "string",
            "description": "Data decyzji (dd/mm/yyyy)."
          },
          "comments": {
            "type": "string",
            "description": "Uwagi."
          },
          "last_update": {
            "type": "string",
            "description": "Ostatnia aktualizacja (dd/mm/yyyy)."
          }
        }
      },
      "MicaResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "description": "Łączna liczba zwróconych rekordów."
              },
              "term": {
                "type": "string",
                "description": "Fraza wyszukiwania (parametr q)."
              }
            }
          },
          "records": {
            "type": "object",
            "description": "Rekordy pogrupowane wg rejestru. Zestaw pól poszczególnego rekordu zależy od rejestru, do którego należy.",
            "properties": {
              "emtwp": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MicaEmtRecord"
                },
                "description": "EMT — emitenci tokenów będących e-pieniądzem."
              },
              "artzz": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MicaArtRecord"
                },
                "description": "ART — emitenci tokenów powiązanych z aktywami."
              },
              "casps": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MicaCaspRecord"
                },
                "description": "CASP — dostawcy usług w zakresie kryptoaktywów."
              },
              "other": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MicaOtherRecord"
                },
                "description": "Inne kryptoaktywa (biała księga)."
              },
              "ncasp": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MicaNcaspRecord"
                },
                "description": "Podmioty niezgodne z przepisami."
              }
            }
          }
        }
      },
      "ServiceUnavailable": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
