> 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/library.md).

# Library

Library

## Enable Stats Collection

> Set Enable Stats Collection? to use for the collection of Proof of Play statistics for a media.

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/setenablestat/{mediaId}":{"put":{"tags":["library"],"summary":"Enable Stats Collection","description":"Set Enable Stats Collection? to use for the collection of Proof of Play statistics for a media.","operationId":"mediaSetEnableStat","parameters":[{"name":"mediaId","in":"path","description":"The Media ID","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["enableStat"],"properties":{"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"}},"type":"object"}}}},"responses":{"204":{"description":"successful operation"}}}}}}
```

## Library Search

> Search the Library for this user

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library":{"get":{"tags":["library"],"summary":"Library Search","description":"Search the Library for this user","operationId":"librarySearch","parameters":[{"name":"mediaId","in":"query","description":"Filter by Media Id","required":false,"schema":{"type":"integer"}},{"name":"media","in":"query","description":"Filter by Media Name","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Filter by Media Type","required":false,"schema":{"type":"string"}},{"name":"ownerId","in":"query","description":"Filter by Owner Id","required":false,"schema":{"type":"integer"}},{"name":"retired","in":"query","description":"Filter by Retired","required":false,"schema":{"type":"integer"}},{"name":"tags","in":"query","description":"Filter by Tags - comma seperated","required":false,"schema":{"type":"string"}},{"name":"exactTags","in":"query","description":"A flag indicating whether to treat the tags filter as an exact match","required":false,"schema":{"type":"integer"}},{"name":"logicalOperator","in":"query","description":"When filtering by multiple Tags, which logical operator should be used? AND|OR","required":false,"schema":{"type":"string"}},{"name":"duration","in":"query","description":"Filter by Duration - a number or less-than,greater-than,less-than-equal or great-than-equal followed by a | followed by a number","required":false,"schema":{"type":"string"}},{"name":"fileSize","in":"query","description":"Filter by File Size - a number or less-than,greater-than,less-than-equal or great-than-equal followed by a | followed by a number","required":false,"schema":{"type":"string"}},{"name":"ownerUserGroupId","in":"query","description":"Filter by users in this UserGroupId","required":false,"schema":{"type":"integer"}},{"name":"folderId","in":"query","description":"Filter by Folder ID","required":false,"schema":{"type":"integer"}},{"name":"isReturnPublicUrls","in":"query","description":"Should the thumbnail URLs be authenticated S3 style public URL, default = false","required":false,"schema":{"type":"integer"}},{"name":"modifiedDateFrom","in":"query","description":"Start date for filtering media by modified date","required":false,"schema":{"type":"string","format":"date"}},{"name":"modifiedDateTo","in":"query","description":"End date for filtering media by modified date","required":false,"schema":{"type":"string","format":"date"}},{"name":"sortBy","in":"query","description":"Specifies which field the results are sorted by. Used together with sortDir","required":false,"schema":{"type":"string","enum":["mediaId","name","type","duration","fileSize","owner","sharing","released","fileName","enableStat","createdAt","modifiedDt","expires","revised","formattedDuration","durationSeconds","fileSizeFormatted","mediaType","resolution","groupsWithPermissions"]}},{"name":"sortDir","in":"query","description":"Sort direction","required":false,"schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"successful operation","headers":{"X-Total-Count":{"description":"The total number of records","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Media"}}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```

## Add Media

