{"openapi":"3.1.0","info":{"title":"GEREQ Security API","version":"1.0.0","summary":"Management va\u0161ich security web\u016f p\u0159es Platform API kl\u00ed\u010d.","description":"API jen pro **GEREQ Security** \u2014 spr\u00e1va web\u016f z CMS \/ pluginu.\n\n**Izolace:** s Platform API kl\u00ed\u010dem (`sig_` + `pt_`) vid\u00edte a spravujete **jen weby sv\u00e9 organizace**. Ciz\u00ed weby endpointy nevrac\u00ed (404).\n\nSnippety widget\u016f (`pk_`) jsou v odpov\u011bdi u webu; runtime endpointy v t\u00e9to dokumentaci nejsou.\n\nOpenAPI: `https:\/\/gereq.cz\/bezpecnost-webu\/api\/openapi.json`","contact":{"name":"GEREQ","url":"https:\/\/gereq.cz\/kontakt","email":"hello@gereq.cz"}},"servers":[{"url":"https:\/\/gereq.cz","description":"Aktu\u00e1ln\u00ed host"}],"tags":[{"name":"Management","description":"Jen weby organizace napojen\u00e9 na v\u00e1\u0161 Platform API kl\u00ed\u010d"},{"name":"Widgety","description":"JS loadery (ve\u0159ejn\u00e9 URL ze snippet\u016f)"}],"paths":{"\/api\/security\/sites":{"get":{"tags":["Management"],"operationId":"listSecuritySites","summary":"Va\u0161e security weby","description":"Vr\u00e1t\u00ed **jen** weby organizace napojen\u00e9 na autentizovan\u00fd kl\u00ed\u010d. \u017d\u00e1dn\u00fd glob\u00e1ln\u00ed katalog.","security":[{"PlatformApiKey":[]}],"responses":{"200":{"description":"Weby va\u0161\u00ed organizace","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/SecuritySite"}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"tags":["Management"],"operationId":"createSecuritySite","summary":"Vytvo\u0159it web ve va\u0161\u00ed organizaci","description":"Web vznikne pod organizac\u00ed kl\u00ed\u010de. Secret (`sk_`) se vr\u00e1t\u00ed **jen jednou**.","security":[{"PlatformApiKey":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SecuritySiteWrite"}}}},"responses":{"201":{"description":"Web vytvo\u0159en","content":{"application\/json":{"schema":{"type":"object","properties":{"site":{"$ref":"#\/components\/schemas\/SecuritySiteCreated"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"422":{"$ref":"#\/components\/responses\/ValidationError"}}}},"\/api\/security\/sites\/{id}":{"parameters":[{"$ref":"#\/components\/parameters\/SiteId"}],"get":{"tags":["Management"],"operationId":"getSecuritySite","summary":"Detail va\u0161eho webu","description":"Funguje jen pro web va\u0161\u00ed organizace. Ciz\u00ed `id` \u2192 404.","security":[{"PlatformApiKey":[]}],"responses":{"200":{"description":"Detail va\u0161eho webu","content":{"application\/json":{"schema":{"type":"object","properties":{"site":{"$ref":"#\/components\/schemas\/SecuritySite"}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"patch":{"tags":["Management"],"operationId":"updateSecuritySite","summary":"Upravit v\u00e1\u0161 web","description":"Jen web va\u0161\u00ed organizace.","security":[{"PlatformApiKey":[]}],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SecuritySitePatch"}}}},"responses":{"200":{"description":"Ulo\u017eeno","content":{"application\/json":{"schema":{"type":"object","properties":{"site":{"$ref":"#\/components\/schemas\/SecuritySite"}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationError"}}},"delete":{"tags":["Management"],"operationId":"deleteSecuritySite","summary":"Smazat v\u00e1\u0161 web","description":"Jen web va\u0161\u00ed organizace.","security":[{"PlatformApiKey":[]}],"responses":{"200":{"description":"Smaz\u00e1no","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/security\/sites\/{id}\/rotate-secret":{"post":{"tags":["Management"],"operationId":"rotateSecuritySiteSecret","summary":"P\u0159egenerovat secret (sk_) va\u0161eho webu","description":"Jen web va\u0161\u00ed organizace. Nov\u00fd secret se vr\u00e1t\u00ed jednou.","security":[{"PlatformApiKey":[]}],"parameters":[{"$ref":"#\/components\/parameters\/SiteId"}],"responses":{"200":{"description":"Nov\u00fd secret (jen jednou)","content":{"application\/json":{"schema":{"type":"object","properties":{"site":{"$ref":"#\/components\/schemas\/SecuritySiteCreated"}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/security\/activity":{"options":{"tags":["Management"],"operationId":"optionsSecurityActivity","summary":"CORS preflight pro aktivity","responses":{"204":{"description":"OK"}}},"get":{"tags":["Management"],"operationId":"listSecurityActivity","summary":"Security aktivity (eventy) va\u0161ich web\u016f","description":"Beacon\/assess eventy. Filtr `security_site_id`, `action`, `from`, `to`. Alias: `\/api\/security\/activities`.","security":[{"PlatformApiKey":[]}],"parameters":[{"name":"security_site_id","in":"query","schema":{"type":"integer"}},{"name":"action","in":"query","schema":{"type":"string","enum":["allow","challenge","block"]}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Str\u00e1nkovan\u00fd seznam","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/SecurityActivity"}},"meta":{"$ref":"#\/components\/schemas\/PaginationMeta"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"}}},"post":{"tags":["Management"],"operationId":"createSecurityActivity","summary":"Vytvo\u0159it aktivitu","security":[{"PlatformApiKey":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SecurityActivityWrite"}}}},"responses":{"201":{"description":"Vytvo\u0159eno","content":{"application\/json":{"schema":{"type":"object","properties":{"activity":{"$ref":"#\/components\/schemas\/SecurityActivity"}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationError"}}}},"\/api\/security\/activity\/{id}":{"parameters":[{"$ref":"#\/components\/parameters\/ActivityId"}],"options":{"tags":["Management"],"operationId":"optionsSecurityActivityItem","summary":"CORS preflight pro jednu aktivitu","responses":{"204":{"description":"OK"}}},"get":{"tags":["Management"],"operationId":"getSecurityActivity","summary":"Detail aktivity","security":[{"PlatformApiKey":[]}],"responses":{"200":{"description":"Aktivita","content":{"application\/json":{"schema":{"type":"object","properties":{"activity":{"$ref":"#\/components\/schemas\/SecurityActivity"}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"patch":{"tags":["Management"],"operationId":"updateSecurityActivity","summary":"Upravit aktivitu","security":[{"PlatformApiKey":[]}],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SecurityActivityPatch"}}}},"responses":{"200":{"description":"Ulo\u017eeno","content":{"application\/json":{"schema":{"type":"object","properties":{"activity":{"$ref":"#\/components\/schemas\/SecurityActivity"}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationError"}}},"delete":{"tags":["Management"],"operationId":"deleteSecurityActivity","summary":"Smazat aktivitu","security":[{"PlatformApiKey":[]}],"responses":{"200":{"description":"Smaz\u00e1no","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}}}}}},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/js\/gereq-security.js":{"get":{"tags":["Widgety"],"operationId":"formLoader","summary":"Form widget loader","responses":{"200":{"description":"JavaScript","content":{"application\/javascript":{"schema":{"type":"string"}}}}}}},"\/js\/gereq-monitor.js":{"get":{"tags":["Widgety"],"operationId":"monitorLoader","summary":"Site monitor loader","responses":{"200":{"description":"JavaScript","content":{"application\/javascript":{"schema":{"type":"string"}}}}}}}},"components":{"securitySchemes":{"PlatformApiKey":{"type":"apiKey","in":"header","name":"X-Gereq-Sign","description":"Spole\u010dn\u011b s `Authorization: Bearer pt_\u2026` (nebo `X-Gereq-Token`)."}},"parameters":{"SiteId":{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},"ActivityId":{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}},"responses":{"Unauthorized":{"description":"Chyb\u00ed nebo neplatn\u00fd kl\u00ed\u010d"},"Forbidden":{"description":"Zak\u00e1z\u00e1no (org \/ opr\u00e1vn\u011bn\u00ed)"},"NotFound":{"description":"Nenalezeno (nebo ciz\u00ed web)"},"ValidationError":{"description":"Valida\u010dn\u00ed chyba"}},"schemas":{"ProtectionMode":{"type":"string","enum":["observe","challenge","block"]},"SecuritySiteWrite":{"type":"object","required":["name","allowed_origins"],"properties":{"name":{"type":"string","maxLength":120},"allowed_origins":{"type":"array","minItems":1,"items":{"type":"string","format":"uri"}},"form_enabled":{"type":"boolean","default":true},"form_captcha_always":{"type":"boolean","default":false},"monitor_enabled":{"type":"boolean","default":true},"protection_mode":{"$ref":"#\/components\/schemas\/ProtectionMode"},"primary_color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"badge_text":{"type":["string","null"],"maxLength":120},"captcha_difficulty":{"type":"integer","minimum":1,"maximum":10,"default":2},"is_active":{"type":"boolean","default":true}}},"SecuritySitePatch":{"allOf":[{"$ref":"#\/components\/schemas\/SecuritySiteWrite"}],"required":[]},"SecuritySite":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"public_key":{"type":"string"},"allowed_origins":{"type":"array","items":{"type":"string"}},"form_enabled":{"type":"boolean"},"form_captcha_always":{"type":"boolean"},"monitor_enabled":{"type":"boolean"},"protection_mode":{"$ref":"#\/components\/schemas\/ProtectionMode"},"primary_color":{"type":"string"},"badge_text":{"type":["string","null"]},"captcha_difficulty":{"type":"integer"},"is_active":{"type":"boolean"},"snippets":{"type":"object","properties":{"form":{"type":"string"},"monitor":{"type":"string"}}},"verify_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"SecuritySiteCreated":{"allOf":[{"$ref":"#\/components\/schemas\/SecuritySite"},{"type":"object","properties":{"secret":{"type":"string","description":"Plain sk_ \u2014 jen p\u0159i create \/ rotate"}}}]},"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"}}},"SecurityActivity":{"type":"object","properties":{"id":{"type":"integer"},"security_site_id":{"type":"integer"},"occurred_at":{"type":"string","format":"date-time"},"visitor_hash":{"type":"string"},"path":{"type":["string","null"]},"score":{"type":"integer","minimum":0,"maximum":100},"action":{"type":"string","enum":["allow","challenge","block"]},"reasons":{"type":"array","items":{"type":"string"}},"user_agent":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"SecurityActivityWrite":{"type":"object","required":["security_site_id","visitor_hash","action"],"properties":{"security_site_id":{"type":"integer"},"occurred_at":{"type":"string","format":"date-time"},"visitor_hash":{"type":"string","maxLength":64},"path":{"type":["string","null"],"maxLength":500},"score":{"type":"integer","minimum":0,"maximum":100,"default":0},"action":{"type":"string","enum":["allow","challenge","block"]},"reasons":{"type":"array","items":{"type":"string"}},"user_agent":{"type":["string","null"],"maxLength":255}}},"SecurityActivityPatch":{"allOf":[{"$ref":"#\/components\/schemas\/SecurityActivityWrite"}],"required":[]}}}}