{"openapi":"3.1.0","info":{"title":"Data Provider","version":"da69258e4","description":"Geolokalizowane rekordy i posty z wielu kategorii i krajów. Błędy: { error: { code, message, issues? } }."},"servers":[{"url":"/"}],"paths":{"/geo/reverse":{"get":{"operationId":"geoReverse","summary":"Punkt → kraj i jednostki administracyjne (od kraju do gminy)","tags":["geo"],"x-module":"geo","parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number","minimum":-90,"maximum":90}},{"name":"lon","in":"query","required":true,"schema":{"type":"number","minimum":-180,"maximum":180}},{"name":"near_m","in":"query","required":false,"schema":{"default":300,"description":"Promień dopasowania najbliższej gminy, gdy punkt nie leży w żadnej","type":"integer","minimum":0,"maximum":10000},"description":"Promień dopasowania najbliższej gminy, gdy punkt nie leży w żadnej"},{"name":"nearby_m","in":"query","required":false,"schema":{"description":"Promień gmin sąsiednich (`nearby`): gminy, których granica jest bliżej niż tyle metrów, bez gminy punktu","type":"integer","minimum":1,"maximum":10000},"description":"Promień gmin sąsiednich (`nearby`): gminy, których granica jest bliżej niż tyle metrów, bez gminy punktu"}],"responses":{"200":{"description":"jednostki punktu (pusta lista poza zasięgiem)","content":{"application/json":{"schema":{"type":"object","properties":{"country_code":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"approximate":{"type":"boolean","description":"true = punkt poza gminami, wzięta najbliższa w promieniu near_m"},"distance_m":{"type":["number","null"]},"units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":"string","minLength":2,"maxLength":2},"level":{"type":"string","enum":["country","region","county","municipality"]},"local_level":{"type":"string"},"code":{"type":"string"},"code_system":{"type":"string"},"synthetic":{"type":"boolean"},"name":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"timezone":{"type":"string"}},"required":["id","country_code","level","local_level","code","code_system","synthetic","name","names","timezone"],"additionalProperties":false},"description":"Od kraju do gminy"},"boundary_units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":"string","minLength":2,"maxLength":2},"level":{"type":"string","enum":["country","region","county","municipality"]},"local_level":{"type":"string"},"code":{"type":"string"},"code_system":{"type":"string"},"synthetic":{"type":"boolean"},"name":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"timezone":{"type":"string"}},"required":["id","country_code","level","local_level","code","code_system","synthetic","name","names","timezone"],"additionalProperties":false},"description":"Inne gminy, na których granicy leży punkt"},"nearby":{"description":"Tylko z `nearby_m`: gminy w promieniu, od najbliższej","type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":"string","minLength":2,"maxLength":2},"level":{"type":"string","enum":["country","region","county","municipality"]},"local_level":{"type":"string"},"code":{"type":"string"},"code_system":{"type":"string"},"synthetic":{"type":"boolean"},"name":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"timezone":{"type":"string"},"distance_m":{"type":"number","description":"Odległość punktu od granicy gminy (0 = na granicy)"}},"required":["id","country_code","level","local_level","code","code_system","synthetic","name","names","timezone","distance_m"],"additionalProperties":false}},"geo_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["country_code","approximate","distance_m","units","boundary_units","geo_version"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/geo/search":{"get":{"operationId":"geoSearch","summary":"Wyszukiwarka jednostek administracyjnych i miejscowości po nazwie (bez znaków diakrytycznych)","tags":["geo"],"x-module":"geo","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100}},{"name":"country","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"types","in":"query","required":false,"schema":{"description":"rodzaje pozycji; bez parametru — tylko jednostki (odpowiedź bez zmian)","type":"string"},"description":"rodzaje pozycji; bez parametru — tylko jednostki (odpowiedź bez zmian)"},{"name":"limit","in":"query","required":false,"schema":{"default":10,"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"dopasowania","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":"string","minLength":2,"maxLength":2},"level":{"type":"string","enum":["country","region","county","municipality"]},"local_level":{"type":"string"},"code":{"type":"string"},"code_system":{"type":"string"},"synthetic":{"type":"boolean"},"name":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"timezone":{"type":"string"},"point":{"anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},{"type":"null"}],"description":"[lon, lat] punktu wewnątrz jednostki"},"parents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string","enum":["country","region","county","municipality"]},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false}},"match":{"type":"string","enum":["exact","prefix","similar"]},"score":{"type":"number"}},"required":["id","country_code","level","local_level","code","code_system","synthetic","name","names","timezone","point","parents","match","score"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"locality"},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":"string","minLength":2,"maxLength":2},"name":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"kind":{"description":"rodzaj ze źródła: miasto, wieś, osada…","type":["string","null"]},"point":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2,"description":"[lon, lat] środka miejscowości"},"population":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"parents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string","enum":["country","region","county","municipality"]},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false},"description":"jednostki nadrzędne z punktu"},"match":{"type":"string","enum":["exact","prefix","similar"]},"score":{"type":"number"}},"required":["type","id","country_code","name","names","kind","point","population","parents","match","score"],"additionalProperties":false}]}},"geo_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["items","geo_version"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin-units/{id}":{"get":{"operationId":"getAdminUnit","summary":"Jednostka administracyjna z rodzicami i opcjonalną geometrią (GeoJSON)","tags":["geo"],"x-module":"geo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"geometry","in":"query","required":false,"schema":{"default":"none","type":"string","enum":["none","simplified","full"]}}],"responses":{"200":{"description":"jednostka","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":"string","minLength":2,"maxLength":2},"level":{"type":"string","enum":["country","region","county","municipality"]},"local_level":{"type":"string"},"code":{"type":"string"},"code_system":{"type":"string"},"synthetic":{"type":"boolean"},"name":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"timezone":{"type":"string"},"parents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string","enum":["country","region","county","municipality"]},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false}},"bbox":{"anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]},"point":{"anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},{"type":"null"}]},"geometry":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"GeoJSON MultiPolygon, gdy geometry ≠ none"},"geo_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","country_code","level","local_level","code","code_system","synthetic","name","names","timezone","parents","bbox","point","geometry","geo_version"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma jednostki","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"geometry=full ponad limit wierzchołków (użyj simplified)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/categories":{"get":{"operationId":"listCategories","summary":"Drzewo kategorii z bieżącymi schematami atrybutów","tags":["kategorie"],"x-module":"catalog","parameters":[],"responses":{"200":{"description":"kategorie w kolejności ścieżek","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"string"},"parent":{"type":["string","null"]},"kind":{"type":"string","enum":["record","post"]},"status":{"type":"string","enum":["active","deprecated"]},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attributes_schema":{"$ref":"#/$defs/__schema0"},"filters":{"type":"array","items":{"type":"string"}},"display":{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9-]{1,64}$"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"layer":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"minzoom":{"type":"integer","minimum":0,"maximum":22},"cluster_below_z":{"type":"integer","minimum":0,"maximum":22}},"additionalProperties":false},"retention":{"anyOf":[{"type":"object","properties":{"default_ttl_hours":{"type":"integer","minimum":1,"maximum":8760},"max_ttl_hours":{"type":"integer","minimum":1,"maximum":17520},"archive_days":{"default":30,"type":"integer","minimum":0,"maximum":365},"closing_states":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"}}},"required":["default_ttl_hours","max_ttl_hours","archive_days","closing_states"],"additionalProperties":false},{"type":"object","properties":{"stale_after_days":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false}]},"personal_data":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["code","path","parent","kind","status","labels","schema_version","attributes_schema","filters","display","retention","personal_data","version","updated_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false,"$defs":{"__schema0":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","integer","boolean","object","array"]},"description":{"type":"string"},"enum":{"type":"array","items":{"type":["string","number"]}},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}},"required":{"type":"array","items":{"type":"string"}},"items":{"$ref":"#/$defs/__schema0"},"minimum":{"type":"number"},"maximum":{"type":"number"},"maxLength":{"type":"number"},"maxItems":{"type":"number"},"format":{"type":"string","enum":["date","date-time","uri","email","e164","currency"]}},"required":["type"],"additionalProperties":false}}}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/categories/{code}":{"get":{"operationId":"getCategory","summary":"Kategoria z bieżącym schematem atrybutów","tags":["kategorie"],"x-module":"catalog","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"}}],"responses":{"200":{"description":"kategoria","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"string"},"parent":{"type":["string","null"]},"kind":{"type":"string","enum":["record","post"]},"status":{"type":"string","enum":["active","deprecated"]},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attributes_schema":{"$ref":"#/$defs/__schema0"},"filters":{"type":"array","items":{"type":"string"}},"display":{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9-]{1,64}$"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"layer":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"minzoom":{"type":"integer","minimum":0,"maximum":22},"cluster_below_z":{"type":"integer","minimum":0,"maximum":22}},"additionalProperties":false},"retention":{"anyOf":[{"type":"object","properties":{"default_ttl_hours":{"type":"integer","minimum":1,"maximum":8760},"max_ttl_hours":{"type":"integer","minimum":1,"maximum":17520},"archive_days":{"default":30,"type":"integer","minimum":0,"maximum":365},"closing_states":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"}}},"required":["default_ttl_hours","max_ttl_hours","archive_days","closing_states"],"additionalProperties":false},{"type":"object","properties":{"stale_after_days":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false}]},"personal_data":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["code","path","parent","kind","status","labels","schema_version","attributes_schema","filters","display","retention","personal_data","version","updated_at"],"additionalProperties":false,"$defs":{"__schema0":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","integer","boolean","object","array"]},"description":{"type":"string"},"enum":{"type":"array","items":{"type":["string","number"]}},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}},"required":{"type":"array","items":{"type":"string"}},"items":{"$ref":"#/$defs/__schema0"},"minimum":{"type":"number"},"maximum":{"type":"number"},"maxLength":{"type":"number"},"maxItems":{"type":"number"},"format":{"type":"string","enum":["date","date-time","uri","email","e164","currency"]}},"required":["type"],"additionalProperties":false}}}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma kategorii","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/dictionaries":{"get":{"operationId":"listDictionaries","summary":"Lista słowników referencyjnych","tags":["słowniki"],"x-module":"catalog","parameters":[],"responses":{"200":{"description":"słowniki z liczbą wpisów i wersją","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"entries_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","labels","entries_count","version"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/dictionaries/{code}":{"get":{"operationId":"getDictionary","summary":"Wpisy słownika z filtrami, stronicowaniem HMAC i ETagiem","tags":["słowniki"],"x-module":"catalog","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"parent","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"}},{"name":"limit","in":"query","required":false,"schema":{"default":1000,"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2000}}],"responses":{"200":{"description":"wpisy słownika","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"parent_key":{"type":["string","null"]},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key","label","labels","parent_key","attributes"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"304":{"description":"brak zmian (ETag)"},"400":{"description":"niepoprawny kursor lub parametry","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma słownika","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/records":{"post":{"operationId":"upsertRecord","summary":"Zapisz albo wycofaj jeden rekord","description":"Pozycja jak we wsadzie. 201 = utworzony, 200 = zmieniony/duplikat/nieaktualny/wycofany, 422 = odrzucony (szczegóły w issues). Nagłówek `Idempotency-Key` (opcjonalny, zalecany): powtórka z tym samym ciałem zwraca zapisaną odpowiedź przez 7 dni; inne ciało → 409 `idempotency_key_reused`, w trakcie → 409 `in_progress`. Przy `dry_run` klucz jest pomijany.","tags":["zapis"],"x-module":"ingest","security":[{"bearer":[]}],"x-required-scope":"records:write","parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian","type":"string","enum":["0","1","true","false"]},"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"operation":{"default":"upsert","type":"string","const":"upsert"},"contract_version":{"default":1,"type":"number","const":1},"category":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"schema_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647},"name":{"type":"string","minLength":1,"maxLength":300},"lang":{"type":"string","maxLength":35},"names":{"type":"object","propertyNames":{"type":"string","maxLength":35},"additionalProperties":{"type":"string","minLength":1,"maxLength":300}},"geometry":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},{"type":"null"}]},"precision":{"type":"string","enum":["exact","approximate"]},"uncertainty_m":{"type":"number","minimum":0,"maximum":100000},"address":{"type":"object","properties":{"street":{"type":"string","minLength":1,"maxLength":200},"house_number":{"type":"string","minLength":1,"maxLength":30},"postal_code":{"type":"string","minLength":1,"maxLength":20},"locality":{"type":"string","minLength":1,"maxLength":200},"region":{"type":"string","minLength":1,"maxLength":200},"country_code":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"contacts":{"type":"object","properties":{"phones":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"emails":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"websites":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":2000,"format":"uri"}}},"additionalProperties":false},"opening_hours":{"maxItems":70,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"opens":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"closes":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["day","opens","closes"],"additionalProperties":false}},"timezone":{"type":"string"},"attributes":{"default":{}}},"required":["external_id","category","observed_at","name","lang"],"additionalProperties":false},{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"type":"string","const":"withdraw"},"contract_version":{"default":1,"type":"number","const":1},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647}},"required":["external_id","operation","observed_at"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"zapisany bez nowego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"record_status":{"anyOf":[{"type":"string","enum":["draft","published","retired","merged"]},{"type":"null"}]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"admin_units":{"description":"Nazwy jednostek — tylko gdy przypisanie liczono w tym żądaniu (created/updated).","type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["id","level","code","name"],"additionalProperties":false}},"approximate":{"type":"boolean"},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","record_status","country_code","admin_unit_ids","review_cases","issues"],"additionalProperties":false}}}},"201":{"description":"utworzony","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"record_status":{"anyOf":[{"type":"string","enum":["draft","published","retired","merged"]},{"type":"null"}]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"admin_units":{"description":"Nazwy jednostek — tylko gdy przypisanie liczono w tym żądaniu (created/updated).","type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["id","level","code","name"],"additionalProperties":false}},"approximate":{"type":"boolean"},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","record_status","country_code","admin_unit_ids","review_cases","issues"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key użyty z innym ciałem albo żądanie w toku","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"pozycja odrzucona","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"record_status":{"anyOf":[{"type":"string","enum":["draft","published","retired","merged"]},{"type":"null"}]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"admin_units":{"description":"Nazwy jednostek — tylko gdy przypisanie liczono w tym żądaniu (created/updated).","type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["id","level","code","name"],"additionalProperties":false}},"approximate":{"type":"boolean"},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","record_status","country_code","admin_unit_ids","review_cases","issues"],"additionalProperties":false}}}},"429":{"description":"limit żądań (20/10 s) albo pozycji na dobę","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listRecords","summary":"Publiczny odczyt i wyszukiwanie rekordów","tags":["rekordy"],"x-module":"query","parameters":[{"name":"category","in":"query","required":false,"schema":{"description":"kody kategorii po przecinku (z podkategoriami)","type":"string"},"description":"kody kategorii po przecinku (z podkategoriami)"},{"name":"near","in":"query","required":false,"schema":{"description":"punkt odniesienia `lat,lon`","type":"string","pattern":"^-?\\d{1,2}(\\.\\d+)?,-?\\d{1,3}(\\.\\d+)?$"},"description":"punkt odniesienia `lat,lon`"},{"name":"radius_m","in":"query","required":false,"schema":{"description":"promień od `near` w metrach","type":"integer","minimum":1,"maximum":50000},"description":"promień od `near` w metrach"},{"name":"bbox","in":"query","required":false,"schema":{"description":"`minLon,minLat,maxLon,maxLat`","type":"string"},"description":"`minLon,minLat,maxLon,maxLat`"},{"name":"admin_unit","in":"query","required":false,"schema":{"description":"id jednostki administracyjnej (gmina, powiat, region, kraj)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"id jednostki administracyjnej (gmina, powiat, region, kraj)"},{"name":"country","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{2}$"}},{"name":"q","in":"query","required":false,"schema":{"description":"nazwa i adres, bez znaków diakrytycznych; działa bez filtra geo","type":"string","minLength":2,"maxLength":100},"description":"nazwa i adres, bez znaków diakrytycznych; działa bez filtra geo"},{"name":"updated_after","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"nearest","in":"query","required":false,"schema":{"description":"N najbliższych od `near` (KNN)","type":"integer","minimum":1,"maximum":100},"description":"N najbliższych od `near` (KNN)"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["distance","name","updated_at"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2000}},{"name":"lang","in":"query","required":false,"schema":{"description":"język etykiet; bez `lang` odpowiedź nie trafia do publicznego cache","type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"},"description":"język etykiet; bez `lang` odpowiedź nie trafia do publicznego cache"}],"responses":{"200":{"description":"strona wyników z kursorem","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string"},"status":{"type":"string","enum":["draft","published","retired"]},"external_id":{"type":"string"},"name":{"type":"string"},"lang":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"geometry":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},{"type":"null"}]},"precision":{"anyOf":[{"type":"string","enum":["exact","approximate"]},{"type":"null"}]},"uncertainty_m":{"type":["number","null"]},"country_code":{"type":["string","null"]},"admin_units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false}},"address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"contacts":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"opening_hours":{"anyOf":[{"type":"array","items":{}},{"type":"null"}]},"timezone":{"type":["string","null"]},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"distance_m":{"type":["number","null"]}},"required":["id","category","status","external_id","name","lang","names","admin_units","attributes","schema_version","revision","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"304":{"description":"brak zmian (ETag)"},"400":{"description":"niepoprawne parametry zapytania","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"kategoria nie znaleziona","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/records:batch":{"post":{"operationId":"upsertRecordsBatch","summary":"Zapisz wsad rekordów (≤ 500 pozycji, ≤ 2 MiB)","description":"Każda pozycja we własnej transakcji — zła pozycja nie cofa innych; wynik per pozycja w kolejności żądania. Nagłówek `Idempotency-Key` (opcjonalny, zalecany): powtórka z tym samym ciałem zwraca zapisaną odpowiedź przez 7 dni; inne ciało → 409 `idempotency_key_reused`, w trakcie → 409 `in_progress`. Przy `dry_run` klucz jest pomijany.","tags":["zapis"],"x-module":"ingest","security":[{"bearer":[]}],"x-required-scope":"records:write","parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian","type":"string","enum":["0","1","true","false"]},"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"minItems":1,"maxItems":500,"type":"array","items":{"anyOf":[{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"operation":{"default":"upsert","type":"string","const":"upsert"},"contract_version":{"default":1,"type":"number","const":1},"category":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"schema_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647},"name":{"type":"string","minLength":1,"maxLength":300},"lang":{"type":"string","maxLength":35},"names":{"type":"object","propertyNames":{"type":"string","maxLength":35},"additionalProperties":{"type":"string","minLength":1,"maxLength":300}},"geometry":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},{"type":"null"}]},"precision":{"type":"string","enum":["exact","approximate"]},"uncertainty_m":{"type":"number","minimum":0,"maximum":100000},"address":{"type":"object","properties":{"street":{"type":"string","minLength":1,"maxLength":200},"house_number":{"type":"string","minLength":1,"maxLength":30},"postal_code":{"type":"string","minLength":1,"maxLength":20},"locality":{"type":"string","minLength":1,"maxLength":200},"region":{"type":"string","minLength":1,"maxLength":200},"country_code":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"contacts":{"type":"object","properties":{"phones":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"emails":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"websites":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":2000,"format":"uri"}}},"additionalProperties":false},"opening_hours":{"maxItems":70,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"opens":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"closes":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["day","opens","closes"],"additionalProperties":false}},"timezone":{"type":"string"},"attributes":{"default":{}}},"required":["external_id","category","observed_at","name","lang"],"additionalProperties":false},{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"type":"string","const":"withdraw"},"contract_version":{"default":1,"type":"number","const":1},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647}},"required":["external_id","operation","observed_at"],"additionalProperties":false}]}}},"required":["items"],"additionalProperties":false}}}},"responses":{"200":{"description":"wynik każdej pozycji","content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean"},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"items":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"record_status":{"anyOf":[{"type":"string","enum":["draft","published","retired","merged"]},{"type":"null"}]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"admin_units":{"description":"Nazwy jednostek — tylko gdy przypisanie liczono w tym żądaniu (created/updated).","type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["id","level","code","name"],"additionalProperties":false}},"approximate":{"type":"boolean"},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","record_status","country_code","admin_unit_ids","review_cases","issues"],"additionalProperties":false}}},"required":["dry_run","counts","items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key użyty z innym ciałem albo żądanie w toku","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"limit żądań (20/10 s) albo pozycji na dobę","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/records/{external_id}":{"delete":{"operationId":"withdrawRecord","summary":"Wycofaj rekord producenta (observed_at = teraz)","description":"Rekord znika z odczytów; ponowny zapis go przywraca. Nagłówek `Idempotency-Key` (opcjonalny, zalecany): powtórka z tym samym ciałem zwraca zapisaną odpowiedź przez 7 dni; inne ciało → 409 `idempotency_key_reused`, w trakcie → 409 `in_progress`. Przy `dry_run` klucz jest pomijany.","tags":["zapis"],"x-module":"ingest","security":[{"bearer":[]}],"x-required-scope":"records:write","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"dry_run","in":"query","required":false,"schema":{"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian","type":"string","enum":["0","1","true","false"]},"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian"},{"name":"observed_at","in":"query","required":false,"schema":{"description":"czas obserwacji producenta; bez niego czas serwera, który nie przesuwa watermarku (ponowny zapis przywraca rekord)","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"czas obserwacji producenta; bez niego czas serwera, który nie przesuwa watermarku (ponowny zapis przywraca rekord)"}],"responses":{"200":{"description":"wycofany albo już wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"record_status":{"anyOf":[{"type":"string","enum":["draft","published","retired","merged"]},{"type":"null"}]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"admin_units":{"description":"Nazwy jednostek — tylko gdy przypisanie liczono w tym żądaniu (created/updated).","type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["id","level","code","name"],"additionalProperties":false}},"approximate":{"type":"boolean"},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","record_status","country_code","admin_unit_ids","review_cases","issues"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"producent nie ma takiego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Idempotency-Key użyty z innym ciałem albo żądanie w toku","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"limit żądań (20/10 s) albo pozycji na dobę","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts":{"post":{"operationId":"upsertPost","summary":"Zapisz, przedłuż albo wycofaj jeden post","description":"Pozycja jak we wsadzie. 201 = utworzony, 200 = zmieniony/duplikat/przedłużony/zamknięty/nieaktualny/wycofany, 422 = odrzucony (szczegóły w issues). Nagłówek `Idempotency-Key` (opcjonalny, zalecany): powtórka z tym samym ciałem zwraca zapisaną odpowiedź przez 7 dni; inne ciało → 409 `idempotency_key_reused`, w trakcie → 409 `in_progress`. Przy `dry_run` klucz jest pomijany.","tags":["zapis"],"x-module":"ingest","security":[{"bearer":[]}],"x-required-scope":"posts:write","parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian","type":"string","enum":["0","1","true","false"]},"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"default":"upsert","type":"string","const":"upsert"},"contract_version":{"default":1,"type":"number","const":1},"category":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"schema_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","maxLength":20000},"lang":{"type":"string","maxLength":35},"state":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"locations":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"geometry":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},"precision":{"type":"string","enum":["exact","approximate"]},"uncertainty_m":{"type":"number","minimum":0,"maximum":100000},"address":{"type":"object","properties":{"street":{"type":"string","minLength":1,"maxLength":200},"house_number":{"type":"string","minLength":1,"maxLength":30},"postal_code":{"type":"string","minLength":1,"maxLength":20},"locality":{"type":"string","minLength":1,"maxLength":200},"region":{"type":"string","minLength":1,"maxLength":200},"country_code":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false}},"required":["geometry"],"additionalProperties":false}},"media":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["url"],"additionalProperties":false}},"attributes":{"default":{}}},"required":["external_id","category","observed_at","title","lang","locations"],"additionalProperties":false},{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"type":"string","const":"extend"},"contract_version":{"default":1,"type":"number","const":1},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["external_id","operation","observed_at"],"additionalProperties":false},{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"type":"string","const":"withdraw"},"contract_version":{"default":1,"type":"number","const":1},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647}},"required":["external_id","operation","observed_at"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"zapisany bez nowego postu","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","extended","closed","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"duplicate_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"post_status":{"anyOf":[{"type":"string","enum":["active","archived","withdrawn"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["ordinal","country_code","admin_unit_ids"],"additionalProperties":false}},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","post_status","expires_at","locations","review_cases","issues"],"additionalProperties":false}}}},"201":{"description":"utworzony","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","extended","closed","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"duplicate_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"post_status":{"anyOf":[{"type":"string","enum":["active","archived","withdrawn"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["ordinal","country_code","admin_unit_ids"],"additionalProperties":false}},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","post_status","expires_at","locations","review_cases","issues"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key użyty z innym ciałem albo żądanie w toku","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"pozycja odrzucona","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","extended","closed","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"duplicate_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"post_status":{"anyOf":[{"type":"string","enum":["active","archived","withdrawn"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["ordinal","country_code","admin_unit_ids"],"additionalProperties":false}},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","post_status","expires_at","locations","review_cases","issues"],"additionalProperties":false}}}},"429":{"description":"limit żądań (20/10 s) albo pozycji na dobę","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listPosts","summary":"Publiczny odczyt i wyszukiwanie postów","description":"Aktywne i niewygasłe posty (domyślnie ważność liczona względem teraz); filtry po lokalizacjach, treści i atrybutach. Cache 5 s.","tags":["posty"],"x-module":"query","parameters":[{"name":"category","in":"query","required":false,"schema":{"description":"kody kategorii po przecinku (z podkategoriami)","type":"string"},"description":"kody kategorii po przecinku (z podkategoriami)"},{"name":"near","in":"query","required":false,"schema":{"description":"punkt odniesienia `lat,lon` (filtr po lokalizacjach posta)","type":"string","pattern":"^-?\\d{1,2}(\\.\\d+)?,-?\\d{1,3}(\\.\\d+)?$"},"description":"punkt odniesienia `lat,lon` (filtr po lokalizacjach posta)"},{"name":"radius_m","in":"query","required":false,"schema":{"description":"promień od `near` w metrach","type":"integer","minimum":1,"maximum":50000},"description":"promień od `near` w metrach"},{"name":"bbox","in":"query","required":false,"schema":{"description":"`minLon,minLat,maxLon,maxLat` (dopasowanie po lokalizacjach)","type":"string"},"description":"`minLon,minLat,maxLon,maxLat` (dopasowanie po lokalizacjach)"},{"name":"admin_unit","in":"query","required":false,"schema":{"description":"id jednostki administracyjnej (gmina, powiat, region, kraj)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"id jednostki administracyjnej (gmina, powiat, region, kraj)"},{"name":"country","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{2}$"}},{"name":"q","in":"query","required":false,"schema":{"description":"szuka w tytule i treści posta","type":"string","minLength":2,"maxLength":100},"description":"szuka w tytule i treści posta"},{"name":"updated_after","in":"query","required":false,"schema":{"description":"po `last_seen_at` posta (ostatnia dostawa)","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"po `last_seen_at` posta (ostatnia dostawa)"},{"name":"nearest","in":"query","required":false,"schema":{"description":"N najbliższych od `near` (KNN po lokalizacjach)","type":"integer","minimum":1,"maximum":100},"description":"N najbliższych od `near` (KNN po lokalizacjach)"},{"name":"sort","in":"query","required":false,"schema":{"description":"domyślnie `published_at` (malejąco); `distance` wymaga `near`","type":"string","enum":["distance","title","published_at"]},"description":"domyślnie `published_at` (malejąco); `distance` wymaga `near`"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2000}},{"name":"lang","in":"query","required":false,"schema":{"description":"język nazw jednostek administracyjnych","type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"},"description":"język nazw jednostek administracyjnych"},{"name":"active_at","in":"query","required":false,"schema":{"description":"chwila, względem której liczy się ważność (domyślnie teraz); przeszłość tylko z zakresem `posts:archive` (D64)","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"chwila, względem której liczy się ważność (domyślnie teraz); przeszłość tylko z zakresem `posts:archive` (D64)"},{"name":"include","in":"query","required":false,"schema":{"description":"`archived` — dołącz zarchiwizowane (wymaga klucza z zakresem `posts:archive`)","type":"string"},"description":"`archived` — dołącz zarchiwizowane (wymaga klucza z zakresem `posts:archive`)"}],"responses":{"200":{"description":"strona wyników z kursorem","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string"},"external_id":{"type":"string"},"status":{"type":"string","enum":["active","archived","withdrawn"]},"state":{"type":["string","null"]},"title":{"type":"string"},"body":{"type":["string","null"]},"lang":{"type":"string"},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"media":{"type":"array","items":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"published_at":{"type":"string"},"expires_at":{"type":"string"},"distance_m":{"type":["number","null"]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"point":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},"geometry":{"anyOf":[{},{"type":"null"}]},"precision":{"anyOf":[{"type":"string","enum":["exact","approximate"]},{"type":"null"}]},"uncertainty_m":{"type":["number","null"]},"address":{"anyOf":[{},{"type":"null"}]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"admin_units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false}}},"required":["ordinal","point","geometry","admin_unit_ids","admin_units"],"additionalProperties":false}}},"required":["id","category","external_id","status","title","lang","attributes","schema_version","media","revision","published_at","expires_at","locations"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"304":{"description":"brak zmian (ETag)"},"400":{"description":"niepoprawne parametry zapytania","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"`include=archived` albo `active_at` w przeszłości bez zakresu posts:archive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"kategoria nie znaleziona","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts:batch":{"post":{"operationId":"upsertPostsBatch","summary":"Zapisz wsad postów (≤ 500 pozycji, ≤ 2 MiB)","description":"Każda pozycja we własnej transakcji — zła pozycja nie cofa innych; wynik per pozycja w kolejności żądania. Nagłówek `Idempotency-Key` (opcjonalny, zalecany): powtórka z tym samym ciałem zwraca zapisaną odpowiedź przez 7 dni; inne ciało → 409 `idempotency_key_reused`, w trakcie → 409 `in_progress`. Przy `dry_run` klucz jest pomijany.","tags":["zapis"],"x-module":"ingest","security":[{"bearer":[]}],"x-required-scope":"posts:write","parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian","type":"string","enum":["0","1","true","false"]},"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"minItems":1,"maxItems":500,"type":"array","items":{"anyOf":[{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"default":"upsert","type":"string","const":"upsert"},"contract_version":{"default":1,"type":"number","const":1},"category":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"schema_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","maxLength":20000},"lang":{"type":"string","maxLength":35},"state":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"locations":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"geometry":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},"precision":{"type":"string","enum":["exact","approximate"]},"uncertainty_m":{"type":"number","minimum":0,"maximum":100000},"address":{"type":"object","properties":{"street":{"type":"string","minLength":1,"maxLength":200},"house_number":{"type":"string","minLength":1,"maxLength":30},"postal_code":{"type":"string","minLength":1,"maxLength":20},"locality":{"type":"string","minLength":1,"maxLength":200},"region":{"type":"string","minLength":1,"maxLength":200},"country_code":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false}},"required":["geometry"],"additionalProperties":false}},"media":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["url"],"additionalProperties":false}},"attributes":{"default":{}}},"required":["external_id","category","observed_at","title","lang","locations"],"additionalProperties":false},{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"type":"string","const":"extend"},"contract_version":{"default":1,"type":"number","const":1},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["external_id","operation","observed_at"],"additionalProperties":false},{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"operation":{"type":"string","const":"withdraw"},"contract_version":{"default":1,"type":"number","const":1},"observed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":0,"maximum":2147483647}},"required":["external_id","operation","observed_at"],"additionalProperties":false}]}}},"required":["items"],"additionalProperties":false}}}},"responses":{"200":{"description":"wynik każdej pozycji","content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean"},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"items":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","extended","closed","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"duplicate_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"post_status":{"anyOf":[{"type":"string","enum":["active","archived","withdrawn"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["ordinal","country_code","admin_unit_ids"],"additionalProperties":false}},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","post_status","expires_at","locations","review_cases","issues"],"additionalProperties":false}}},"required":["dry_run","counts","items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key użyty z innym ciałem albo żądanie w toku","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"limit żądań (20/10 s) albo pozycji na dobę","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts/{external_id}":{"delete":{"operationId":"withdrawPost","summary":"Wycofaj post producenta (tombstone)","description":"Post znika z odczytów, a tożsamość zostaje jako tombstone (brak możliwości wskrzeszenia). Nagłówek `Idempotency-Key` (opcjonalny, zalecany): powtórka z tym samym ciałem zwraca zapisaną odpowiedź przez 7 dni; inne ciało → 409 `idempotency_key_reused`, w trakcie → 409 `in_progress`. Przy `dry_run` klucz jest pomijany.","tags":["zapis"],"x-module":"ingest","security":[{"bearer":[]}],"x-required-scope":"posts:write","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"dry_run","in":"query","required":false,"schema":{"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian","type":"string","enum":["0","1","true","false"]},"description":"1 = pełna walidacja, przypisanie geo i decyzja o zapisie, a na końcu wycofanie zmian"},{"name":"observed_at","in":"query","required":false,"schema":{"description":"czas obserwacji producenta; bez niego czas serwera","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"czas obserwacji producenta; bez niego czas serwera"}],"responses":{"200":{"description":"wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","extended","closed","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"duplicate_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"post_status":{"anyOf":[{"type":"string","enum":["active","archived","withdrawn"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["ordinal","country_code","admin_unit_ids"],"additionalProperties":false}},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","post_status","expires_at","locations","review_cases","issues"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"producent nie ma takiego postu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Idempotency-Key użyty z innym ciałem albo żądanie w toku","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"pozycja odrzucona (np. już tombstone)","content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":["string","null"]},"status":{"type":"string","enum":["created","updated","duplicate","extended","closed","stale","rejected","withdrawn"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"duplicate_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"post_status":{"anyOf":[{"type":"string","enum":["active","archived","withdrawn"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["ordinal","country_code","admin_unit_ids"],"additionalProperties":false}},"review_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","external_id","status","id","revision","post_status","expires_at","locations","review_cases","issues"],"additionalProperties":false}}}},"429":{"description":"limit żądań (20/10 s) albo pozycji na dobę","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/changes":{"get":{"operationId":"listChanges","summary":"Strumień zmian od kursora `since`, w porządku `seq`","description":"Publiczna strona dziennika zmian (`entity_type` `record` i `post`). Filtr `category` obejmuje podkategorie; `include=sandbox` wymaga klucza producenta z `sandbox: true` i ustawia `private, no-store`. Kursor starszy niż floor retencji (30 dni) → 410 `resync_required` z `details.floor` i `details.head`; klient zapisuje `head`, pełnie odczytuje listy `/records` i `/posts`, a następnie czyta `/changes?since=head` stronami.","tags":["zmiany"],"x-module":"query","parameters":[{"name":"since","in":"query","required":false,"schema":{"default":0,"description":"kursor `seq` z `next_since` poprzedniej strony; 0 = początek strumienia","type":"integer","minimum":0,"maximum":9007199254740991},"description":"kursor `seq` z `next_since` poprzedniej strony; 0 = początek strumienia"},{"name":"category","in":"query","required":false,"schema":{"description":"kod kategorii z podkategoriami (ściana ścieżki ltree)","type":"string","maxLength":64},"description":"kod kategorii z podkategoriami (ściana ścieżki ltree)"},{"name":"limit","in":"query","required":false,"schema":{"default":500,"description":"maksymalna liczba zdarzeń na stronie","type":"integer","minimum":1,"maximum":1000},"description":"maksymalna liczba zdarzeń na stronie"},{"name":"include","in":"query","required":false,"schema":{"description":"dołącz zdarzenia własnego klucza sandbox (wymaga klucza z sandbox: true)","type":"string","enum":["sandbox"]},"description":"dołącz zdarzenia własnego klucza sandbox (wymaga klucza z sandbox: true)"}],"responses":{"200":{"description":"strona zdarzeń i kursor kolejnej","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string"},"op":{"type":"string","enum":["upsert","retire","expire","purge","merge","recompute"]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["seq","entity_type","entity_id","category","op","revision","at"],"additionalProperties":false}},"next_since":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_more":{"type":"boolean"}},"required":["items","next_since","has_more"],"additionalProperties":false}}}},"400":{"description":"niepoprawne parametry zapytania","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"include=sandbox bez klucza sandbox","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiej kategorii","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"410":{"description":"kursor zbyt stary — resynchronizacja z details.floor i details.head: pełny odczyt list, potem changes od head","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/records/{id}":{"get":{"operationId":"getRecord","summary":"Szczegóły pojedynczego rekordu","tags":["rekordy"],"x-module":"query","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"}}],"responses":{"200":{"description":"rekord","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string"},"status":{"type":"string","enum":["draft","published","retired"]},"external_id":{"type":"string"},"name":{"type":"string"},"lang":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"geometry":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},{"type":"null"}]},"precision":{"anyOf":[{"type":"string","enum":["exact","approximate"]},{"type":"null"}]},"uncertainty_m":{"type":["number","null"]},"country_code":{"type":["string","null"]},"admin_units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false}},"address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"contacts":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"opening_hours":{"anyOf":[{"type":"array","items":{}},{"type":"null"}]},"timezone":{"type":["string","null"]},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"distance_m":{"type":["number","null"]}},"required":["id","category","status","external_id","name","lang","names","admin_units","attributes","schema_version","revision","created_at","updated_at"],"additionalProperties":false}}}},"301":{"description":"rekord scalony (przekierowanie na cel)"},"304":{"description":"brak zmian (ETag)"},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma takiego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/records.geojson":{"get":{"operationId":"getRecordsGeoJson","summary":"Kolekcja obiektów GeoJSON (FeatureCollection)","tags":["rekordy"],"x-module":"query","parameters":[],"responses":{"200":{"description":"kolekcja obiektów GeoJSON","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"FeatureCollection"},"features":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"Feature"},"id":{"type":"string"},"geometry":{"anyOf":[{},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","id","geometry","properties"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["type","features"],"additionalProperties":false}}}},"304":{"description":"brak zmian (ETag)"},"400":{"description":"błędne parametry zapytania","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"kategoria nie znaleziona","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/records:search":{"post":{"operationId":"searchRecords","summary":"Wyszukiwanie rekordów z relacją przestrzenną (intersects)","description":"Filtry jak w `GET /records`: `radius_m` i `sort=distance` wymagają `near`, `q` krótsze niż 3 znaki wymaga `category`, a nieznane pola są odrzucane; błąd ciała → 422 `invalid_body`.","tags":["rekordy"],"x-module":"query","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"anyOf":[{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"}},{"type":"string"}]},"near":{"anyOf":[{"type":"string","pattern":"^-?\\d{1,2}(\\.\\d+)?,-?\\d{1,3}(\\.\\d+)?$"},{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lon":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lon"]}]},"radius_m":{"description":"promień od `near` w metrach","type":"integer","minimum":1,"maximum":50000},"bbox":{"anyOf":[{"type":"string"},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"object","properties":{"minLon":{"type":"number"},"minLat":{"type":"number"},"maxLon":{"type":"number"},"maxLat":{"type":"number"}},"required":["minLon","minLat","maxLon","maxLat"]}]},"admin_unit":{"description":"id jednostki administracyjnej (gmina, powiat, region, kraj)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"q":{"description":"nazwa i adres, bez znaków diakrytycznych; działa bez filtra geo","type":"string","minLength":2,"maxLength":100},"updated_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"sort":{"type":"string","enum":["distance","name","updated_at"]},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"cursor":{"type":"string","maxLength":2000},"lang":{"description":"język etykiet; bez `lang` odpowiedź nie trafia do publicznego cache","type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"},"intersects":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}],"description":"geometria granicy przeszukiwania (GeoJSON, <= 10 000 wierzchołków)"},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["intersects"],"additionalProperties":{"type":["string","number","boolean"]}}}}},"responses":{"200":{"description":"wyniki wyszukiwania","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string"},"status":{"type":"string","enum":["draft","published","retired"]},"external_id":{"type":"string"},"name":{"type":"string"},"lang":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"geometry":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},{"type":"null"}]},"precision":{"anyOf":[{"type":"string","enum":["exact","approximate"]},{"type":"null"}]},"uncertainty_m":{"type":["number","null"]},"country_code":{"type":["string","null"]},"admin_units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false}},"address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"contacts":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"opening_hours":{"anyOf":[{"type":"array","items":{}},{"type":"null"}]},"timezone":{"type":["string","null"]},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"distance_m":{"type":["number","null"]}},"required":["id","category","status","external_id","name","lang","names","admin_units","attributes","schema_version","revision","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"304":{"description":"brak zmian (ETag)"},"400":{"description":"błędne parametry wyszukiwania","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"kategoria nie znaleziona","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd walidacji ciała żądania","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts/{id}":{"get":{"operationId":"getPost","summary":"Pobierz widoczny post po ID","description":"Zwraca post, jeśli jest aktywny i niewygasły względem chwili odczytu (albo zarchiwizowany przy `include=archived` z zakresem `posts:archive`). Cache 5 s.","tags":["posty"],"x-module":"query","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"post (aktywny albo zarchiwizowany z `include`)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string"},"external_id":{"type":"string"},"status":{"type":"string","enum":["active","archived","withdrawn"]},"state":{"type":["string","null"]},"title":{"type":"string"},"body":{"type":["string","null"]},"lang":{"type":"string"},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"media":{"type":"array","items":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"published_at":{"type":"string"},"expires_at":{"type":"string"},"distance_m":{"type":["number","null"]},"locations":{"type":"array","items":{"type":"object","properties":{"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"point":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},"geometry":{"anyOf":[{},{"type":"null"}]},"precision":{"anyOf":[{"type":"string","enum":["exact","approximate"]},{"type":"null"}]},"uncertainty_m":{"type":["number","null"]},"address":{"anyOf":[{},{"type":"null"}]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"admin_units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string"},"name":{"type":"string"}},"required":["id","level","name"],"additionalProperties":false}}},"required":["ordinal","point","geometry","admin_unit_ids","admin_units"],"additionalProperties":false}}},"required":["id","category","external_id","status","title","lang","attributes","schema_version","media","revision","published_at","expires_at","locations"],"additionalProperties":false}}}},"304":{"description":"brak zmian (ETag)"},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`include=archived` bez zakresu posts:archive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego postu (albo wygasł, w sandboxie, wycofany)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tiles/{z}/{x}/{y}":{"get":{"operationId":"getVectorTile","summary":"Kafel wektorowy Mapbox Vector Tile (MVT)","description":"Zwraca binarny kafel MVT dla zadanych współrzędnych i kategorii","tags":["kafle"],"x-module":"tiles","parameters":[{"name":"z","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":20}},{"name":"x","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"y","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"kafel wektorowy (MVT)"},"204":{"description":"pusty kafel"},"304":{"description":"brak zmian (ETag)"},"400":{"description":"błędne parametry zapytania","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"kategoria nie znaleziona","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-desk/next":{"post":{"operationId":"nextReviewDeskCase","summary":"Następna sprawa do moderacji z gotowym widokiem rekordów (z pominięciem spraw z listy)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"skip":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind"],"additionalProperties":false}}}},"responses":{"200":{"description":"sprawa albo `view: null`, gdy nic nie zostało","content":{"application/json":{"schema":{"type":"object","properties":{"open":{"type":"integer","minimum":0,"maximum":9007199254740991},"view":{"anyOf":[{"type":"object","properties":{"case":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false},"geometry":{"anyOf":[{"type":"object","properties":{"origin":{"type":["string","null"]},"origin_label":{"type":["string","null"]},"reason":{"type":["string","null"]},"reason_label":{"type":["string","null"]},"current":{"anyOf":[{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2},{"type":"null"}]},"proposals":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["gugik","photon"]},"source_label":{"type":"string"},"point":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2},"query":{"type":["string","null"]}},"required":["source","source_label","point","query"],"additionalProperties":false}}},"required":["origin","origin_label","reason","reason_label","current","proposals"],"additionalProperties":false},{"type":"null"}]},"duplicate":{"anyOf":[{"type":"object","properties":{"origin":{"type":["string","null"]},"origin_label":{"type":["string","null"]},"reason":{"type":["string","null"]},"reason_label":{"type":["string","null"]},"similarity":{"type":["number","null"]},"distance_m":{"type":["number","null"]}},"required":["origin","origin_label","reason","reason_label","similarity","distance_m"],"additionalProperties":false},{"type":"null"}]},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"category":{"type":"object","properties":{"code":{"type":["string","null"]},"label":{"type":"string"}},"required":["code","label"],"additionalProperties":false},"status":{"type":"string","enum":["draft","published","retired","merged"]},"precision":{"anyOf":[{"type":"string","enum":["exact","approximate"]},{"type":"null"}]},"uncertainty_m":{"type":["number","null"]},"point":{"anyOf":[{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2},{"type":"null"}]},"address_line":{"type":["string","null"]},"municipality":{"type":["string","null"]},"county":{"type":["string","null"]},"phones":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"websites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","category","status","precision","uncertainty_m","point","address_line","municipality","county","phones","emails","websites","created_at","updated_at"],"additionalProperties":false}},"unsupported":{"type":["string","null"]}},"required":["case","geometry","duplicate","records","unsupported"],"additionalProperties":false},{"type":"null"}]}},"required":["open","view"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"nieznany rodzaj sprawy albo zła lista pominiętych","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-cases/{id}:decide":{"post":{"operationId":"decideReviewCase","summary":"Decyzja moderatora w sprawie: punkt, obecne położenie, scalenie albo „to nie duplikat”","description":"Reguły rodzaju sprawy, punkt z propozycji (GUGiK/Photon) albo wskazany ręcznie z niepewnością źródła, zamknięcie sprawy i notatka z moderatorem. Sprawa zamknięta wcześniej albo równolegle → 200 z `outcome: already_closed`.","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"set_point"},"source":{"type":"string","enum":["gugik","photon","manual"]},"point":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2},"moderator":{"type":"string","maxLength":200}},"required":["action","source"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"keep_current"},"moderator":{"type":"string","maxLength":200}},"required":["action"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"merge"},"into":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"moderator":{"type":"string","maxLength":200}},"required":["action","into"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"not_duplicate"},"moderator":{"type":"string","maxLength":200}},"required":["action"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"wynik decyzji","content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["done","already_closed"]},"message":{"type":"string"},"case":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}},"required":["outcome","message","case"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiej sprawy","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"rekord scalony albo wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"akcja nie pasuje do sprawy, brak propozycji lub punktu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/live-feed":{"get":{"operationId":"adminLiveFeed","summary":"Strumień zmian dla widoku „Na żywo” z nazwami, kategorią, producentem i miejscem","description":"Bez `since` (albo z kursorem poniżej retencji) — ostatnie zdarzenia jako historia. Najnowsze zdarzenia cyklu są wzbogacone o nazwę, producenta, miejsce i punkt; reszta tylko policzona w `unenriched`.","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"zdarzenia od kursora","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"at":{"type":"string"},"kind":{"type":"string","enum":["record","post"]},"op":{"type":"string","enum":["upsert","retire","expire","purge","merge","recompute"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":["string","null"]},"category_label":{"type":"string"},"name":{"type":["string","null"]},"place":{"type":["string","null"]},"country":{"type":["string","null"]},"producer_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"producer":{"type":["string","null"]},"unit_id":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"point":{"anyOf":[{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2},{"type":"null"}]},"enriched":{"type":"boolean"}},"required":["seq","at","kind","op","entity_id","category","category_label","name","place","country","producer_id","producer","unit_id","point","enriched"],"additionalProperties":false}},"next_since":{"type":"integer","minimum":0,"maximum":9007199254740991},"behind":{"type":"boolean"},"unenriched":{"type":"integer","minimum":0,"maximum":9007199254740991},"history":{"type":"boolean"}},"required":["events","next_since","behind","unenriched","history"],"additionalProperties":false}}}},"400":{"description":"niepoprawny kursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/erasures":{"post":{"operationId":"eraseEntity","summary":"Usunięcie danych osobowych na żądanie (post z lokalizacjami, rewizjami i dziennikiem dostaw)","description":"Post znika całkowicie, tożsamości dostają tombstone (bez wskrzeszenia), w strumieniu `purge`; zostaje ślad bez treści. Drugie wywołanie zwraca `already_erased: true`.","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_type":{"type":"string","const":"post"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["entity_type","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"usunięte (albo już wcześniej)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"post_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requested_by":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":["string","null"]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"at":{"type":"string"},"already_erased":{"type":"boolean"}},"required":["id","post_id","category_id","requested_by","reason","counts","at","already_erased"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego posta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listErasures","summary":"Ślady usunięć danych osobowych (najnowsze najpierw)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"ślady","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"post_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requested_by":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":["string","null"]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"at":{"type":"string"}},"required":["id","post_id","category_id","requested_by","reason","counts","at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/producers/{id}/activity":{"get":{"operationId":"getProducerActivity","summary":"Aktywność producenta poza sandboxem: ostatnia dostawa rekordów i postów, liczba z 24 h (czujka ciszy)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin | producers:activity","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"aktywność","content":{"application/json":{"schema":{"type":"object","properties":{"producer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"records":{"type":"object","properties":{"last_received_at":{"type":["string","null"]},"last_24h":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["last_received_at","last_24h"],"additionalProperties":false},"posts":{"type":"object","properties":{"last_received_at":{"type":["string","null"]},"last_24h":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["last_received_at","last_24h"],"additionalProperties":false}},"required":["producer_id","records","posts"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin lub producers:activity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego producenta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/data-map":{"get":{"operationId":"getDataMap","summary":"Mapa danych: liczby rekordów i postów po producencie, kategorii, kraju i gminie (bez sandboxu)","description":"Opublikowane rekordy i aktywne posty poza sandboxem, pogrupowane po (rodzaj, producent, kategoria, kraj, najgłębsza jednostka), ze średnim punktem grupy. `units` to słownik jednostek grup z rodzicami aż do kraju, `latest_seq` — najwyższy `seq` strumienia zmian (start kursora `/changes`). Grupa bez jednostki: `country` i `unit_id` null.","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"responses":{"200":{"description":"mapa danych","content":{"application/json":{"schema":{"type":"object","properties":{"generated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"latest_seq":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"najwyższy `seq` strumienia zmian w chwili odczytu"},"producers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"description":"producenci występujący w `rows`"},"categories":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"parent":{"type":["string","null"]},"kind":{"type":"string","enum":["record","post"]},"label":{"type":"string"}},"required":["code","parent","kind","label"],"additionalProperties":false}},"units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"country":{"type":"string","minLength":2,"maxLength":2},"level":{"type":"string","enum":["country","region","county","municipality"]},"name":{"type":"string"},"parent_id":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","country","level","name","parent_id"],"additionalProperties":false},"description":"jednostki grup z przodkami (od kraju)"},"rows":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["record","post"]},"producer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string"},"country":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"unit_id":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"najgłębsza jednostka grupy (zwykle gmina), null = poza jednostkami"},"count":{"type":"integer","minimum":1,"maximum":9007199254740991},"lon":{"type":"number"},"lat":{"type":"number"}},"required":["kind","producer_id","category","country","unit_id","count","lon","lat"],"additionalProperties":false}}},"required":["generated_at","latest_seq","producers","categories","units","rows"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/producers":{"post":{"operationId":"createProducer","summary":"Dodaj producenta danych","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["producer","consumer","editor"]},"priority":{"default":0,"type":"integer","minimum":-100,"maximum":100}},"required":["name","kind"],"additionalProperties":false}}}},"responses":{"201":{"description":"utworzony","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"kind":{"type":"string","enum":["producer","consumer","editor"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","name","kind","priority","created_at","disabled_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"nazwa zajęta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listProducers","summary":"Lista producentów","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"responses":{"200":{"description":"lista","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"kind":{"type":"string","enum":["producer","consumer","editor"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","name","kind","priority","created_at","disabled_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/producers/{id}/keys":{"post":{"operationId":"createKey","summary":"Wydaj klucz API producentowi (token pokazywany raz)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"scopes":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["read","records:write","records:import","posts:write","posts:archive","admin","producers:activity"]}},"category_scope":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","maxLength":255,"pattern":"^[a-z0-9_]+(\\.[a-z0-9_]+)*$"}},"sandbox":{"default":false,"type":"boolean"},"limits":{"default":{},"type":"object","properties":{"requests_per_10s":{"type":"integer","minimum":1,"maximum":10000},"items_per_day":{"type":"integer","minimum":1,"maximum":10000000},"reads_per_min":{"type":"integer","minimum":1,"maximum":100000}},"additionalProperties":false}},"required":["scopes"],"additionalProperties":false}}}},"responses":{"201":{"description":"klucz wydany","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"producer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prefix":{"type":"string"},"label":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string","enum":["read","records:write","records:import","posts:write","posts:archive","admin","producers:activity"]}},"category_scope":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sandbox":{"type":"boolean"},"limits":{"type":"object","properties":{"requests_per_10s":{"type":"integer","minimum":1,"maximum":10000},"items_per_day":{"type":"integer","minimum":1,"maximum":10000000},"reads_per_min":{"type":"integer","minimum":1,"maximum":100000}},"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","producer_id","prefix","label","scopes","category_scope","sandbox","limits","created_at","revoked_at"],"additionalProperties":false},"token":{"type":"string","description":"Pokazywany tylko raz. W bazie zostaje wyłącznie sha256."}},"required":["key","token"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma producenta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listKeys","summary":"Klucze producenta (bez tokenów)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"lista","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"producer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prefix":{"type":"string"},"label":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string","enum":["read","records:write","records:import","posts:write","posts:archive","admin","producers:activity"]}},"category_scope":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sandbox":{"type":"boolean"},"limits":{"type":"object","properties":{"requests_per_10s":{"type":"integer","minimum":1,"maximum":10000},"items_per_day":{"type":"integer","minimum":1,"maximum":10000000},"reads_per_min":{"type":"integer","minimum":1,"maximum":100000}},"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","producer_id","prefix","label","scopes","category_scope","sandbox","limits","created_at","revoked_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma producenta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/producers/{id}:disable":{"post":{"operationId":"disableProducer","summary":"Wyłącz producenta (wszystkie jego klucze przestają działać)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"wyłączony","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"kind":{"type":"string","enum":["producer","consumer","editor"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","name","kind","priority","created_at","disabled_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma producenta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/producers/{id}:enable":{"post":{"operationId":"enableProducer","summary":"Włącz producenta z powrotem","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"włączony","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"kind":{"type":"string","enum":["producer","consumer","editor"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","name","kind","priority","created_at","disabled_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma producenta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/keys/{id}:revoke":{"post":{"operationId":"revokeKey","summary":"Unieważnij klucz (natychmiast w tym procesie)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"unieważniony","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"producer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prefix":{"type":"string"},"label":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string","enum":["read","records:write","records:import","posts:write","posts:archive","admin","producers:activity"]}},"category_scope":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sandbox":{"type":"boolean"},"limits":{"type":"object","properties":{"requests_per_10s":{"type":"integer","minimum":1,"maximum":10000},"items_per_day":{"type":"integer","minimum":1,"maximum":10000000},"reads_per_min":{"type":"integer","minimum":1,"maximum":100000}},"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","producer_id","prefix","label","scopes","category_scope","sandbox","limits","created_at","revoked_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/categories":{"post":{"operationId":"createCategory","summary":"Dodaj kategorię (bez deployu); schemat atrybutów jako wersja 1","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"parent":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"kind":{"type":"string","enum":["record","post"]},"labels":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":200}},"attributes_schema":{},"filters":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}},"display":{"default":{},"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9-]{1,64}$"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"layer":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"minzoom":{"type":"integer","minimum":0,"maximum":22},"cluster_below_z":{"type":"integer","minimum":0,"maximum":22}},"additionalProperties":false},"retention":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"personal_data":{"default":false,"type":"boolean"}},"required":["code","kind","labels"],"additionalProperties":false}}}},"responses":{"201":{"description":"utworzona","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"string"},"parent":{"type":["string","null"]},"kind":{"type":"string","enum":["record","post"]},"status":{"type":"string","enum":["active","deprecated"]},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attributes_schema":{"$ref":"#/$defs/__schema0"},"filters":{"type":"array","items":{"type":"string"}},"display":{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9-]{1,64}$"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"layer":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"minzoom":{"type":"integer","minimum":0,"maximum":22},"cluster_below_z":{"type":"integer","minimum":0,"maximum":22}},"additionalProperties":false},"retention":{"anyOf":[{"type":"object","properties":{"default_ttl_hours":{"type":"integer","minimum":1,"maximum":8760},"max_ttl_hours":{"type":"integer","minimum":1,"maximum":17520},"archive_days":{"default":30,"type":"integer","minimum":0,"maximum":365},"closing_states":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"}}},"required":["default_ttl_hours","max_ttl_hours","archive_days","closing_states"],"additionalProperties":false},{"type":"object","properties":{"stale_after_days":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false}]},"personal_data":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["code","path","parent","kind","status","labels","schema_version","attributes_schema","filters","display","retention","personal_data","version","updated_at"],"additionalProperties":false,"$defs":{"__schema0":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","integer","boolean","object","array"]},"description":{"type":"string"},"enum":{"type":"array","items":{"type":["string","number"]}},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}},"required":{"type":"array","items":{"type":"string"}},"items":{"$ref":"#/$defs/__schema0"},"minimum":{"type":"number"},"maximum":{"type":"number"},"maxLength":{"type":"number"},"maxItems":{"type":"number"},"format":{"type":"string","enum":["date","date-time","uri","email","e164","currency"]}},"required":["type"],"additionalProperties":false}}}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"kod zajęty","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"zły rodzic, filtry albo rodzaj","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/categories/{code}":{"patch":{"operationId":"updateCategory","summary":"Zmień kategorię; nowy schemat atrybutów tylko zgodny wstecz (nowa wersja)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":200}},"attributes_schema":{},"filters":{"maxItems":20,"type":"array","items":{"type":"string"}},"display":{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9-]{1,64}$"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"layer":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"minzoom":{"type":"integer","minimum":0,"maximum":22},"cluster_below_z":{"type":"integer","minimum":0,"maximum":22}},"additionalProperties":false},"retention":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string","enum":["active","deprecated"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"zmieniona","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"string"},"parent":{"type":["string","null"]},"kind":{"type":"string","enum":["record","post"]},"status":{"type":"string","enum":["active","deprecated"]},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attributes_schema":{"$ref":"#/$defs/__schema0"},"filters":{"type":"array","items":{"type":"string"}},"display":{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9-]{1,64}$"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"layer":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"minzoom":{"type":"integer","minimum":0,"maximum":22},"cluster_below_z":{"type":"integer","minimum":0,"maximum":22}},"additionalProperties":false},"retention":{"anyOf":[{"type":"object","properties":{"default_ttl_hours":{"type":"integer","minimum":1,"maximum":8760},"max_ttl_hours":{"type":"integer","minimum":1,"maximum":17520},"archive_days":{"default":30,"type":"integer","minimum":0,"maximum":365},"closing_states":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"}}},"required":["default_ttl_hours","max_ttl_hours","archive_days","closing_states"],"additionalProperties":false},{"type":"object","properties":{"stale_after_days":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false}]},"personal_data":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["code","path","parent","kind","status","labels","schema_version","attributes_schema","filters","display","retention","personal_data","version","updated_at"],"additionalProperties":false,"$defs":{"__schema0":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","integer","boolean","object","array"]},"description":{"type":"string"},"enum":{"type":"array","items":{"type":["string","number"]}},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}},"required":{"type":"array","items":{"type":"string"}},"items":{"$ref":"#/$defs/__schema0"},"minimum":{"type":"number"},"maximum":{"type":"number"},"maxLength":{"type":"number"},"maxItems":{"type":"number"},"format":{"type":"string","enum":["date","date-time","uri","email","e164","currency"]}},"required":["type"],"additionalProperties":false}}}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma kategorii","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"schemat niezgodny wstecz albo złe filtry","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/localities:batch":{"post":{"operationId":"upsertLocalitiesBatch","summary":"Zapisz wsad miejscowości (≤ 1000)","description":"Każda pozycja osobno: created|updated|unchanged|rejected; jednostki nadrzędne liczone z punktu, kraj z punktu albo z pozycji. Zła pozycja nie cofa innych.","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"minItems":1,"maxItems":1000,"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"responses":{"200":{"description":"wynik każdej pozycji","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"items":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["created","updated","unchanged","rejected"]},"id":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message","code"],"additionalProperties":false}}},"required":["index","status","id","issues"],"additionalProperties":false}}},"required":["counts","items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"klucz bez zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"ciało większe niż limit","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/dictionaries/{code}":{"put":{"operationId":"saveDictionary","summary":"Utwórz lub zmień słownik referencyjny","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Z]{2})?$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":200}},"entry_schema":{}},"required":["labels"],"additionalProperties":false}}}},"responses":{"200":{"description":"zapisany","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"entry_schema":{"$ref":"#/$defs/__schema0"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["code","labels","entry_schema","version","created_at","updated_at"],"additionalProperties":false,"$defs":{"__schema0":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","integer","boolean","object","array"]},"description":{"type":"string"},"enum":{"type":"array","items":{"type":["string","number"]}},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}},"required":{"type":"array","items":{"type":"string"}},"items":{"$ref":"#/$defs/__schema0"},"minimum":{"type":"number"},"maximum":{"type":"number"},"maxLength":{"type":"number"},"maxItems":{"type":"number"},"format":{"type":"string","enum":["date","date-time","uri","email","e164","currency"]}},"required":["type"],"additionalProperties":false}}}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"schemat niezgodny wstecz","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/dictionaries/{code}/entries:batch":{"post":{"operationId":"batchUpsertDictionaryEntries","summary":"Wsadowy zapis wpisów słownika (do 1000 pozycji)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"maxItems":1000,"type":"array","items":{}},{"type":"object","properties":{"items":{"maxItems":1000,"type":"array","items":{}}},"required":["items"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"wynik per pozycja: created | updated | unchanged | rejected z issues","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"status":{"type":"string","enum":["created","updated","unchanged","rejected"]},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["key","status"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma słownika","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"za duży wsad","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"ponad 1000 wpisów","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/dictionaries/{code}/entries/{key}":{"delete":{"operationId":"deleteDictionaryEntry","summary":"Usuń wpis ze słownika","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"usunięty","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"dictionary":{"type":"string"},"key":{"type":"string"}},"required":["ok","dictionary","key"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"nie ma słownika lub wpisu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/records/{id}":{"get":{"operationId":"getAdminRecord","summary":"Widok redaktora rekordu (każdy stan, blokady, pochodzenie pól i claims)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"rekord redaktora","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"producer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"external_id":{"type":"string"},"sandbox":{"type":"boolean"},"status":{"type":"string","enum":["draft","published","retired","merged"]},"merged_into":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"lang":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"geometry":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},{"type":"null"}]},"precision":{"anyOf":[{"type":"string","enum":["exact","approximate"]},{"type":"null"}]},"uncertainty_m":{"type":["number","null"]},"country_code":{"type":["string","null"]},"admin_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"intersects_unit_ids":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"contacts":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"opening_hours":{"anyOf":[{"type":"array","items":{}},{"type":"null"}]},"timezone":{"type":["string","null"]},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"locked_fields":{"type":"array","items":{"type":"string"}},"field_origin":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"producer_id":{"type":"string"},"kind":{"type":"string","enum":["producer","editor"]},"observed_at":{"type":"string"}},"required":["producer_id","kind","observed_at"],"additionalProperties":false}},"claims":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","names","lang","geometry","address","contacts","opening_hours","timezone","attributes"]},"producerId":{"type":"string"},"producer_id":{"type":"string"},"editor":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value":{},"observedAt":{"type":"string"},"observed_at":{"type":"string"}},"required":["field","editor","priority","value"],"additionalProperties":false}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","category_id","producer_id","external_id","sandbox","status","merged_into","name","lang","names","admin_unit_ids","intersects_unit_ids","attributes","schema_version","revision","locked_fields","field_origin","claims","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"editRecord","summary":"Edycja redaktora rekordu (zmiana pól, blokady i odblokowania)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"set":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300},"names":{"type":"object","propertyNames":{"type":"string","maxLength":35},"additionalProperties":{"type":"string","minLength":1,"maxLength":300}},"lang":{"type":"string","maxLength":35},"geometry":{"anyOf":[{"type":"object","properties":{"geometry":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiLineString"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"MultiPolygon"},"coordinates":{"minItems":1,"type":"array","items":{"minItems":1,"type":"array","items":{"minItems":4,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}}},"required":["type","coordinates"],"additionalProperties":false}]},"precision":{"type":"string","enum":["exact","approximate"]},"uncertainty_m":{"type":"number","minimum":0,"maximum":100000}},"required":["geometry"],"additionalProperties":false},{"type":"null"}]},"address":{"type":"object","properties":{"street":{"type":"string","minLength":1,"maxLength":200},"house_number":{"type":"string","minLength":1,"maxLength":30},"postal_code":{"type":"string","minLength":1,"maxLength":20},"locality":{"type":"string","minLength":1,"maxLength":200},"region":{"type":"string","minLength":1,"maxLength":200},"country_code":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"contacts":{"type":"object","properties":{"phones":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"emails":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"websites":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":2000,"format":"uri"}}},"additionalProperties":false},"opening_hours":{"maxItems":70,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"opens":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"closes":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["day","opens","closes"],"additionalProperties":false}},"timezone":{"type":"string"},"attributes":{}},"additionalProperties":false},"lock":{"type":"array","items":{"type":"string","enum":["name","names","lang","geometry","address","contacts","opening_hours","timezone","attributes"]}},"unlock":{"type":"array","items":{"type":"string","enum":["name","names","lang","geometry","address","contacts","opening_hours","timezone","attributes"]}},"note":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"wynik edycji","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","published","retired","merged"]},"changed":{"type":"boolean"},"locked_fields":{"type":"array","items":{"type":"string"}},"field_origin":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"producer_id":{"type":"string"},"kind":{"type":"string","enum":["producer","editor"]},"observed_at":{"type":"string"}},"required":["producer_id","kind","observed_at"],"additionalProperties":false}}},"required":["id","revision","status","changed"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"rekord scalony lub wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"niepoprawne dane lub atrybuty poza schematem kategorii","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/records/{id}:retire":{"post":{"operationId":"retireRecord","summary":"Wycofanie rekordu przez redaktora","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"rekord wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","published","retired","merged"]},"changed":{"type":"boolean"},"locked_fields":{"type":"array","items":{"type":"string"}},"field_origin":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"producer_id":{"type":"string"},"kind":{"type":"string","enum":["producer","editor"]},"observed_at":{"type":"string"}},"required":["producer_id","kind","observed_at"],"additionalProperties":false}}},"required":["id","revision","status","changed"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"rekord scalony lub wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/records/{id}:merge":{"post":{"operationId":"mergeRecord","summary":"Scalenie rekordu w inny rekord","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"into":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"note":{"type":"string","maxLength":2000}},"required":["into"],"additionalProperties":false}}}},"responses":{"200":{"description":"rekordy scalone","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","published","retired","merged"]},"changed":{"type":"boolean"},"locked_fields":{"type":"array","items":{"type":"string"}},"field_origin":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"producer_id":{"type":"string"},"kind":{"type":"string","enum":["producer","editor"]},"observed_at":{"type":"string"}},"required":["producer_id","kind","observed_at"],"additionalProperties":false}}},"required":["id","revision","status","changed"],"additionalProperties":false},"into":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","published","retired","merged"]},"changed":{"type":"boolean"},"locked_fields":{"type":"array","items":{"type":"string"}},"field_origin":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"producer_id":{"type":"string"},"kind":{"type":"string","enum":["producer","editor"]},"observed_at":{"type":"string"}},"required":["producer_id","kind","observed_at"],"additionalProperties":false}}},"required":["id","revision","status","changed"],"additionalProperties":false},"closedCases":{"type":"array","items":{"type":"string"}}},"required":["source","into","closedCases"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma rekordu źródła lub celu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"rekord scalony lub wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"scalenie z samym sobą, niezgodność sandbox lub kategorii","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/records/{id}/revisions":{"get":{"operationId":"getRecordRevisions","summary":"Historia rewizji rekordu (najnowsze najpierw)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"lista rewizji","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cause":{"type":"string","enum":["create","update","withdraw","edit","lock","unlock","merge","retire"]},"status":{"type":"string","enum":["draft","published","retired","merged"]},"producer_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"observation_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"edit_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"at":{"type":"string"}},"required":["revision","cause","status","producer_id","observation_id","edit_id","payload","at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-cases":{"get":{"operationId":"listReviewCases","summary":"Kolejka spraw do moderacji z filtrami i kursorem keyset","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["open","closed"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]}},{"name":"entity_type","in":"query","required":false,"schema":{"type":"string","enum":["record","post"]}},{"name":"entity_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2000}}],"responses":{"200":{"description":"lista spraw","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false}}}},"400":{"description":"niepoprawny kursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"openReviewCase","summary":"Dodanie sprawy przez redaktora (położenie do sprawdzenia, możliwy duplikat z listy przeglądu)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["possible_duplicate","geometry_review"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","entity_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"taka sprawa jest już otwarta","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}}}},"201":{"description":"sprawa otwarta","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}}}},"400":{"description":"niepoprawne ciało","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiego rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"rekord scalony albo wycofany","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"zły kandydat dla rodzaju sprawy","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-case-counts":{"get":{"operationId":"countReviewCases","summary":"Liczby otwartych spraw po rodzajach (liczniki kolejki)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"responses":{"200":{"description":"liczniki","content":{"application/json":{"schema":{"type":"object","properties":{"open":{"type":"object","properties":{"geometry_missing":{"type":"integer","minimum":0,"maximum":9007199254740991},"outside_any_admin_unit":{"type":"integer","minimum":0,"maximum":9007199254740991},"possible_duplicate":{"type":"integer","minimum":0,"maximum":9007199254740991},"stale_record":{"type":"integer","minimum":0,"maximum":9007199254740991},"geometry_review":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"],"additionalProperties":false}},"required":["open"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-cases/{id}":{"get":{"operationId":"getReviewCase","summary":"Szczegóły pojedynczej sprawy","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"sprawa","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiej sprawy","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-cases/{id}:accept":{"post":{"operationId":"acceptReviewCase","summary":"Zaakceptowanie sprawy (decyzja accepted)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"sprawa zaakceptowana","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiej sprawy","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"sprawa jest już zamknięta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-cases/{id}:reject":{"post":{"operationId":"rejectReviewCase","summary":"Odrzucenie sprawy (decyzja rejected)","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"sprawa odrzucona","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiej sprawy","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"sprawa jest już zamknięta","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/review-cases/{id}:merge":{"post":{"operationId":"mergeReviewCase","summary":"Scalenie rekordów ze sprawy duplikatu","tags":["admin"],"x-module":"admin","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"into":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"note":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"sprawa scalona","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","published","retired","merged"]},"changed":{"type":"boolean"},"locked_fields":{"type":"array","items":{"type":"string"}},"field_origin":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"producer_id":{"type":"string"},"kind":{"type":"string","enum":["producer","editor"]},"observed_at":{"type":"string"}},"required":["producer_id","kind","observed_at"],"additionalProperties":false}}},"required":["id","revision","status","changed"],"additionalProperties":false},"into":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","published","retired","merged"]},"changed":{"type":"boolean"},"locked_fields":{"type":"array","items":{"type":"string"}},"field_origin":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"producer_id":{"type":"string"},"kind":{"type":"string","enum":["producer","editor"]},"observed_at":{"type":"string"}},"required":["producer_id","kind","observed_at"],"additionalProperties":false}}},"required":["id","revision","status","changed"],"additionalProperties":false},"closedCases":{"type":"array","items":{"type":"string"}},"case":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["geometry_missing","outside_any_admin_unit","possible_duplicate","stale_record","geometry_review"]},"entity_type":{"type":"string","enum":["record","post"]},"entity_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidate_type":{"anyOf":[{"type":"string","enum":["record","post"]},{"type":"null"}]},"candidate_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"state":{"type":"string","enum":["open","closed"]},"decision":{"anyOf":[{"type":"string","enum":["accepted","rejected","merged","resolved"]},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"type":"string"},"closed_at":{"type":["string","null"]}},"required":["id","kind","entity_type","entity_id","candidate_type","candidate_id","details","state","decision","decided_by","note","created_at","closed_at"],"additionalProperties":false}},"required":["source","into","closedCases"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"brak klucza","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"brak zakresu admin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"nie ma takiej sprawy lub rekordu","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"sprawa jest już zamknięta lub rekord scalony","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"zły rodzaj sprawy lub brak kandydata","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health":{"get":{"operationId":"health","summary":"Proces żyje (bez bazy)","tags":["ops"],"x-module":"ops","parameters":[],"responses":{"200":{"description":"żyje","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"service":{"type":"string","const":"data-provider"},"version":{"type":"string"}},"required":["status","service","version"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health/ready":{"get":{"operationId":"healthReady","summary":"Gotowość: baza odpowiada, migracje zastosowane (szczegóły: /health/details)","tags":["ops"],"x-module":"ops","parameters":[],"responses":{"200":{"description":"gotowy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"migrations":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count"],"additionalProperties":false},"modules":{"type":"object","properties":{"enabled":{"type":"array","items":{"type":"string"}},"disabled":{"type":"array","items":{"type":"string"}}},"required":["enabled","disabled"],"additionalProperties":false}},"required":["status","migrations","modules"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"baza niedostępna","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/health/details":{"get":{"operationId":"healthDetails","summary":"Wersje bazy i rozszerzeń, ostatnia migracja, moduły","tags":["ops"],"x-module":"ops","security":[{"bearer":[]}],"x-required-scope":"admin","parameters":[],"responses":{"200":{"description":"szczegóły","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"database":{"type":"object","properties":{"postgres":{"type":"string"},"postgis":{"type":"string"},"extensions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["postgres","postgis","extensions"],"additionalProperties":false},"migrations":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last":{"type":["string","null"]}},"required":["count","last"],"additionalProperties":false},"modules":{"type":"object","properties":{"enabled":{"type":"array","items":{"type":"string"}},"disabled":{"type":"array","items":{"type":"string"}}},"required":["enabled","disabled"],"additionalProperties":false}},"required":["version","database","migrations","modules"],"additionalProperties":false}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"baza niedostępna","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/openapi.json":{"get":{"operationId":"openApi","summary":"Specyfikacja OpenAPI 3.1 (generowana z kontraktów zod)","tags":["ops"],"x-module":"ops","parameters":[],"responses":{"200":{"description":"specyfikacja","content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/docs":{"get":{"operationId":"docs","summary":"Przekierowanie na dokumentację API (/api-docs)","tags":["ops"],"x-module":"ops","parameters":[],"responses":{"301":{"description":"przekierowanie na /api-docs"},"400":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"błąd","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"details":{"type":"object","properties":{"floor":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["floor","head"],"additionalProperties":false}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Klucz API od administratora."}}}}