> For the complete documentation index, see [llms.txt](https://docs.xibosignage.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xibosignage.com/developer/integrate/openapi/template.md).

# Template

Templates

## Template Search

> Search templates this user has access to

```json
{"openapi":"3.1.1","info":{"title":"Xibo API","version":"4.0"},"tags":[{"name":"template","description":"Templates"}],"servers":[{"url":"/api"}],"security":[{"auth":["write:all","read:all"]}],"components":{"securitySchemes":{"auth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/authorize","tokenUrl":"/api/authorize/access_token","scopes":{"read:all":"read access","write:all":"write access"}}}}},"schemas":{"Layout":{"properties":{"layoutId":{"description":"The layoutId","type":"integer"},"ownerId":{"description":"The userId of the Layout Owner","type":"integer"},"campaignId":{"description":"The id of the Layout's dedicated Campaign","type":"integer"},"parentId":{"description":"The parentId, if this Layout has a draft","type":"integer"},"publishedStatusId":{"description":"The Status Id","type":"integer"},"publishedStatus":{"description":"The Published Status (Published, Draft or Pending Approval","type":"string"},"publishedDate":{"description":"The Published Date","type":"string"},"backgroundImageId":{"description":"The id of the image media set as the background","type":"integer"},"schemaVersion":{"description":"The XLF schema version","type":"integer"},"layout":{"description":"The name of the Layout","type":"string"},"description":{"description":"The description of the Layout","type":"string"},"backgroundColor":{"description":"A HEX string representing the Layout background color","type":"string"},"createdDt":{"description":"The datetime the Layout was created","type":"string"},"modifiedDt":{"description":"The datetime the Layout was last modified","type":"string"},"status":{"description":"Flag indicating the Layout status","type":"integer"},"retired":{"description":"Flag indicating whether the Layout is retired","type":"integer"},"backgroundzIndex":{"description":"The Layer that the background should occupy","type":"integer"},"width":{"description":"The Layout Width","type":"number","format":"double"},"height":{"description":"The Layout Height","type":"number","format":"double"},"orientation":{"description":"The Layout Orientation","type":"string"},"displayOrder":{"description":"If this Layout has been requested by Campaign, then this is the display order of the Layout within the Campaign","type":"integer"},"duration":{"description":"A read-only estimate of this Layout's total duration in seconds. This is equal to the longest region duration and is valid when the layout status is 1 or 2.","type":"integer"},"statusMessage":{"description":"A status message detailing any errors with the layout","type":"string"},"enableStat":{"description":"Flag indicating whether the Layout stat is enabled","type":"integer"},"autoApplyTransitions":{"description":"Flag indicating whether the default transitions should be applied to this Layout","type":"integer"},"code":{"description":"Code identifier for this Layout","type":"string"},"isLocked":{"description":"Is this layout locked by another user?","type":"boolean"},"regions":{"description":"An array of Regions belonging to this Layout","type":"array","items":{"$ref":"#/components/schemas/Region"}},"tags":{"description":"Tags associated with this Layout, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"folderId":{"description":"The id of the Folder this Layout belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Layout","type":"integer"}}},"Region":{"properties":{"regionId":{"description":"The ID of this region","type":"integer"},"layoutId":{"description":"The Layout ID this region belongs to","type":"integer"},"ownerId":{"description":"The userId of the User that owns this Region","type":"integer"},"type":{"description":"Region Type, zone, playlist, frame or canvas","type":"string"},"name":{"description":"The name of this Region","type":"string"},"width":{"description":"Width of the region","type":"number","format":"double"},"height":{"description":"Height of the Region","type":"number","format":"double"},"top":{"description":"The top coordinate of the Region","type":"number","format":"double"},"left":{"description":"The left coordinate of the Region","type":"number","format":"double"},"zIndex":{"description":"The z-index of the Region to control Layering","type":"integer"},"syncKey":{"description":"The syncKey of this Region","type":"string"},"regionOptions":{"description":"An array of Region Options","type":"array","items":{"$ref":"#/components/schemas/RegionOption"}},"permissions":{"description":"An array of Permissions","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"duration":{"description":"A read-only estimate of this Regions's total duration in seconds. This is valid when the parent layout status is 1 or 2.","type":"integer"},"isDrawer":{"description":"Flag, whether this region is used as an interactive drawer attached to a layout.","type":"integer"},"regionPlaylist":{"description":"This Regions Playlist - null if getPlaylist() has not been called.","$ref":"#/components/schemas/Playlist"}}},"RegionOption":{"properties":{"regionId":{"description":"The regionId that this Option applies to","type":"integer"},"option":{"description":"The option name","type":"string"},"value":{"description":"The option value","type":"string"}}},"Permission":{"properties":{"permissionId":{"description":"The ID of this Permission Record","type":"integer"},"entityId":{"description":"The Entity ID that this Permission refers to","type":"integer"},"groupId":{"description":"The User Group ID that this permission refers to","type":"integer"},"objectId":{"description":"The object ID that this permission refers to","type":"integer"},"isUser":{"description":"A flag indicating whether the groupId refers to a user specific group","type":"integer"},"entity":{"description":"The entity name that this refers to","type":"string"},"objectIdString":{"description":"Legacy for when the Object ID is a string","type":"string"},"group":{"description":"The group name that this refers to","type":"string"},"view":{"description":"A flag indicating whether view permission is granted","type":"integer"},"edit":{"description":"A flag indicating whether edit permission is granted","type":"integer"},"delete":{"description":"A flag indicating whether delete permission is granted","type":"integer"},"modifyPermissions":{"description":"A flag indicating whether modify permission permission is granted.","type":"integer"}}},"Playlist":{"properties":{"playlistId":{"description":"The ID of this Playlist","type":"integer"},"ownerId":{"description":"The userId of the User that owns this Playlist","type":"integer"},"name":{"description":"The Name of the Playlist","type":"string"},"regionId":{"description":"The RegionId if this Playlist is specific to a Region","type":"integer"},"isDynamic":{"description":"Flag indicating if this is a dynamic Playlist","type":"integer"},"filterMediaName":{"description":"Filter Name for a Dynamic Playlist","type":"string"},"filterMediaNameLogicalOperator":{"description":"Which logical operator should be used when filtering by multiple Plalust names? OR|AND","type":"string"},"filterMediaTags":{"description":"Filter Tags for a Dynamic Playlist","type":"string"},"filterExactTags":{"description":"Flag indicating whether to filter by exact Tag match","type":"integer"},"filterMediaTagsLogicalOperator":{"description":"Which logical operator should be used when filtering by multiple Tags? OR|AND","type":"string"},"filterFolderId":{"description":"The ID of the folder to filter media items by","type":"integer"},"maxNumberOfItems":{"description":"Maximum number of Media items matching dynamic Playlist filters","type":"integer"},"createdDt":{"description":"The datetime this entity was created","type":"string"},"modifiedDt":{"description":"The datetime this entity was last modified","type":"string"},"duration":{"description":"A read-only estimate of this Layout's total duration in seconds. This is equal to the longest region duration and is valid when the layout status is 1 or 2.","type":"integer"},"requiresDurationUpdate":{"description":"Flag indicating whether this Playlists requires a duration update","type":"integer"},"enableStat":{"description":"The option to enable the collection of Playlist Proof of Play statistics","type":"string"},"tags":{"description":"Tags associated with this Playlist, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"widgets":{"description":"An array of Widgets assigned to this Playlist","type":"array","items":{"$ref":"#/components/schemas/Widget"}},"permissions":{"description":"An array of permissions","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"folderId":{"description":"The id of the Folder this Playlist belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Playlist","type":"integer"}}},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}}},"Widget":{"properties":{"widgetId":{"description":"The Widget ID","type":"integer"},"playlistId":{"description":"The ID of the Playlist this Widget belongs to","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Widget","type":"integer"},"type":{"description":"The Module Type Code","type":"string"},"duration":{"description":"The duration in seconds this widget should be shown","type":"integer"},"displayOrder":{"description":"The display order of this widget","type":"integer"},"useDuration":{"description":"Flag indicating if this widget has a duration that should be used","type":"integer"},"calculatedDuration":{"description":"Calculated Duration of this widget after taking into account the useDuration flag","type":"integer"},"createdDt":{"description":"The datetime the Layout was created","type":"string"},"modifiedDt":{"description":"The datetime the Layout was last modified","type":"string"},"fromDt":{"description":"Widget From Date","type":"integer"},"toDt":{"description":"Widget To Date","type":"integer"},"schemaVersion":{"description":"Widget Schema Version","type":"integer"},"transitionIn":{"description":"Transition Type In","type":"integer"},"transitionOut":{"description":"Transition Type out","type":"integer"},"transitionDurationIn":{"description":"Transition duration in","type":"integer"},"transitionDurationOut":{"description":"Transition duration out","type":"integer"},"widgetOptions":{"description":"An array of Widget Options","type":"array","items":{"$ref":"#/components/schemas/WidgetOption"}},"mediaIds":{"description":"An array of MediaIds this widget is linked to","type":"array","items":{"type":"integer"}},"audio":{"description":"An array of Audio MediaIds this widget is linked to","type":"array","items":{"$ref":"#/components/schemas/WidgetAudio"}},"permissions":{"description":"An array of permissions for this widget","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"playlist":{"description":"The name of the Playlist this Widget is on","type":"string"}}},"WidgetOption":{"properties":{"widgetId":{"description":"The Widget ID that this Option belongs to","type":"integer"},"type":{"description":"The option type, either attrib or raw","type":"string"},"option":{"description":"The option name","type":"string"},"value":{"description":"The option value","type":"string"}}},"WidgetAudio":{"properties":{"widgetId":{"description":"The Widget Id","type":"integer"},"mediaId":{"description":"The Media Id","type":"integer"},"volume":{"description":"The percentage volume","type":"integer"},"loop":{"description":"Flag indicating whether to loop","type":"integer"}}}}},"paths":{"/template":{"get":{"tags":["template"],"summary":"Template Search","description":"Search templates this user has access to","operationId":"templateSearch","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Layout"}}}}}}}}}}
```

## Add a Template

> Add a new Template to the CMS

```json
{"openapi":"3.1.1","info":{"title":"Xibo API","version":"4.0"},"tags":[{"name":"template","description":"Templates"}],"servers":[{"url":"/api"}],"security":[{"auth":["write:all","read:all"]}],"components":{"securitySchemes":{"auth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/authorize","tokenUrl":"/api/authorize/access_token","scopes":{"read:all":"read access","write:all":"write access"}}}}},"schemas":{"Layout":{"properties":{"layoutId":{"description":"The layoutId","type":"integer"},"ownerId":{"description":"The userId of the Layout Owner","type":"integer"},"campaignId":{"description":"The id of the Layout's dedicated Campaign","type":"integer"},"parentId":{"description":"The parentId, if this Layout has a draft","type":"integer"},"publishedStatusId":{"description":"The Status Id","type":"integer"},"publishedStatus":{"description":"The Published Status (Published, Draft or Pending Approval","type":"string"},"publishedDate":{"description":"The Published Date","type":"string"},"backgroundImageId":{"description":"The id of the image media set as the background","type":"integer"},"schemaVersion":{"description":"The XLF schema version","type":"integer"},"layout":{"description":"The name of the Layout","type":"string"},"description":{"description":"The description of the Layout","type":"string"},"backgroundColor":{"description":"A HEX string representing the Layout background color","type":"string"},"createdDt":{"description":"The datetime the Layout was created","type":"string"},"modifiedDt":{"description":"The datetime the Layout was last modified","type":"string"},"status":{"description":"Flag indicating the Layout status","type":"integer"},"retired":{"description":"Flag indicating whether the Layout is retired","type":"integer"},"backgroundzIndex":{"description":"The Layer that the background should occupy","type":"integer"},"width":{"description":"The Layout Width","type":"number","format":"double"},"height":{"description":"The Layout Height","type":"number","format":"double"},"orientation":{"description":"The Layout Orientation","type":"string"},"displayOrder":{"description":"If this Layout has been requested by Campaign, then this is the display order of the Layout within the Campaign","type":"integer"},"duration":{"description":"A read-only estimate of this Layout's total duration in seconds. This is equal to the longest region duration and is valid when the layout status is 1 or 2.","type":"integer"},"statusMessage":{"description":"A status message detailing any errors with the layout","type":"string"},"enableStat":{"description":"Flag indicating whether the Layout stat is enabled","type":"integer"},"autoApplyTransitions":{"description":"Flag indicating whether the default transitions should be applied to this Layout","type":"integer"},"code":{"description":"Code identifier for this Layout","type":"string"},"isLocked":{"description":"Is this layout locked by another user?","type":"boolean"},"regions":{"description":"An array of Regions belonging to this Layout","type":"array","items":{"$ref":"#/components/schemas/Region"}},"tags":{"description":"Tags associated with this Layout, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"folderId":{"description":"The id of the Folder this Layout belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Layout","type":"integer"}}},"Region":{"properties":{"regionId":{"description":"The ID of this region","type":"integer"},"layoutId":{"description":"The Layout ID this region belongs to","type":"integer"},"ownerId":{"description":"The userId of the User that owns this Region","type":"integer"},"type":{"description":"Region Type, zone, playlist, frame or canvas","type":"string"},"name":{"description":"The name of this Region","type":"string"},"width":{"description":"Width of the region","type":"number","format":"double"},"height":{"description":"Height of the Region","type":"number","format":"double"},"top":{"description":"The top coordinate of the Region","type":"number","format":"double"},"left":{"description":"The left coordinate of the Region","type":"number","format":"double"},"zIndex":{"description":"The z-index of the Region to control Layering","type":"integer"},"syncKey":{"description":"The syncKey of this Region","type":"string"},"regionOptions":{"description":"An array of Region Options","type":"array","items":{"$ref":"#/components/schemas/RegionOption"}},"permissions":{"description":"An array of Permissions","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"duration":{"description":"A read-only estimate of this Regions's total duration in seconds. This is valid when the parent layout status is 1 or 2.","type":"integer"},"isDrawer":{"description":"Flag, whether this region is used as an interactive drawer attached to a layout.","type":"integer"},"regionPlaylist":{"description":"This Regions Playlist - null if getPlaylist() has not been called.","$ref":"#/components/schemas/Playlist"}}},"RegionOption":{"properties":{"regionId":{"description":"The regionId that this Option applies to","type":"integer"},"option":{"description":"The option name","type":"string"},"value":{"description":"The option value","type":"string"}}},"Permission":{"properties":{"permissionId":{"description":"The ID of this Permission Record","type":"integer"},"entityId":{"description":"The Entity ID that this Permission refers to","type":"integer"},"groupId":{"description":"The User Group ID that this permission refers to","type":"integer"},"objectId":{"description":"The object ID that this permission refers to","type":"integer"},"isUser":{"description":"A flag indicating whether the groupId refers to a user specific group","type":"integer"},"entity":{"description":"The entity name that this refers to","type":"string"},"objectIdString":{"description":"Legacy for when the Object ID is a string","type":"string"},"group":{"description":"The group name that this refers to","type":"string"},"view":{"description":"A flag indicating whether view permission is granted","type":"integer"},"edit":{"description":"A flag indicating whether edit permission is granted","type":"integer"},"delete":{"description":"A flag indicating whether delete permission is granted","type":"integer"},"modifyPermissions":{"description":"A flag indicating whether modify permission permission is granted.","type":"integer"}}},"Playlist":{"properties":{"playlistId":{"description":"The ID of this Playlist","type":"integer"},"ownerId":{"description":"The userId of the User that owns this Playlist","type":"integer"},"name":{"description":"The Name of the Playlist","type":"string"},"regionId":{"description":"The RegionId if this Playlist is specific to a Region","type":"integer"},"isDynamic":{"description":"Flag indicating if this is a dynamic Playlist","type":"integer"},"filterMediaName":{"description":"Filter Name for a Dynamic Playlist","type":"string"},"filterMediaNameLogicalOperator":{"description":"Which logical operator should be used when filtering by multiple Plalust names? OR|AND","type":"string"},"filterMediaTags":{"description":"Filter Tags for a Dynamic Playlist","type":"string"},"filterExactTags":{"description":"Flag indicating whether to filter by exact Tag match","type":"integer"},"filterMediaTagsLogicalOperator":{"description":"Which logical operator should be used when filtering by multiple Tags? OR|AND","type":"string"},"filterFolderId":{"description":"The ID of the folder to filter media items by","type":"integer"},"maxNumberOfItems":{"description":"Maximum number of Media items matching dynamic Playlist filters","type":"integer"},"createdDt":{"description":"The datetime this entity was created","type":"string"},"modifiedDt":{"description":"The datetime this entity was last modified","type":"string"},"duration":{"description":"A read-only estimate of this Layout's total duration in seconds. This is equal to the longest region duration and is valid when the layout status is 1 or 2.","type":"integer"},"requiresDurationUpdate":{"description":"Flag indicating whether this Playlists requires a duration update","type":"integer"},"enableStat":{"description":"The option to enable the collection of Playlist Proof of Play statistics","type":"string"},"tags":{"description":"Tags associated with this Playlist, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"widgets":{"description":"An array of Widgets assigned to this Playlist","type":"array","items":{"$ref":"#/components/schemas/Widget"}},"permissions":{"description":"An array of permissions","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"folderId":{"description":"The id of the Folder this Playlist belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Playlist","type":"integer"}}},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}}},"Widget":{"properties":{"widgetId":{"description":"The Widget ID","type":"integer"},"playlistId":{"description":"The ID of the Playlist this Widget belongs to","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Widget","type":"integer"},"type":{"description":"The Module Type Code","type":"string"},"duration":{"description":"The duration in seconds this widget should be shown","type":"integer"},"displayOrder":{"description":"The display order of this widget","type":"integer"},"useDuration":{"description":"Flag indicating if this widget has a duration that should be used","type":"integer"},"calculatedDuration":{"description":"Calculated Duration of this widget after taking into account the useDuration flag","type":"integer"},"createdDt":{"description":"The datetime the Layout was created","type":"string"},"modifiedDt":{"description":"The datetime the Layout was last modified","type":"string"},"fromDt":{"description":"Widget From Date","type":"integer"},"toDt":{"description":"Widget To Date","type":"integer"},"schemaVersion":{"description":"Widget Schema Version","type":"integer"},"transitionIn":{"description":"Transition Type In","type":"integer"},"transitionOut":{"description":"Transition Type out","type":"integer"},"transitionDurationIn":{"description":"Transition duration in","type":"integer"},"transitionDurationOut":{"description":"Transition duration out","type":"integer"},"widgetOptions":{"description":"An array of Widget Options","type":"array","items":{"$ref":"#/components/schemas/WidgetOption"}},"mediaIds":{"description":"An array of MediaIds this widget is linked to","type":"array","items":{"type":"integer"}},"audio":{"description":"An array of Audio MediaIds this widget is linked to","type":"array","items":{"$ref":"#/components/schemas/WidgetAudio"}},"permissions":{"description":"An array of permissions for this widget","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"playlist":{"description":"The name of the Playlist this Widget is on","type":"string"}}},"WidgetOption":{"properties":{"widgetId":{"description":"The Widget ID that this Option belongs to","type":"integer"},"type":{"description":"The option type, either attrib or raw","type":"string"},"option":{"description":"The option name","type":"string"},"value":{"description":"The option value","type":"string"}}},"WidgetAudio":{"properties":{"widgetId":{"description":"The Widget Id","type":"integer"},"mediaId":{"description":"The Media Id","type":"integer"},"volume":{"description":"The percentage volume","type":"integer"},"loop":{"description":"Flag indicating whether to loop","type":"integer"}}}}},"paths":{"/template":{"post":{"tags":["template"],"summary":"Add a Template","description":"Add a new Template to the CMS","operationId":"templateAdd","responses":{"201":{"description":"successful operation","headers":{"Location":{"description":"Location of the new record","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Layout"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The layout name"},"description":{"type":"string","description":"The layout description"},"resolutionId":{"type":"integer","description":"If a Template is not provided, provide the resolutionId for this Layout."},"returnDraft":{"type":"boolean","description":"Should we return the Draft Layout or the Published Layout on Success?"}},"required":["name"]}}}}}}}}
```

## Template Search All

> Search all templates from local and connectors

```json
{"openapi":"3.1.1","info":{"title":"Xibo API","version":"4.0"},"tags":[{"name":"template","description":"Templates"}],"servers":[{"url":"/api"}],"security":[{"auth":["write:all","read:all"]}],"components":{"securitySchemes":{"auth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/authorize","tokenUrl":"/api/authorize/access_token","scopes":{"read:all":"read access","write:all":"write access"}}}}},"schemas":{"SearchResult":{}}},"paths":{"/template/search":{"get":{"tags":["template"],"summary":"Template Search All","description":"Search all templates from local and connectors","operationId":"templateSearchAll","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}}}}}}}
```

## Add a template from a Layout

> Use the provided layout as a base for a new template

```json
{"openapi":"3.1.1","info":{"title":"Xibo API","version":"4.0"},"tags":[{"name":"template","description":"Templates"}],"servers":[{"url":"/api"}],"security":[{"auth":["write:all","read:all"]}],"components":{"securitySchemes":{"auth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/authorize","tokenUrl":"/api/authorize/access_token","scopes":{"read:all":"read access","write:all":"write access"}}}}},"schemas":{"Layout":{"properties":{"layoutId":{"description":"The layoutId","type":"integer"},"ownerId":{"description":"The userId of the Layout Owner","type":"integer"},"campaignId":{"description":"The id of the Layout's dedicated Campaign","type":"integer"},"parentId":{"description":"The parentId, if this Layout has a draft","type":"integer"},"publishedStatusId":{"description":"The Status Id","type":"integer"},"publishedStatus":{"description":"The Published Status (Published, Draft or Pending Approval","type":"string"},"publishedDate":{"description":"The Published Date","type":"string"},"backgroundImageId":{"description":"The id of the image media set as the background","type":"integer"},"schemaVersion":{"description":"The XLF schema version","type":"integer"},"layout":{"description":"The name of the Layout","type":"string"},"description":{"description":"The description of the Layout","type":"string"},"backgroundColor":{"description":"A HEX string representing the Layout background color","type":"string"},"createdDt":{"description":"The datetime the Layout was created","type":"string"},"modifiedDt":{"description":"The datetime the Layout was last modified","type":"string"},"status":{"description":"Flag indicating the Layout status","type":"integer"},"retired":{"description":"Flag indicating whether the Layout is retired","type":"integer"},"backgroundzIndex":{"description":"The Layer that the background should occupy","type":"integer"},"width":{"description":"The Layout Width","type":"number","format":"double"},"height":{"description":"The Layout Height","type":"number","format":"double"},"orientation":{"description":"The Layout Orientation","type":"string"},"displayOrder":{"description":"If this Layout has been requested by Campaign, then this is the display order of the Layout within the Campaign","type":"integer"},"duration":{"description":"A read-only estimate of this Layout's total duration in seconds. This is equal to the longest region duration and is valid when the layout status is 1 or 2.","type":"integer"},"statusMessage":{"description":"A status message detailing any errors with the layout","type":"string"},"enableStat":{"description":"Flag indicating whether the Layout stat is enabled","type":"integer"},"autoApplyTransitions":{"description":"Flag indicating whether the default transitions should be applied to this Layout","type":"integer"},"code":{"description":"Code identifier for this Layout","type":"string"},"isLocked":{"description":"Is this layout locked by another user?","type":"boolean"},"regions":{"description":"An array of Regions belonging to this Layout","type":"array","items":{"$ref":"#/components/schemas/Region"}},"tags":{"description":"Tags associated with this Layout, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"folderId":{"description":"The id of the Folder this Layout belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Layout","type":"integer"}}},"Region":{"properties":{"regionId":{"description":"The ID of this region","type":"integer"},"layoutId":{"description":"The Layout ID this region belongs to","type":"integer"},"ownerId":{"description":"The userId of the User that owns this Region","type":"integer"},"type":{"description":"Region Type, zone, playlist, frame or canvas","type":"string"},"name":{"description":"The name of this Region","type":"string"},"width":{"description":"Width of the region","type":"number","format":"double"},"height":{"description":"Height of the Region","type":"number","format":"double"},"top":{"description":"The top coordinate of the Region","type":"number","format":"double"},"left":{"description":"The left coordinate of the Region","type":"number","format":"double"},"zIndex":{"description":"The z-index of the Region to control Layering","type":"integer"},"syncKey":{"description":"The syncKey of this Region","type":"string"},"regionOptions":{"description":"An array of Region Options","type":"array","items":{"$ref":"#/components/schemas/RegionOption"}},"permissions":{"description":"An array of Permissions","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"duration":{"description":"A read-only estimate of this Regions's total duration in seconds. This is valid when the parent layout status is 1 or 2.","type":"integer"},"isDrawer":{"description":"Flag, whether this region is used as an interactive drawer attached to a layout.","type":"integer"},"regionPlaylist":{"description":"This Regions Playlist - null if getPlaylist() has not been called.","$ref":"#/components/schemas/Playlist"}}},"RegionOption":{"properties":{"regionId":{"description":"The regionId that this Option applies to","type":"integer"},"option":{"description":"The option name","type":"string"},"value":{"description":"The option value","type":"string"}}},"Permission":{"properties":{"permissionId":{"description":"The ID of this Permission Record","type":"integer"},"entityId":{"description":"The Entity ID that this Permission refers to","type":"integer"},"groupId":{"description":"The User Group ID that this permission refers to","type":"integer"},"objectId":{"description":"The object ID that this permission refers to","type":"integer"},"isUser":{"description":"A flag indicating whether the groupId refers to a user specific group","type":"integer"},"entity":{"description":"The entity name that this refers to","type":"string"},"objectIdString":{"description":"Legacy for when the Object ID is a string","type":"string"},"group":{"description":"The group name that this refers to","type":"string"},"view":{"description":"A flag indicating whether view permission is granted","type":"integer"},"edit":{"description":"A flag indicating whether edit permission is granted","type":"integer"},"delete":{"description":"A flag indicating whether delete permission is granted","type":"integer"},"modifyPermissions":{"description":"A flag indicating whether modify permission permission is granted.","type":"integer"}}},"Playlist":{"properties":{"playlistId":{"description":"The ID of this Playlist","type":"integer"},"ownerId":{"description":"The userId of the User that owns this Playlist","type":"integer"},"name":{"description":"The Name of the Playlist","type":"string"},"regionId":{"description":"The RegionId if this Playlist is specific to a Region","type":"integer"},"isDynamic":{"description":"Flag indicating if this is a dynamic Playlist","type":"integer"},"filterMediaName":{"description":"Filter Name for a Dynamic Playlist","type":"string"},"filterMediaNameLogicalOperator":{"description":"Which logical operator should be used when filtering by multiple Plalust names? OR|AND","type":"string"},"filterMediaTags":{"description":"Filter Tags for a Dynamic Playlist","type":"string"},"filterExactTags":{"description":"Flag indicating whether to filter by exact Tag match","type":"integer"},"filterMediaTagsLogicalOperator":{"description":"Which logical operator should be used when filtering by multiple Tags? OR|AND","type":"string"},"filterFolderId":{"description":"The ID of the folder to filter media items by","type":"integer"},"maxNumberOfItems":{"description":"Maximum number of Media items matching dynamic Playlist filters","type":"integer"},"createdDt":{"description":"The datetime this entity was created","type":"string"},"modifiedDt":{"description":"The datetime this entity was last modified","type":"string"},"duration":{"description":"A read-only estimate of this Layout's total duration in seconds. This is equal to the longest region duration and is valid when the layout status is 1 or 2.","type":"integer"},"requiresDurationUpdate":{"description":"Flag indicating whether this Playlists requires a duration update","type":"integer"},"enableStat":{"description":"The option to enable the collection of Playlist Proof of Play statistics","type":"string"},"tags":{"description":"Tags associated with this Playlist, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"widgets":{"description":"An array of Widgets assigned to this Playlist","type":"array","items":{"$ref":"#/components/schemas/Widget"}},"permissions":{"description":"An array of permissions","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"folderId":{"description":"The id of the Folder this Playlist belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Playlist","type":"integer"}}},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}}},"Widget":{"properties":{"widgetId":{"description":"The Widget ID","type":"integer"},"playlistId":{"description":"The ID of the Playlist this Widget belongs to","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Widget","type":"integer"},"type":{"description":"The Module Type Code","type":"string"},"duration":{"description":"The duration in seconds this widget should be shown","type":"integer"},"displayOrder":{"description":"The display order of this widget","type":"integer"},"useDuration":{"description":"Flag indicating if this widget has a duration that should be used","type":"integer"},"calculatedDuration":{"description":"Calculated Duration of this widget after taking into account the useDuration flag","type":"integer"},"createdDt":{"description":"The datetime the Layout was created","type":"string"},"modifiedDt":{"description":"The datetime the Layout was last modified","type":"string"},"fromDt":{"description":"Widget From Date","type":"integer"},"toDt":{"description":"Widget To Date","type":"integer"},"schemaVersion":{"description":"Widget Schema Version","type":"integer"},"transitionIn":{"description":"Transition Type In","type":"integer"},"transitionOut":{"description":"Transition Type out","type":"integer"},"transitionDurationIn":{"description":"Transition duration in","type":"integer"},"transitionDurationOut":{"description":"Transition duration out","type":"integer"},"widgetOptions":{"description":"An array of Widget Options","type":"array","items":{"$ref":"#/components/schemas/WidgetOption"}},"mediaIds":{"description":"An array of MediaIds this widget is linked to","type":"array","items":{"type":"integer"}},"audio":{"description":"An array of Audio MediaIds this widget is linked to","type":"array","items":{"$ref":"#/components/schemas/WidgetAudio"}},"permissions":{"description":"An array of permissions for this widget","type":"array","items":{"$ref":"#/components/schemas/Permission"}},"playlist":{"description":"The name of the Playlist this Widget is on","type":"string"}}},"WidgetOption":{"properties":{"widgetId":{"description":"The Widget ID that this Option belongs to","type":"integer"},"type":{"description":"The option type, either attrib or raw","type":"string"},"option":{"description":"The option name","type":"string"},"value":{"description":"The option value","type":"string"}}},"WidgetAudio":{"properties":{"widgetId":{"description":"The Widget Id","type":"integer"},"mediaId":{"description":"The Media Id","type":"integer"},"volume":{"description":"The percentage volume","type":"integer"},"loop":{"description":"Flag indicating whether to loop","type":"integer"}}}}},"paths":{"/template/{layoutId}":{"post":{"tags":["template"],"summary":"Add a template from a Layout","description":"Use the provided layout as a base for a new template","operationId":"template.add.from.layout","parameters":[{"schema":{"type":"integer"},"name":"layoutId","in":"path","description":"The Layout ID","required":true}],"responses":{"201":{"description":"successful operation","headers":{"Location":{"description":"Location of the new record","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Layout"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"includeWidgets":{"type":"integer","description":"Flag indicating whether to include the widgets in the Template"},"name":{"type":"string","description":"The Template Name"},"tags":{"type":"string","description":"Comma separated list of Tags for the template"},"description":{"type":"string","description":"A description of the Template"}},"required":["includeWidgets","name"]}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xibosignage.com/developer/integrate/openapi/template.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
