{"openapi":"3.1.0","info":{"title":"Sortyra API","version":"1.2.0","description":"REST API nad rovnakou servisnou vrstvou ako aplikácia a MCP: úplná správa zdrojov, výstupov (project), pravidiel, stromu kategórií a nastavení. Autorizácia: Authorization: Bearer <API kľúč>. Rozsah read = čítanie, write = úpravy, admin = úplná správa (len vlastník). Kľúč nemá viac práv ako jeho autor. Každá zmena sa zapíše do Histórie zmien s autorom API."},"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Text chyby v jazyku podľa hlavičky Accept-Language (predvolene angličtina; jazyk odpovede v hlavičke Content-Language)."},"issues":{"type":"array","description":"Pri 422 z overenia vstupu: chybné polia.","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}},"scope":{"type":"string","enum":["read","write","admin"],"description":"Pri 403: potrebný rozsah kľúča."}},"required":["error"]},"Rule":{"type":"object","description":"Pravidlo podľa ADR 0002 (type, target, when …)","additionalProperties":true},"SourceCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","format":"uri"},"idField":{"description":"Field with the unique ID of an item; without it, as proposed by POST /sources/inspect.","type":"string"},"mapping":{"description":"Overrides the proposed mapping for the listed canonical fields, e.g. {\"NAME\":[\"PRODUCTNAME\"]}.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"minItems":1,"type":"array","items":{"type":"string"}}},"updatesPerDay":{"default":4,"description":"Downloads per day (1–24, 48 or 96, depending on the plan).","type":"integer","minimum":1,"maximum":96},"priority":{"type":"integer","minimum":0,"maximum":100},"projectIds":{"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)$"}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"codePrefix":{"type":"string","maxLength":20,"pattern":"^[A-Za-z0-9._-]*$"},"defaultManufacturer":{"type":"string","maxLength":100}},"required":["name","url"]},"SourcePatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","format":"uri"},"updatesPerDay":{"type":"integer","minimum":1,"maximum":96},"times":{"description":"Exact download times HH:MM (local time); [] = spread evenly according to updatesPerDay.","maxItems":24,"type":"array","items":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"priority":{"type":"integer","minimum":-100,"maximum":100},"enabled":{"type":"boolean"},"defaultManufacturer":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"parentField":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"codePrefix":{"description":"Product code prefix – changes the codes in the online store.","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"b2bOnly":{"type":"boolean"},"stockBuffer":{"type":"integer","minimum":0,"maximum":1000}}},"SourceInputPatch":{"type":"object","properties":{"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"fxRate":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"priceDecimals":{"anyOf":[{"type":"integer","minimum":0,"maximum":2},{"type":"null"}]},"vatRate":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"decimal":{"anyOf":[{"type":"string","enum":["comma","dot"]},{"type":"null"}]},"dateFormat":{"anyOf":[{"type":"string","enum":["dmy","mdy","ymd"]},{"type":"null"}]},"weightFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"stockSubtract":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"null"}]},"excludeCategories":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"allowedBrands":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"blockedItems":{"maxItems":20000,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"hideFlags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"maxPrice":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"skipZeroPurchase":{"type":"boolean"},"requireApproval":{"type":"boolean"}}},"OutputCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"channel":{"type":"string","pattern":"^([a-z-]{2,20}|cat:[a-z0-9-]{1,40}|def-(xml|csv):[a-z0-9][a-z0-9-]{1,40})$","description":"shoptet, heureka, google, zbozi, glami, ceneo, custom-xml, custom-csv, cat:<channel from the catalogue> or def-xml:/def-csv:<channel defined by the operator>"},"sourceIds":{"minItems":1,"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)$"}},"locale":{"description":"Output language (target of translations, channel taxonomy variant); Czech: cz (alias of cs).","type":"string","enum":["bg","cs","da","de","el","en","es","et","fi","fr","ga","hr","hu","it","lt","lv","mt","nl","pl","pt","ro","sk","sl","sv","cz"]},"dedupe":{"default":true,"description":"Merge the same product from several suppliers (by EAN, then by code).","type":"boolean"}},"required":["name","channel","sourceIds"]},"OutputPatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"sourceIds":{"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)$"}},"locale":{"type":"string","enum":["bg","cs","da","de","el","en","es","et","fi","fr","ga","hr","hu","it","lt","lv","mt","nl","pl","pt","ro","sk","sl","sv","cz"]},"enabled":{"type":"boolean"},"dropThresholdPct":{"type":"integer","minimum":5,"maximum":100},"dedupe":{"type":"boolean"},"dedupePriority":{"description":"Order of preference for choosing the winning offer among duplicates.","minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["in_stock","cheapest","cheapest_purchase","preferred","fastest"]}},"dedupeStock":{"description":"winner = stock of the winning offer, sum = total stock.","type":"string","enum":["winner","sum"]},"dedupeMaxSpreadPct":{"description":"If the prices differ by more than this percentage, the group is not merged; 0 = always merge.","type":"integer","minimum":0,"maximum":1000}}},"OutputOptionsPatch":{"type":"object","properties":{"options":{"type":"object","propertyNames":{"type":"string","enum":["currency","country","fileName","gzip","stockSharePct","updateScope","placeholderImage","unassigned","allowNoPrice","blockedItems","b2b","workingDays","fxLockPct","unitFromName","linkCheck","includeOutOfStock","variants","sanitizeCodes","title","link","recomputeTimes","shipping","extraTags","fxRates","autoUpscale","themeCategories"]},"additionalProperties":{},"description":"Only the options to change; null = clear the option (current values: GET /projects/{id}/options)."}},"required":["options"]},"OutputMapping":{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":200},"additionalProperties":{"type":"string","maxLength":500},"description":"Channel field → product field (NAME, PRICE_VAT…), attribute (PARAM:Colour) or template (%CODE%-%EAN%)."},"refreshDefinition":{"type":"boolean"}},"required":["mapping"]},"RulePatch":{"type":"object","properties":{"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"enabled":{"type":"boolean"},"sourceId":{"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"}]},"groupName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}}},"RuleOrder":{"type":"object","properties":{"projectId":{"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)$"},"ruleIds":{"minItems":1,"maxItems":1000,"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":["projectId","ruleIds"]},"ShopTreePut":{"type":"object","properties":{"paths":{"minItems":1,"maxItems":20000,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Paths 'A > B > C' (parent categories are added automatically) or 'type;path' – type secondary = secondary tree."},"projectId":{"description":"Output with its own category tree: its tree is replaced; without it, the shared tree.","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":["paths"]},"ChannelCategoryPut":{"type":"object","properties":{"shopPath":{"type":"string","minLength":1},"taxonomy":{"type":"string","minLength":2},"externalId":{"description":"Channel category ID (GET /categories/taxonomy); null = remove the assignment.","type":["string","null"]},"feedProjectId":{"description":"Only for this output (overrides the shared assignment); without it, shared by all outputs.","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":["shopPath","taxonomy","externalId"]},"ProposalApply":{"type":"object","properties":{"sourceId":{"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)$"},"supplierCategory":{"type":"string","maxLength":500},"path":{"type":"string","minLength":1,"maxLength":500},"createCategory":{"default":false,"type":"boolean"},"projectId":{"description":"Only products of this output; the mapping is saved for this output only. Without it, shared.","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":["sourceId","supplierCategory","path"]},"SupplierCategoryPut":{"type":"object","properties":{"sourceId":{"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"}],"description":"Source (supplier); null = for all suppliers."},"sourceCategory":{"type":"string","minLength":1,"maxLength":500,"description":"Supplier category exactly as in the feed."},"targetPath":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"Path in the shop category tree 'A > B > C'; null = no target category."},"extraPaths":{"description":"Additional categories (omitted = unchanged).","maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"feedProjectId":{"description":"Scope: output ID = only for this output (overrides the shared setting); null or omitted = shared setting for all outputs.","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"}]}},"required":["sourceId","sourceCategory","targetPath"]},"OutputProductCategoryPut":{"type":"object","properties":{"productIds":{"minItems":1,"maxItems":1000,"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)$"}},"path":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"Shop tree category for this output only; null = return the products to the shared categorisation."}},"required":["productIds","path"]},"ChannelMappingStart":{"type":"object","properties":{"projectId":{"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)$","description":"Output whose shop categories are mapped."},"taxonomy":{"type":"string","minLength":2,"description":"google, heureka-sk, heureka-cz, zbozi, glami-sk…"},"feedProjectId":{"description":"Scope: output ID = only for this output (overrides the shared setting); null or omitted = shared setting for all outputs.","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"}]},"force":{"default":false,"description":"Start again from scratch: unconfirmed automatic decisions are discarded (manual assignments are kept).","type":"boolean"}},"required":["projectId","taxonomy"]}},"responses":{"Unauthorized":{"description":"Chýba alebo je neplatný API kľúč.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PlanRequired":{"description":"REST API nie je v tarife alebo predplatné skončilo.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Kľúč nemá potrebný rozsah (pole scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Záznam neexistuje alebo k nemu kľúč nemá prístup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Invalid":{"description":"Neplatná požiadavka (pole issues pri chybe vstupu).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Príliš veľa požiadaviek – skúste to o minútu (hlavička retry-after).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"security":[{"apiKey":[]}],"paths":{"/projects":{"get":{"operationId":"listProjects","summary":"Výstupy (projekty)","x-scope":"read","description":"Kanál, počet produktov, posledný export a adresa feedu. Rozsah kľúča: read.","responses":{"200":{"description":"Zoznam výstupov"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createProject","summary":"Vytvoriť výstup","x-scope":"admin","description":"Nový výstup (feed) pre kanál zo zdrojov. Rozsah kľúča: admin.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputCreate"}}}},"responses":{"201":{"description":"{ projectId, feedUrl }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{id}":{"get":{"operationId":"getProject","summary":"Detail výstupu s voľbami","x-scope":"read","description":"Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"responses":{"200":{"description":"Výstup a options"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateProject","summary":"Upraviť výstup","x-scope":"admin","description":"Názov, zdroje, jazyk, zapnutie, prah prepadu, deduplikácia; mení sa len zadané a výstup sa prepočíta. Rozsah kľúča: admin.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputPatch"}}}},"responses":{"200":{"description":"{ updated: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteProject","summary":"Zmazať výstup","x-scope":"admin","description":"Výstup ide do koša (obnoviteľný v Histórii zmien); feed sa prestane zverejňovať. Rozsah kľúča: admin.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"},{"name":"confirmName","in":"query","required":true,"schema":{"type":"string"},"description":"Presný názov výstupu na potvrdenie."}],"responses":{"200":{"description":"{ deleted: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{id}/options":{"get":{"operationId":"getProjectOptions","summary":"Nastavenia výstupu","x-scope":"read","description":"Mena, krajina, názov súboru, GZIP, doprava, časy prepočtu… a adresa feedu. Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"responses":{"200":{"description":"{ feedUrl, options }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateProjectOptions","summary":"Zmeniť nastavenia výstupu","x-scope":"admin","description":"Mení len zadané voľby (null = zrušiť); výstup sa prepočíta. Rozsah kľúča: admin.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputOptionsPatch"}}}},"responses":{"200":{"description":"{ feedUrl, options } po zmene"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{id}/mapping":{"put":{"operationId":"saveProjectMapping","summary":"Naparovanie polí výstupu","x-scope":"write","description":"Pre kanály s vlastnou štruktúrou: pole kanála → pole produktu, parameter alebo šablóna. Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputMapping"}}}},"responses":{"200":{"description":"{ unmappedRequired }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{id}/categories":{"get":{"operationId":"outputCategories","summary":"Vlastné nastavenia kategórií výstupu","x-scope":"read","description":"Mapovania kategórií dodávateľov, kategórií kanála a produkty s kategóriou len pre tento výstup (prepisujú spoločné nastavenie). Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"responses":{"200":{"description":"{ supplierMaps, channelMaps, products, counts }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{id}/categories/products":{"put":{"operationId":"setOutputProductCategory","summary":"Kategória produktov len pre výstup","x-scope":"write","description":"Nastaví vybraným produktom kategóriu stromu e-shopu len v tomto výstupe (prepíše spoločné zaradenie, mapovanie aj pravidlá; kategória kanála sa namapuje z nej). path null = späť na spoločné zaradenie. Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputProductCategoryPut"}}}},"responses":{"200":{"description":"{ products } – počet zmenených produktov"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{id}/run":{"post":{"operationId":"runProject","summary":"Spustiť prepočet a export","x-scope":"write","description":"Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"responses":{"202":{"description":"Zaradené"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{id}/visuals":{"get":{"operationId":"listVisualRules","summary":"Automatické úpravy vizuálov výstupu","x-scope":"read","description":"Pravidlá (šablóna podľa podmienky), pravidlá kanála pre text na obrázku a počty vizuálov. Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"responses":{"200":{"description":"{ policy, rules, stats }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createVisualRule","summary":"Nová automatická úprava","x-scope":"write","description":"Šablóna alebo úprava fotky pre produkty, ktoré spĺňajú podmienku (aj nové produkty). Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID výstupu"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","nullable":true},"action":{"type":"string","enum":["template","remove_bg","white_bg","upscale","review"]},"enabled":{"type":"boolean"},"name":{"type":"string"},"condition":{"type":"object","description":"Podmienka v tvare podmienok pravidiel."},"folderId":{"type":"string","format":"uuid","nullable":true},"photoState":{"type":"string","enum":["none","small","broken","transparent","text","ok"],"nullable":true},"newDays":{"type":"integer","nullable":true},"activeFrom":{"type":"string","format":"date-time","nullable":true},"activeUntil":{"type":"string","format":"date-time","nullable":true},"placement":{"type":"string","enum":["main","additional"]}}}}}},"responses":{"200":{"description":"{ id }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/visuals/templates":{"get":{"operationId":"listVisualTemplates","summary":"Šablóny a rámy vizuálov","x-scope":"read","description":"Knižnica organizácie bez archivovaných. Rozsah kľúča: read.","responses":{"200":{"description":"{ templates }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/visuals/rules/{ruleId}":{"patch":{"operationId":"updateVisualRule","summary":"Upraviť alebo zapnúť/vypnúť automatickú úpravu","x-scope":"write","description":"Rozsah kľúča: write.","parameters":[{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID automatickej úpravy"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","nullable":true},"action":{"type":"string","enum":["template","remove_bg","white_bg","upscale","review"]},"enabled":{"type":"boolean"},"name":{"type":"string"},"condition":{"type":"object","description":"Podmienka v tvare podmienok pravidiel."},"folderId":{"type":"string","format":"uuid","nullable":true},"photoState":{"type":"string","enum":["none","small","broken","transparent","text","ok"],"nullable":true},"newDays":{"type":"integer","nullable":true},"activeFrom":{"type":"string","format":"date-time","nullable":true},"activeUntil":{"type":"string","format":"date-time","nullable":true},"placement":{"type":"string","enum":["main","additional"]}}}}}},"responses":{"200":{"description":"{ ok }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteVisualRule","summary":"Zmazať automatickú úpravu","x-scope":"write","description":"Produkty sa vrátia na pôvodné fotky. Rozsah kľúča: write.","parameters":[{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID automatickej úpravy"}],"responses":{"200":{"description":"{ ok }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sources":{"get":{"operationId":"listSources","summary":"Zdroje","x-scope":"read","description":"Stav, počet produktov, plán aktualizácií, posledná chyba; tajné časti adries sú skryté. Rozsah kľúča: read.","responses":{"200":{"description":"Zoznam zdrojov"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createSource","summary":"Pridať zdroj","x-scope":"write","description":"Feed z adresy s navrhnutým mapovaním (voliteľne upraveným) – hneď sa stiahne na pozadí. Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceCreate"}}}},"responses":{"201":{"description":"{ sourceId, idField, mapped, queued }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sources/inspect":{"post":{"operationId":"inspectSource","summary":"Náhľad feedu pred pridaním","x-scope":"write","description":"Formát, polia s vyplnenosťou a navrhnuté mapovanie. Nič neuloží. Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"{ format, sampled, idField, currency, mapping, fields, params }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sources/{id}":{"get":{"operationId":"getSource","summary":"Detail zdroja","x-scope":"read","description":"Mapovanie, plán sťahovania, stav; tajné časti adresy sú skryté. Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID zdroja"}],"responses":{"200":{"description":"Zdroj"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateSource","summary":"Upraviť zdroj","x-scope":"write","description":"Mení len zadané vlastnosti; voľby null/\"\"/false/0 sa zrušia. Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID zdroja"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourcePatch"}}}},"responses":{"200":{"description":"{ ok: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteSource","summary":"Zmazať zdroj","x-scope":"admin","description":"Zdroj ide do koša (obnoviteľný v Histórii zmien) a zmizne z výstupov. Rozsah kľúča: admin.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID zdroja"}],"responses":{"200":{"description":"{ deleted: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sources/{id}/fetch":{"post":{"operationId":"fetchSource","summary":"Stiahnuť zdroj teraz","x-scope":"write","description":"Najviac raz za 15 minút na zdroj. Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID zdroja"}],"responses":{"202":{"description":"{ queued }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sources/{id}/runs":{"get":{"operationId":"sourceRuns","summary":"História sťahovaní zdroja","x-scope":"read","description":"Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID zdroja"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Behy: výsledok, počty, trvanie, chyba"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sources/{id}/input":{"get":{"operationId":"getSourceInput","summary":"Úpravy zdroja pri načítaní","x-scope":"read","description":"Mena, kurz, DPH, zápis čísel, vylúčenia, povolené značky, cenový strop, schvaľovanie nových produktov. Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID zdroja"}],"responses":{"200":{"description":"Voľby"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateSourceInput","summary":"Zmeniť úpravy zdroja pri načítaní","x-scope":"write","description":"Mení len zadané voľby (null = vypnúť, [] = vyprázdniť); výstupy sa prepočítajú. Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID zdroja"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceInputPatch"}}}},"responses":{"200":{"description":"{ ok: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/products":{"get":{"operationId":"listProducts","summary":"Produkty výstupu po pravidlách","x-scope":"read","description":"Rozsah kľúča: read.","parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["visible","hidden","no_ean","no_category","locked","warnings"]}},{"name":"sourceId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":500}},{"name":"offset","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"{ total, items }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateProducts","summary":"Ručná úprava (zámok pred pravidlami)","x-scope":"write","description":"Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productIds","field"],"properties":{"productIds":{"type":"array","items":{"type":"string","format":"uuid"}},"field":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"locked":{"type":"boolean"},"projectId":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Uložené"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/products/{id}":{"get":{"operationId":"getProduct","summary":"Detail produktu (vstup, výstup, úpravy, história, stopa)","x-scope":"read","description":"Rozsah kľúča: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID produktu"},{"name":"projectId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Detail"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/rules":{"get":{"operationId":"listRules","summary":"Reťazec pravidiel","x-scope":"read","description":"Rozsah kľúča: read.","parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Pravidlá v poradí vykonania"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createRule","summary":"Vytvoriť pravidlo","x-scope":"write","description":"Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","rule"],"properties":{"projectId":{"type":"string","format":"uuid"},"rule":{"$ref":"#/components/schemas/Rule"},"sourceId":{"type":"string","format":"uuid"}}}}}},"responses":{"201":{"description":"{ ruleId }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/rules/{id}":{"patch":{"operationId":"updateRule","summary":"Upraviť pravidlo","x-scope":"write","description":"Definícia (rule), zapnutie, obmedzenie na zdroj alebo skupina; výstup sa prepočíta. Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID pravidla"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulePatch"}}}},"responses":{"200":{"description":"{ ruleId }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteRule","summary":"Zmazať pravidlo","x-scope":"write","description":"Verzia ostane v histórii pravidiel. Rozsah kľúča: write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"ID pravidla"}],"responses":{"200":{"description":"{ deleted: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/rules/order":{"put":{"operationId":"reorderRules","summary":"Poradie pravidiel","x-scope":"write","description":"Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleOrder"}}}},"responses":{"200":{"description":"{ ok: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/rules/dry-run":{"post":{"operationId":"dryRunRules","summary":"Skúšobný beh navrhovaných pravidiel","x-scope":"read","description":"Nič neuloží. Rozsah kľúča: read.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","rules"],"properties":{"projectId":{"type":"string","format":"uuid"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}},"sourceId":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"{ total, changed, hidden, byField, examples }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/categories/tree":{"get":{"operationId":"getShopTree","summary":"Strom kategórií e-shopu","x-scope":"read","description":"Vlastný nahratý strom, inak naučený z produktov. S projectId strom, ktorý výstup používa (vlastný strom výstupu, inak spoločný). Rozsah kľúča: read.","parameters":[{"name":"projectId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Výstup (voliteľné)."}],"responses":{"200":{"description":"{ paths }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"operationId":"putShopTree","summary":"Nahradiť strom kategórií","x-scope":"admin","description":"Rozhodnutia s cestou, ktorá v novom strome nie je, sa zmažú a produkty sa zaradia znova. Rozsah kľúča: admin.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopTreePut"}}}},"responses":{"200":{"description":"{ paths } – počet ciest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/categories/channel":{"get":{"operationId":"channelCategories","summary":"Kategórie kanála pre výstup","x-scope":"read","description":"Kategórie e-shopu vo výstupe s počtom produktov: own (priradená kategória kanála; status auto = automaticky s istotou, confirmed = ručne), inherited (z nadradenej kategórie), ai (stav auto | review | unsuitable | none, istota, druh výrobku, krátky dôvod, najviac 3 návrhy) a suggestions. Rozsah kľúča: read.","parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taxonomy","in":"query","required":true,"schema":{"type":"string"},"description":"google, heureka-sk, heureka-cz, zbozi, glami-sk…"},{"name":"feedProjectId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Rozsah: ID výstupu = aj priradenia len pre tento výstup; bez neho spoločné."}],"responses":{"200":{"description":"Riadky mapovania"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"operationId":"setChannelCategory","summary":"Priradiť kategóriu kanála","x-scope":"write","description":"Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCategoryPut"}}}},"responses":{"200":{"description":"{ saved: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/categories/supplier":{"get":{"operationId":"supplierCategories","summary":"Kategórie dodávateľov a ich mapovanie","x-scope":"read","description":"Kategórie dodávateľov vo výstupe s počtom produktov, výsledkom po pravidlách, počtom nezaradených, mapovaním na strom e-shopu (s feedProjectId aj mapovania len pre daný výstup, map.feed: true) a návrhom na potvrdenie. Rozsah kľúča: read.","parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"feedProjectId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Rozsah: ID výstupu = aj vlastné mapovania výstupu; bez neho spoločné."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":200}}],"responses":{"200":{"description":"Riadky { sourceId, sourceName, category, products, resultPath, unassigned, map, suggestion }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"operationId":"setSupplierCategory","summary":"Mapovať kategóriu dodávateľa","x-scope":"write","description":"Kategória dodávateľa → kategória stromu e-shopu, spoločne alebo s feedProjectId len pre jeden výstup (prepíše spoločné). Uložené ID kategórií kanálov ostanú; kategória musí byť v strome e-shopu. Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierCategoryPut"}}}},"responses":{"200":{"description":"{ saved: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/categories/scope":{"get":{"operationId":"categoryScope","summary":"Vlastné nastavenia kategórií výstupov","x-scope":"read","description":"Pre každý výstup počet vlastných nastavení kategórií (mapovania dodávateľov, kategórie kanála, produkty) a stav mapovania na taxonómiu jeho kanála (taxonomy null = kanál bez taxonómie). Rozsah kľúča: read.","responses":{"200":{"description":"[{ projectId, name, channel, taxonomy, supplierMaps, channelMaps, products, total, channelStatus }]"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/categories/channel/ai":{"get":{"operationId":"channelMappingProgress","summary":"Priebeh automatického mapovania na kanál","x-scope":"read","description":"Kategórie e-shopu výstupu podľa stavu: human (ručne), auto (automaticky), review (návrh na kontrolu), unsuitable (do kanála nepatrí), none (kanál nemá vhodnú kategóriu), waiting; pozastavenie a samostatný výstup pre kanál. Rozsah kľúča: read.","parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taxonomy","in":"query","required":true,"schema":{"type":"string"}},{"name":"feedProjectId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Rozsah: ID výstupu; bez neho spoločné."}],"responses":{"200":{"description":"{ total, human, auto, review, unsuitable, none, waiting, irrelevant, paused, output }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"startChannelMapping","summary":"Spustiť automatické mapovanie na kanál","x-scope":"write","description":"Namapuje kategórie e-shopu výstupu na taxonómiu kanála na pozadí; ručné priradenia sa neprepíšu. Isté priradenia sa použijú hneď, ostatné ostanú ako návrh (GET /categories/channel, pole ai). Vyžaduje pripojenú AI. Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelMappingStart"}}}},"responses":{"202":{"description":"{ queued: true }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/categories/taxonomy":{"get":{"operationId":"searchTaxonomy","summary":"Hľadať v taxonómii kanála","x-scope":"read","description":"Rozsah kľúča: read.","parameters":[{"name":"tree","in":"query","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2}},{"name":"locale","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"[{ id, path }]"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/categories/proposals":{"get":{"operationId":"categoryProposals","summary":"Návrhy kategórií podľa kategórií dodávateľa","x-scope":"read","description":"Nezaradené produkty zoskupené podľa zdroja a kategórie dodávateľa s návrhom kategórie stromu. Rozsah kľúča: read.","parameters":[{"name":"sourceId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}}],"responses":{"200":{"description":"{ total, groups, proposals }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"applyCategoryProposal","summary":"Zaradiť kategóriu dodávateľa","x-scope":"write","description":"Zaradí nezaradené produkty skupiny a zapamätá si to pre nové produkty; createCategory vyžaduje rozsah admin. Rozsah kľúča: write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalApply"}}}},"responses":{"200":{"description":"{ products, created }"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}}}