Happklaar API
string[] · application/octet-stream · minItems: 1 · maxItems: 4 · required
POST
https://api.happklaar.nl/v1
/pantry/photo-scan
Request Body
POST /v1/pantry/photo-scan — multipart request body DTO.
Carries 1–4 photos (jpeg / png / webp / heic) of pantry shelves. The
file caps + MIME allowlist are typed class constants per CLAUDE.md
"no magic numbers" rule. The Spatie\Data `rules()` override is what
gates malformed payloads at 422 BEFORE the controller resolves the
household or touches the service.
Threat model
- MAX_BYTES_PER_PHOTO bounds the per-request memory + Prism cost
ceiling so a hostile multipart submission can't DoS the worker.
- ALLOWED_MIME rejects `image/svg+xml` (the XSS-via-SVG vector) and
other non-photo content types.
- MAX_PHOTOS_PER_REQUEST bounds the per-call vision spend.
photosResponses
OK