# `POST /brand/{id}/image` Protected. Requires a valid session cookie (`credentials: 'include'`). Add or replace brand image Uploads an image for the brand (AVIF, WebP, or octet-stream). Converted to AVIF full and thumbnail. Replaces any existing image for this brand. Emits SSE signal `brand` with payload `{ sender, brandId }`. ## Path parameters | Param | Required | Type | Description | |-------|----------|------|-------------| | `id` | yes | integer | Brand id | ## Body Raw binary (`image/avif`). Raw binary (`image/webp`). Raw binary (`application/octet-stream`). ## Signals On success, emits SSE signal: `brand` (see [`GET /events`](../events.md)). ## Response `201` Image stored and linked ```json { "brand": { "id": 1, "fullHash": "…", "thumbW": 1, "thumbH": 1, "thumbHash": "…", "pics": [ { "fullHash": "…", "thumbW": 1, "thumbH": 1, "thumbHash": "…" } ] } } ``` ## Errors | Status | Description | |--------|-------------| | 400 | Missing body or invalid image — `{"error":"…"}` | | 401 | Unauthorized — `{"error":"…"}` | | 403 | Not authorized — `{"error":"…"}` | | 404 | Brand not found — `{"error":"…"}` | --- _Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._