/api/v1/products/{id}/imagesProduktbild hochladen
Lädt eine einzelne Bilddatei hoch (multipart/form-data, Feldname `file`) und hängt sie an das `imageUrls`-Array des Produkts an. Nützlich, wenn keine CDN-URL bereitsteht — das Bild landet in unserem R2-Bucket und die öffentliche URL wird in der Antwort zurückgegeben.
Nur PNG / JPG / WebP, max. 5 MB pro Datei, max. 20 Bilder pro Produkt. **Kein Idempotency-Key-Support** — Multipart-Bodies sind nicht sicher hashbar. Client sollte Existenz prüfen + bei Retry überspringen. Das passende `DELETE /api/v1/products/{id}/images/{index}` entfernt ein einzelnes Bild per nullbasiertem Index.
Pfad-Parameter
- iderforderlich
ObjectId
Produkt-ID.
Header
- Authorizationerforderlich
string
`Bearer <api-key>`.
- Content-Typeerforderlich
string
`multipart/form-data` mit der von Ihrem HTTP-Client gesetzten Boundary.
Body-Felder
- fileerforderlich
binary (PNG / JPG / WebP, ≤ 5 MB)
Bild-Bytes, gesendet als `file`-Formularfeld.
Anfrage
curl -sS -X POST \
https://app.tracepass.eu/api/v1/products/6650a1b2c3d4e5f6a7b8c9d0/images \
-H "Authorization: Bearer tp_REDACTED_xxxxxxxxxxxx" \
-F "file=@./battery-hero.jpg"Antwort
{
"imageUrl": "https://r2.tracepass.eu/<companyId>/products/<id>/images/<imageId>.jpg",
"imageUrls": [
"https://existing-image-1.jpg",
"https://r2.tracepass.eu/<companyId>/products/<id>/images/<imageId>.jpg"
]
}