> Add Media to the Library, optionally replacing an existing media item, optionally adding to a playlist.

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library":{"post":{"tags":["library"],"summary":"Add Media","description":"Add Media to the Library, optionally replacing an existing media item, optionally adding to a playlist.","operationId":"libraryAdd","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"required":["files"],"properties":{"files":{"description":"The Uploaded File","type":"string","format":"binary"},"name":{"description":"Optional Media Name","type":"string"},"oldMediaId":{"description":"Id of an existing media file which should be replaced with the new upload","type":"integer"},"updateInLayouts":{"description":"Flag (0, 1), set to 1 to update this media in all layouts (use with oldMediaId) ","type":"integer"},"deleteOldRevisions":{"description":"Flag (0 , 1), to either remove or leave the old file revisions (use with oldMediaId)","type":"integer"},"tags":{"description":"Comma separated string of Tags that should be assigned to uploaded Media","type":"string"},"expires":{"description":"Date in Y-m-d H:i:s format, will set expiration date on the uploaded Media","type":"string"},"playlistId":{"description":"A playlistId to add this uploaded media to","type":"integer"},"widgetFromDt":{"description":"Date in Y-m-d H:i:s format, will set widget start date. Requires a playlistId.","type":"string"},"widgetToDt":{"description":"Date in Y-m-d H:i:s format, will set widget end date. Requires a playlistId.","type":"string"},"deleteOnExpiry":{"description":"Flag (0, 1), set to 1 to remove the Widget from the Playlist when the widgetToDt has been reached","type":"integer"},"applyToMedia":{"description":"Flag (0, 1), set to 1 to apply the widgetFromDt as the expiry date on the Media","type":"integer"},"folderId":{"description":"Folder ID to which this object should be assigned to","type":"integer"}},"type":"object"}}}},"responses":{"200":{"description":"successful operation"}}}}}}
```

## Library search by ID

> Get the Media object specified by the provided mediaId

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/{mediaId}":{"get":{"tags":["library"],"summary":"Library search by ID","description":"Get the Media object specified by the provided mediaId","operationId":"librarySearchById","parameters":[{"name":"mediaId","in":"path","description":"Numeric ID of the Media to get","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```

## Edit Media

> Edit a Media Item in the Library

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/{mediaId}":{"put":{"tags":["library"],"summary":"Edit Media","description":"Edit a Media Item in the Library","operationId":"libraryEdit","parameters":[{"name":"mediaId","in":"path","description":"The Media ID to Edit","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["name","duration","retired"],"properties":{"name":{"description":"Media Item Name","type":"string"},"duration":{"description":"The duration in seconds for this Media Item","type":"integer"},"retired":{"description":"Flag indicating if this media is retired","type":"integer"},"tags":{"description":"Comma separated list of Tags","type":"string"},"updateInLayouts":{"description":"Flag indicating whether to update the duration in all Layouts the Media is assigned to","type":"integer"},"expires":{"description":"Date in Y-m-d H:i:s format, will set expiration date on the Media item","type":"string"},"folderId":{"description":"Folder ID to which this media should be assigned to","type":"integer"}},"type":"object"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```

## Delete Media

> Delete Media from the Library

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/{mediaId}":{"delete":{"tags":["library"],"summary":"Delete Media","description":"Delete Media from the Library","operationId":"libraryDelete","parameters":[{"name":"mediaId","in":"path","description":"The Media ID to Delete","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["forceDelete"],"properties":{"forceDelete":{"description":"If the media item has been used should it be force removed from items that uses it?","type":"integer"},"purge":{"description":"Should this Media be added to the Purge List for all Displays?","type":"integer"}},"type":"object"}}}},"responses":{"204":{"description":"successful operation"}}}}}}
```

## Library Search All

> Search all library files from local and connectors

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/search":{"get":{"tags":["library"],"summary":"Library Search All","description":"Search all library files from local and connectors","operationId":"librarySearchAll","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}}}}}},"components":{"schemas":{"SearchResult":{"properties":{"title":{},"description":{},"thumbnail":{},"source":{},"type":{},"id":{},"download":{},"fileSize":{},"width":{},"height":{},"orientation":{},"duration":{},"videoThumbnailUrl":{},"tags":{"type":"array","items":{"type":"string"}},"isFeatured":{}},"type":"object"}}}}
```

## Tidy Library

> Routine tidy of the library, removing unused files.

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/tidy":{"delete":{"tags":["library"],"summary":"Tidy Library","description":"Routine tidy of the library, removing unused files.","operationId":"libraryTidy","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"tidyGenericFiles":{"description":"Also delete generic files?","type":"integer"}},"type":"object"}}}},"responses":{"200":{"description":"successful operation"}}}}}}
```

