Zum Inhalt springen
StatusZu Brandhub

REST-API

Layout-Entwurf anlegen

POST
/layout/documents
curl --request POST \
--url https://beispielmarke.brandhub.de/api/v1/layout/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "template": "example", "product": "example", "variant": "example", "roles": { "additionalProperty": { "media": "example" } }, "params": "example" }'

Legt einen Layout-Entwurf an, rendert ihn und antwortet mit 201, dem Befund des Renderers und preview_url, einem PNG-Link, der höchstens 24 Stunden gilt. Ungültige Angaben (Pflichtrolle fehlt, Text zu lang, fremdes Bild) lehnt die API mit 422 und issues ab, es entsteht dann nichts.

Media typeapplication/json
object
name
required

Kurzer Name des Layouts, höchstens 120 Zeichen.

string
template
required

Schlüssel der Vorlage aus GET /layout/templates.

string
product
required

Produkt (Format) aus products der Vorlage, z. B. linkedin-post.

string
variant

Variante der Vorlage; ohne Angabe die Standard-Variante.

string | null
roles
required

Rolle → Wert. Texte als String, Bildrollen als {"media": "<public_id>"} mit der public_id eines Fotos aus GET /media.

object
key
additional properties
Any of:
string
params

Farb- oder Auswahl-Parameter, nur Werte aus allowed der Vorlage.

object | null
Examplegenerated
{
"name": "example",
"template": "example",
"product": "example",
"variant": "example",
"roles": {
"additionalProperty": {
"media": "example"
}
},
"params": "example"
}
Media typeapplication/json
Array
Examplegenerated
[
"example"
]
Media typeapplication/json
Array
Examplegenerated
[
"example"
]