{"openapi":"3.1.0","info":{"title":"PandaRender Inspection API","version":"0.1.0","description":"Early-access A4 inspection reports. Inline JPEG/PNG/WebP only; strict evidence validation."},"servers":[{"url":"/api/public"}],"paths":{"/healthz":{"get":{"responses":{"200":{"description":"Healthy"}}}},"/v1/reports/inspection/validate":{"post":{"summary":"Validate shape and references; does not decode assets","description":"Checks unique IDs, declared areas, existing photo references, real ISO calendar dates, and inline data-URI shape. No remote fetching or image decoding.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Inspection"}}}},"responses":{"200":{"description":"Valid shape; assets_checked is false"},"400":{"description":"Malformed JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-origin browser access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body or demo limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid shape, references, calendar date or inline image evidence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Renderer or usage service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/inspection":{"post":{"security":[{"bearerKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Inspection"}}}},"responses":{"200":{"description":"A4 PDF","headers":{"X-PandaRender-Page-Count":{"schema":{"type":"integer"}},"X-PandaRender-Warning-Count":{"schema":{"type":"integer"}},"X-PandaRender-Report-Id":{"schema":{"type":"string"}},"X-PandaRender-Request-Id":{"schema":{"type":"string","format":"uuid"}},"X-PandaRender-Quota-Used":{"schema":{"type":"integer"},"description":"Atomic daily usage after this reservation; resets at UTC midnight."},"X-PandaRender-Quota-Limit":{"schema":{"type":"integer"}}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Malformed JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-origin browser access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body or demo limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid shape, references, calendar date or inline image evidence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Minute/daily quota or renderer concurrency reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Renderer or usage service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/demo/inspection":{"post":{"summary":"Empty JSON uses bundled synthetic demo. Custom cap: 5 findings / 5 photos. 3/minute, 10/day per IP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","maxProperties":0},{"$ref":"#/components/schemas/Inspection"}]}}}},"responses":{"200":{"description":"Demo PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Malformed JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Cross-origin browser access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body or demo limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid shape, references, calendar date or inline image evidence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Demo quota or renderer concurrency reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Renderer or usage service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerKey":{"type":"http","scheme":"bearer"}},"schemas":{"Inspection":{"type":"object","properties":{"report_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"title":{"type":"string","minLength":1,"maxLength":160},"locale":{"type":"string","const":"en-GB","default":"en-GB"},"paper_size":{"type":"string","const":"A4","default":"A4"},"site":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","minLength":1,"maxLength":500},"reference":{"type":"string","minLength":1,"maxLength":100}},"required":["name","address"],"additionalProperties":true},"inspection":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"inspector_name":{"type":"string","minLength":1,"maxLength":120},"inspector_credential":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":10000}},"required":["date","inspector_name"],"additionalProperties":true},"branding":{"type":"object","properties":{"organisation":{"type":"string","minLength":1,"maxLength":200},"primary_colour":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#164e63"},"secondary_colour":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#0f766e"},"logo_image":{"type":"string","maxLength":6000000}},"required":["organisation"],"additionalProperties":true},"areas":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"minItems":1,"maxItems":50},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"image":{"type":"string","maxLength":6000000},"caption":{"type":"string","minLength":1,"maxLength":1000},"area":{"type":"string","minLength":1,"maxLength":100}},"required":["id","image","caption","area"],"additionalProperties":true},"maxItems":60},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"area":{"type":"string","minLength":1,"maxLength":100},"title":{"type":"string","minLength":1,"maxLength":200},"severity":{"type":"string","enum":["high","medium","low","pass"]},"description":{"type":"string","minLength":1,"maxLength":15000},"recommendation":{"type":"string","minLength":1,"maxLength":7500},"photo_ids":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"maxItems":60},"allow_no_photos":{"type":"boolean","default":false}},"required":["id","area","title","severity","description","recommendation","photo_ids"],"additionalProperties":true},"minItems":1,"maxItems":100},"recommendations":{"type":"array","items":{"type":"string","minLength":1,"maxLength":1000},"maxItems":50,"default":[]},"image_policy":{"type":"string","const":"strict","default":"strict"},"illustrative_sample":{"type":"boolean","default":false}},"required":["report_id","title","site","inspection","branding","areas","photos","findings"],"additionalProperties":false},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"type":"string"},"photo_id":{"type":"string"},"request_id":{"type":"string","format":"uuid"}}}}}}}}