## Download Media

> Download a Media file from the Library

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/download/{mediaId}/{type}":{"get":{"tags":["library"],"summary":"Download Media","description":"Download a Media file from the Library","operationId":"libraryDownload","parameters":[{"name":"mediaId","in":"path","description":"The Media ID to Download","required":true,"schema":{"type":"integer"}},{"name":"type","in":"path","description":"The Module Type of the Download","required":true,"schema":{"type":"string"}},{"name":"stream","in":"query","description":"Serve video/audio media with its real content type for inline streaming playback, rather than as an attachment download","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation","headers":{"X-Sendfile":{"description":"Apache Send file header - if enabled.","schema":{"type":"string"}},"X-Accel-Redirect":{"description":"nginx send file header - if enabled.","schema":{"type":"string"}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}}}}}
```

## Download Thumbnail

> Download thumbnail for a Media file from the Library

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/thumbnail/{mediaId}":{"get":{"tags":["library"],"summary":"Download Thumbnail","description":"Download thumbnail for a Media file from the Library","operationId":"libraryThumbnail","parameters":[{"name":"mediaId","in":"path","description":"The Media ID to Download","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation","headers":{"X-Sendfile":{"description":"Apache Send file header - if enabled.","schema":{"type":"string"}},"X-Accel-Redirect":{"description":"nginx send file header - if enabled.","schema":{"type":"string"}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}}}}}
```

## Tag Media

> Tag a Media with one or more tags

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/{mediaId}/tag":{"post":{"tags":["library"],"summary":"Tag Media","description":"Tag a Media with one or more tags","operationId":"mediaTag","parameters":[{"name":"mediaId","in":"path","description":"The Media Id to Tag","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["tag"],"properties":{"tag":{"description":"An array of tags","type":"array","items":{"type":"string"}}},"type":"object"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```

## Untag Media

> Untag a Media with one or more tags

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/{mediaId}/untag":{"post":{"tags":["library"],"summary":"Untag Media","description":"Untag a Media with one or more tags","operationId":"mediaUntag","parameters":[{"name":"mediaId","in":"path","description":"The Media Id to Untag","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["tag"],"properties":{"tag":{"description":"An array of tags","type":"array","items":{"type":"string"}}},"type":"object"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```

## Get Library Item Usage Report

> Get the records for the library item usage report

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/usage/{mediaId}":{"get":{"tags":["library"],"summary":"Get Library Item Usage Report","description":"Get the records for the library item usage report","operationId":"libraryUsageReport","parameters":[{"name":"mediaId","in":"path","description":"The Media Id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation"}}}}}}
```

## Get Library Item Usage Report for Layouts

> Get the records for the library item usage report for Layouts

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/usage/layouts/{mediaId}":{"get":{"tags":["library"],"summary":"Get Library Item Usage Report for Layouts","description":"Get the records for the library item usage report for Layouts","operationId":"libraryUsageLayoutsReport","parameters":[{"name":"mediaId","in":"path","description":"The Media Id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation"}}}}}}
```

## Copy Media

