1.2 KiB
1.2 KiB
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.
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).
Response 201
Image stored and linked
{
"brand": {
"id": 1,
"fullHash": "…",
"thumbW": 1,
"thumbH": 1,
"thumbHash": "…",
"pics": [
{
"id": 1,
"sort": 1,
"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.