---
title: "Branding-Asset hochladen"
description: "Lädt ein Logo oder Favicon als Base64-Data-URL hoch. Assets werden in S3 gespeichert und der Branding-Datensatz wird automatisch aktualisiert. Erfordert die Admin-Rolle."
---

`POST /api/organization/whitelabel/branding/upload`

**Logo**-Typen: `logo`, `logoLight`, `logoDark`: akzeptiert PNG, JPEG, WebP, SVG (max. 2 MB).
**Favicon**-Typen: `favicon`, `faviconLight`, `faviconDark`: akzeptiert PNG, SVG, ICO (max. 512 KB).

Das Legacy-`logo` wird als `logoLight` behandelt und `favicon` als `faviconLight`.

## Anfrage (Request Body)

| Feld | Typ | Pflicht | Beschreibung |
|-------|------|----------|-------------|
| `kind` | string | Ja | `logo`, `logoLight`, `logoDark`, `favicon`, `faviconLight`, `faviconDark` |
| `fileName` | string | Ja | Ursprünglicher Dateiname (1-200 Zeichen) |
| `dataUrl` | string | Ja | Base64-Data-URL (`data:*/*;base64,...`) |

## Beispiel (cURL)

```bash
curl -X POST "$BASE_URL/api/organization/whitelabel/branding/upload" \
  -H "Cookie: $SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "logoLight",
    "fileName": "logo.svg",
    "dataUrl": "data:image/svg+xml;base64,PHN2Zy..."
  }'
```

## Antwort (Response)

```json
{
  "success": true,
  "uploaded": {
    "kind": "logo",
    "objectKey": "branding/org-1/logo/light/1710000000-logo.svg",
    "contentType": "image/svg+xml",
    "bytes": 1234,
    "publicUrl": "https://s3.deinkunde.com/branding/org-1/logo/light/1710000000-logo.svg?..."
  },
  "branding": {
    "productName": "Acme Monitor",
    "hideProductName": false,
    "logoUrl": "https://s3.deinkunde.com/...",
    "themePrimary": "#43B1AE",
    "updatedAt": "2026-04-15T12:00:00.000Z"
  }
}
```

## Häufige Fehler

- `400 Invalid dataUrl` wenn das Data-URL-Format falsch ist
- `400 Unsupported contentType` wenn der Content-Type für den Asset-Typ nicht erlaubt ist
- `413 File too large` wenn die Größenbeschränkungen überschritten werden
- `503 Whitelabel asset storage is not configured` wenn S3 nicht eingerichtet ist