> Copy a Media, providing a new name and tags if applicable

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/copy/{mediaId}":{"post":{"tags":["library"],"summary":"Copy Media","description":"Copy a Media, providing a new name and tags if applicable","operationId":"mediaCopy","parameters":[{"name":"mediaId","in":"path","description":"The media ID to Copy","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["name"],"properties":{"name":{"description":"The name for the new Media","type":"string"},"tags":{"description":"The Optional tags for new Media","type":"string"}},"type":"object"}}}},"responses":{"201":{"description":"successful operation","headers":{"Location":{"description":"Location of the new record","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```

## Media usage check

> Checks if a Media is being used

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/{mediaId}/isused/":{"get":{"tags":["library"],"summary":"Media usage check","description":"Checks if a Media is being used","operationId":"mediaIsUsed","parameters":[{"name":"mediaId","in":"path","description":"The Media Id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation"}}}}}}
```

## Upload Media from URL

> Upload Media to CMS library from an external URL

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/uploadUrl":{"post":{"tags":["library"],"summary":"Upload Media from URL","description":"Upload Media to CMS library from an external URL","operationId":"uploadFromUrl","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["url","type"],"properties":{"url":{"description":"The URL to the media","type":"string"},"type":{"description":"The type of the media, image, video etc","type":"string"},"extension":{"description":"Optional extension of the media, jpg, png etc. If not set in the request it will be retrieved from the headers","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics, On, Off or Inherit.","type":"string"},"optionalName":{"description":"An optional name for this media file, if left empty it will default to the file name","type":"string"},"expires":{"description":"Date in Y-m-d H:i:s format, will set expiration date on the Media item","type":"string"},"folderId":{"description":"Folder ID to which this media should be assigned to","type":"integer"}},"type":"object"}}}},"responses":{"201":{"description":"successful operation","headers":{"Location":{"description":"Location of the new record","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```

## Media Select folder

> Select Folder for Media

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"library","description":"Library"}],"servers":[{"url":"/api"}],"paths":{"/library/{id}/selectfolder":{"put":{"tags":["library"],"summary":"Media Select folder","description":"Select Folder for Media","operationId":"librarySelectFolder","parameters":[{"name":"id","in":"path","description":"The Media ID","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"folderId":{"description":"Folder ID to which this object should be assigned to","type":"integer"}},"type":"object"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}}}}},"components":{"schemas":{"Media":{"description":"Class Media","properties":{"mediaId":{"description":"The Media ID","type":"integer"},"ownerId":{"description":"The ID of the User that owns this Media","type":"integer"},"parentId":{"description":"The Parent ID of this Media if it has been revised","type":"integer"},"name":{"description":"The Name of this Media","type":"string"},"mediaType":{"description":"The module type of this Media","type":"string"},"storedAs":{"description":"The file name of the media as stored in the library","type":"string"},"fileName":{"description":"The original file name as it was uploaded","type":"string"},"tags":{"description":"Tags associated with this Media, array of TagLink objects","type":"array","items":{"$ref":"#/components/schemas/TagLink"}},"fileSize":{"description":"The file size in bytes","type":"integer"},"duration":{"description":"The duration to use when assigning this media to a Layout widget","type":"integer"},"valid":{"description":"Flag indicating whether this media is valid.","type":"integer"},"moduleSystemFile":{"description":"DEPRECATED: Flag indicating whether this media is a system file or not","type":"integer"},"expires":{"description":"Timestamp indicating when this media should expire","type":"integer"},"retired":{"description":"Flag indicating whether this media is retired","type":"integer"},"isEdited":{"description":"Flag indicating whether this media has been edited and replaced with a newer file","type":"integer"},"md5":{"description":"A MD5 checksum of the stored media file","type":"string"},"owner":{"description":"The username of the User that owns this media","type":"string"},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Media","type":"string"},"released":{"description":"A flag indicating whether this media has been released","type":"integer"},"apiRef":{"description":"An API reference","type":"string"},"createdDt":{"description":"The datetime the Media was created","type":"string"},"modifiedDt":{"description":"The datetime the Media was last modified","type":"string"},"enableStat":{"description":"The option to enable the collection of Media Proof of Play statistics","type":"string"},"orientation":{"description":"The orientation of the Media file","type":"string"},"width":{"description":"The width of the Media file","type":"integer"},"height":{"description":"The height of the Media file","type":"integer"},"folderId":{"description":"The id of the Folder this Media belongs to","type":"integer"},"permissionsFolderId":{"description":"The id of the Folder responsible for providing permissions for this Media","type":"integer"}},"type":"object"},"TagLink":{"properties":{"tag":{"description":"The Tag","type":"string"},"tagId":{"description":"The Tag ID","type":"integer"},"value":{"description":"The Tag Value","type":"string"}},"type":"object"}}}}
```


---

# 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/library.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.
