saveLayoutDraft
const url = 'https://example.com/api/v1/layouts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft';const options = { method: 'PUT', headers: { cookie: 'tilecast_session=<tilecast_session>', 'Content-Type': 'application/json' }, body: '{"expectedDraftRevision":1,"document":{"schemaVersion":2,"canvas":{"width":1,"height":1,"orientation":"landscape","backgroundColor":"example","backgroundAssetId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","backgroundVariantId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","safeAreaPercent":1},"placements":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","type":"widget","name":"example","x":1,"y":1,"width":1,"height":1,"layer":1,"opacity":1,"visible":true,"locked":true,"groupId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","widgetId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","assetId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","variantId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","playlistId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","overrides":{"fit":"contain","alignment":"left","foregroundColor":"example","backgroundColor":"example","fallbackVisibility":"show","muted":true},"primitive":{"kind":"text","text":"example","fontFamily":"Inter","fontId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","fontSize":1,"fontWeight":400,"textAlign":"left","verticalAlign":"top","color":"example","backgroundColor":"example","lineHeight":1,"letterSpacing":1,"padding":1,"borderWidth":1,"borderColor":"example","cornerRadius":1,"maximumLines":1,"overflow":"clip","autoFit":true,"minimumFontSize":1,"fillColor":"example","strokeColor":"example","strokeWidth":1,"binding":{"dataSourceId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","field":"example","prefix":"example","suffix":"example","fallbackText":"example","hideWhenEmpty":true,"format":"text"}},"playback":{"fit":"contain","muted":true,"loop":true,"fallback":"hide","cornerRadius":1}}]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/layouts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft \ --header 'Content-Type: application/json' \ --cookie tilecast_session=<tilecast_session> \ --data '{ "expectedDraftRevision": 1, "document": { "schemaVersion": 2, "canvas": { "width": 1, "height": 1, "orientation": "landscape", "backgroundColor": "example", "backgroundAssetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "backgroundVariantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "safeAreaPercent": 1 }, "placements": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "widget", "name": "example", "x": 1, "y": 1, "width": 1, "height": 1, "layer": 1, "opacity": 1, "visible": true, "locked": true, "groupId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "widgetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "variantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "playlistId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "overrides": { "fit": "contain", "alignment": "left", "foregroundColor": "example", "backgroundColor": "example", "fallbackVisibility": "show", "muted": true }, "primitive": { "kind": "text", "text": "example", "fontFamily": "Inter", "fontId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "fontSize": 1, "fontWeight": 400, "textAlign": "left", "verticalAlign": "top", "color": "example", "backgroundColor": "example", "lineHeight": 1, "letterSpacing": 1, "padding": 1, "borderWidth": 1, "borderColor": "example", "cornerRadius": 1, "maximumLines": 1, "overflow": "clip", "autoFit": true, "minimumFontSize": 1, "fillColor": "example", "strokeColor": "example", "strokeWidth": 1, "binding": { "dataSourceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "field": "example", "prefix": "example", "suffix": "example", "fallbackText": "example", "hideWhenEmpty": true, "format": "text" } }, "playback": { "fit": "contain", "muted": true, "loop": true, "fallback": "hide", "cornerRadius": 1 } } ] } }'Requires an authenticated dashboard session. Saves a validated draft using expectedDraftRevision optimistic concurrency.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Cookie-backed browser requests only, and only on unsafe methods. Bearer grants never send it.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Only schema version 2 is accepted.
object
object
Legacy Widget placement override bag. The listed values are accepted for saved-document compatibility but are ignored by Studio and Player.
object
object
Only bundled fonts are accepted for text primitives
A family from the organization font library. fontFamily stays the bundled fallback
object
object
Responses
Section titled “ Responses ”Draft saved with a new revision and ETag
object
object
object
Only schema version 2 is accepted.
object
object
Legacy Widget placement override bag. The listed values are accepted for saved-document compatibility but are ignored by Studio and Player.
object
object
Only bundled fonts are accepted for text primitives
A family from the organization font library. fontFamily stays the bundled fallback
object
object
object
object
object
object
object
Example
{ "data": { "orientation": "landscape", "draft": { "schemaVersion": 2, "canvas": { "orientation": "landscape" }, "placements": [ { "type": "widget", "overrides": { "fit": "contain", "alignment": "left", "fallbackVisibility": "show" }, "primitive": { "kind": "text", "fontFamily": "Inter", "fontWeight": 400, "textAlign": "left", "verticalAlign": "top", "overflow": "clip", "binding": { "format": "text" } }, "playback": { "fit": "contain", "fallback": "hide" } } ] }, "dependencies": [ { "type": "widget" } ] }}Draft revision conflict
Layout document or dependency rejected