{"openapi":"3.1.0","info":{"title":"Jevground feedback API","version":"1.1.0","description":"Submit feedback about this website. No authentication is required. A report is acknowledged only after it is saved."},"servers":[{"url":"/"}],"paths":{"/api/feedback":{"post":{"summary":"Submit feedback","description":"Send a JSON report. Server agents may omit Origin and Sec-Fetch-Site. Browser requests must have this site's Origin and must not be cross-site. Reuse the same id and body when retrying an unconfirmed save. The endpoint is append-only; a reused id with different details conflicts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feedback"},"example":{"id":"550e8400-e29b-41d4-a716-446655440000","message":"The explanation for the score result is unclear."}}}},"responses":{"200":{"description":"The identical report was already saved with this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Saved"}}}},"201":{"description":"Report saved and durably acknowledged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Saved"}}}},"400":{"description":"Invalid JSON or report fields. The error code identifies the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Browser request has an invalid or cross-site Origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"This id was saved with different details. Use a new id for a new report.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request or retained context is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Content-Type must be application/json.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry-After gives seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Save could not be confirmed. Retry with the same id and body; it may already have been saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"save_unconfirmed","message":"Could not confirm your feedback was saved. Your message is still here; please try again."}}}}}}}}},"components":{"schemas":{"Feedback":{"type":"object","additionalProperties":false,"required":["id","message"],"properties":{"id":{"type":"string","format":"uuid","description":"Client-generated idempotency key. Reuse for retries of the same report."},"message":{"type":"string","minLength":1,"maxLength":4000,"description":"Nonblank feedback message; NUL is rejected."},"email":{"type":["string","null"],"format":"email","maxLength":254,"description":"Optional reply address. Omit, null, or empty string for no address."},"page":{"type":"string","default":"/","maxLength":512,"pattern":"^/(?!/)[^?#\\\\\\s]*$","description":"Site-relative path without query or fragment."},"context":{"$ref":"#/components/schemas/Context"},"snapshot":{"type":"object","description":"Optional Jevground version 1 reproduction snapshot (up to 4,000,000 UTF-8 JSON bytes). The browser form captures draft editor values, referenced image bytes and the displayed runs when Send is pressed. Agents may omit this; the endpoint cannot read a visitor's browser state. Never include credentials. Credential-shaped fields and text are redacted. Malformed snapshots are rejected, never silently dropped.","required":["schema_version","app","captured_at","mode","draft","active_case_id","views","runs","images","busy","error","request_error"],"properties":{"schema_version":{"const":1},"app":{"const":"jevground"},"captured_at":{"type":"string","format":"date-time"},"mode":{"enum":["basic","advanced"]},"draft":{"type":"object","description":"Raw Jevground draft editor values, including invalid JSON. Referenced assets only."},"active_case_id":{"type":"string"},"views":{"type":"object","description":"card and response are null or keys into runs. A null card means the answer was hidden."},"runs":{"type":"object","maxProperties":2,"description":"Selected {experiment, case} pairs only. case.request is canonical for retained attempts. batch.attempts_scope is displayed; total_attempts records the original count. Only the displayed successful attempt and a distinct final attempt are retained."},"images":{"type":"object","description":"Deduplicated image IDs map to {format: png|jpg, data_base64}. draft.assets.*.data and case.request.assets.*.data_base64 use {$image: image ID}."},"busy":{"type":"boolean"},"error":{"type":["string","null"]},"request_error":{"type":["string","null"]}},"additionalProperties":false},"website":{"type":"string","enum":[""],"description":"Optional browser form honeypot. Omit for API calls."}}},"Context":{"type":"object","default":{},"description":"Optional. Only the listed metadata is retained; other keys are discarded. At most 4096 bytes of input JSON.","additionalProperties":true,"properties":{"mode":{"type":"string","enum":["basic","advanced"]},"question_type":{"type":"string","enum":["noul","choice","score","box"]},"model":{"type":"string","pattern":"^jev-[a-zA-Z0-9.-]{1,64}$"},"run_id":{"type":"string","format":"uuid"},"request_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Last 10 valid IDs retained."},"diagnostics":{"type":"array","maxItems":8,"description":"Optional structural recent-error metadata from the past five minutes, including handled /api/ask and /api/image failures. No raw messages, response bodies, URLs, prompts, console arguments or stack text are retained.","items":{"type":"object","additionalProperties":false,"required":["kind","at"],"properties":{"kind":{"type":"string","enum":["console_error","console_warn","uncaught_error","unhandled_rejection","api_error"]},"at":{"type":"string","format":"date-time"},"name":{"type":"string"},"location":{"type":"string","maxLength":160},"route":{"type":"string","enum":["/api/ask","/api/image"]},"status":{"type":"integer","minimum":100,"maximum":599},"code":{"type":"string","description":"Allowlisted stable Jevground error code; unknown codes become api_error."},"request_id":{"type":"string","format":"uuid"}}}},"viewport":{"type":"object","additionalProperties":false,"required":["width","height"],"properties":{"width":{"type":"integer","minimum":1,"maximum":32768},"height":{"type":"integer","minimum":1,"maximum":32768}}}}},"Saved":{"type":"object","additionalProperties":false,"required":["ok","id"],"properties":{"ok":{"type":"boolean","const":true},"id":{"type":"string","format":"uuid"}}},"Error":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}