Dateien hochladen
POST /v1/media lädt ein Bild, Video oder PDF in die Medien-Bibliothek. Drei Wege: multipart mit einem Feld file, JSON mit einer öffentlichen url, oder JSON mit der Datei als base64. Die Antwort enthält die Medien-ID, die du in Newslettern, Vorlagen, Follow-ups und auf der Landingpage nutzt. Dokumente für die AI-Antwort gehen genauso an POST /v1/knowledge/documents.
Ändert DatenRecht:
media:write1. URL
curl -X POST https://api.smartchat.marketing/v1/media \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/photo.jpg", "usage": "newsletter"}'
2. Base64
curl -X POST https://api.smartchat.marketing/v1/media \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"data_base64": "iVBORw0KGgo...", "filename": "photo.png", "mime": "image/png"}'
3. Multipart
curl -X POST https://api.smartchat.marketing/v1/media \ -H "Authorization: Bearer sk_live_..." \ -F "file=@photo.jpg" -F "usage=landing"
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
url | string | nein | Public https address. SmartChat downloads the file (max 100 MB). |
data_base64 | string | nein | The file as base64 (alternative to url). |
filename | string | nein | File name with extension. Required with data_base64. |
mime | string | nein | File type, for example image/jpeg. |
usage | string | nein | generic, landing, newsletter, template, logo, avatar, blog. |
{"media": {"id": "fac5ba3e-...", "kind": "image", "usage": "newsletter", "url": "https://..."}}
Knowledge documents
Ändert DatenRecht:
knowledge:writecurl -X POST https://api.smartchat.marketing/v1/knowledge/documents \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/prices.pdf"}'
Fragen?
Schreib uns an support@smartchat.marketing