--- title: Media Library --- ## Get a Single Media Library Entry **Required scope:** `public-api:read` Fetch a Media Library Entries by its `id`. **History** | Version | Change | | ------- | ------ | | release-2020-10 | Initial support. | **Endpoint** ```http GET /api/2026-05/mediaLibrary/{id} ``` **Response** _200 OK_ — `/api/2026-05/mediaLibrary/{id}` ```json { "id": "asze63i9", "version": 1, "mediaType": "image", "asset": { "url": "https://livingdocs.io/img.jpg", "mimeType": "image/jpeg", "width": 1600, "height": 900, "size": 21000 }, "metadata": { "title": "An Image" }, "createdAt": "2020-12-27T09:19:00.928Z", "updatedAt": "2020-12-27T09:19:00.928Z" } ``` ## Patch a Media Library Entry **Required scope:** `public-api:write` Patch a Media Library Entry by its `id`. **Use Cases** - Enhancing MediaLibraryEntries. For example, update the metadata after transcoding a video or analyzing the media with an external service. - When having a separate DAM - update Livingdocs Media Library Entry **History** | Version | Change | | ------- | ------ | | release-2026-05 | Added `addUsageLogEntry`, `updateUsageLogEntry` and `removeUsageLogEntry` operations. | | release-2026-03 | Added `preserveUpdatedAt` parameter. When set to `true`, the entry's `updated_at` timestamp is not modified. This is useful for imports and migrations where the original timestamps should be preserved. | | release-2026-01 | Added `unrevokeAsset` operation.
Added the `note` property to be used with the `revokeAsset` operation. | | release-2024-01 | Added `removeAsset` operation. | | release-2022-03 | Added `replaceAsset` operation. | | release-2020-12 | Initial support. | **Curl Example** ```bash ACCESS_TOKEN=ey1234 curl -k -X PATCH "https://server.livingdocs.io/api/2026-05/mediaLibrary/{id}" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` **Endpoint** ```http PATCH /api/2026-05/mediaLibrary/{id} ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | version | string | | current mediaLibraryEntry version. When set on update the version is checked. | | preserveUpdatedAt | boolean | | Added in: [`release-2026-03`](/operations/releases/release-2026-03/)

When set to `true`, the entry's `updated_at` timestamp is not modified by the patch operation. By default (`false`), `updated_at` is set to the current time.

This is useful for imports and migrations where the original timestamps should be preserved to maintain correct sort order. | | patches | array | x | An array of patches to execute. Each entry is an object with the following keys:
- **operation**
- `setMetadataProperty`
- `archive`
- `replaceAsset`
- `removeAsset`
- `revokeAsset`
- `unrevokeAsset` (Added in: [`release-2026-01`](/operations/releases/release-2026-01/))
- `addUsageLogEntry` (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- `updateUsageLogEntry` (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- `removeUsageLogEntry` (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- **propertyName** string of the propertyName (only for setMetadataProperty)
- **value** string or object for the new value. If set to null or value is not set it will remove the property for setMetadataProperty. **required** for replaceAsset operation.
- **locale** string of the asset to be removed (only in multilingual setups for removeAsset)
- **note** optional string with a maximum length of 200 characters. Only supported by the `revokeAsset` operation. (Added in: [`release-2026-01`](/operations/releases/release-2026-01/))
- **usageLogEntryId** required string to identify the usage log entry to operate on. Only supported by the `updateUsageLogEntry` and `removeUsageLogEntry` operations. (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- **oldValue** optional object containing the previous usage log entry which must match for the operation to proceed. Only supported by the `updateUsageLogEntry` operation. (Added in: [`release-2026-05`](/operations/releases/release-2026-05/)) | **Example Request** ```js { "version": "1", // When true, the entry's updated_at timestamp is preserved "preserveUpdatedAt": true, "patches": [ { // update a single metadata property "operation": "setMetadataProperty", "propertyName": "title", "value": "updated title" }, { // replace the asset "operation": "replaceAsset", "value": { // the file with this key should exist in the configured storage key: '2021/11/23/my-new-file.png', url: 'https://example.com/my-new-file.png', size: 10000, width: 1000, height: 800, filename: 'my-new-file.png', mimeType: 'image/png' } }, { // revoke the asset "operation": "revokeAsset", "note": "Case #1" }, { // unrevoke the asset "operation": "unrevokeAsset" }, { // archives a Media Library Entry "operation": "archive" }, { // removes a translated asset (the default locale asset cannot be removed) "operation": "removeAsset", "locale": "en" }, // add a usage log entry { operation: 'addUsageLogEntry', value: { state: 'pending', // Optional 'pending' or 'confirmed' (default: 'pending') purpose: 'print', // Required handle of usage log purpose publicationDate: '2026-05-01T11:00:00.000Z', // Required when state is 'confirmed' url: 'http://localhost', // Optional link to external editor or delivery params: {} // Any value for params defined in the `paramsSchema` of the selected purpose } }, // update a usage log entry { operation: 'updateUsageLogEntry', usageLogEntryId: 'g1x419UgQSS5', value: { state: 'confirmed', // Required for updates purpose: 'print', publicationDate: '2026-05-01T11:00:00.000Z', url: 'http://localhost', params: { medium: 'Paper' } }, oldValue: {} // Optional expected state condition }, // remove a usage log entry { operation: 'removeUsageLogEntry', usageLogEntryId: 'g1x419UgQSS5' } ] } ``` **Response** _200 OK_ — `/api/2026-05/mediaLibrary/{id}` ```json { "status": 200 } ``` _400 Bad Request_ — `/api/2026-05/mediaLibrary/{id}` ```json { "status": 400, "error": "Bad Request", "error_details": { "patches.0.operation": "No enum match for: \"notExistingOperation\"" } } ``` _404 Not Found_ — `/api/2026-05/mediaLibrary/{id}` ```json { "status": 404, "error": "Not Found", "error_details": { "name": "NotFound", "message": "MediaLibrary Entry does not exist (id: 'yLBGtTjWN4ba')" } } ``` _409 Conflict_ — `/api/2026-05/mediaLibrary/{id}` ```json { "status": 409, "error": "Conflict", "error_details": { "name": "Conflict", "message": "Version: Expected 36 to be equal to 1" } } ``` ## Patch a Media Library Entry > [!NOTE] > This endpoint has changes in version 2026-03. > **Required scope:** `public-api:write` Patch a Media Library Entry by its `id`. **Use Cases** - Enhancing MediaLibraryEntries. For example, update the metadata after transcoding a video or analyzing the media with an external service. - When having a separate DAM - update Livingdocs Media Library Entry **History** | Version | Change | | ------- | ------ | | release-2026-05 | Added `addUsageLogEntry`, `updateUsageLogEntry` and `removeUsageLogEntry` operations. | | release-2026-01 | Added `unrevokeAsset` operation.
Added the `note` property to be used with the `revokeAsset` operation. | | release-2024-01 | Added `removeAsset` operation. | | release-2022-03 | Added `replaceAsset` operation. | | release-2020-12 | Initial support. | **Curl Example** ```bash ACCESS_TOKEN=ey1234 curl -k -X PATCH "https://server.livingdocs.io/api/2026-01/mediaLibrary/{id}" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` **Endpoint** ```http PATCH /api/2026-01/mediaLibrary/{id} ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | version | string | | current mediaLibraryEntry version. When set on update the version is checked. | | patches | array | x | An array of patches to execute. Each entry is an object with the following keys:
- **operation**
- `setMetadataProperty`
- `archive`
- `replaceAsset`
- `removeAsset`
- `revokeAsset`
- `unrevokeAsset` (Added in: [`release-2026-01`](/operations/releases/release-2026-01/))
- `addUsageLogEntry` (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- `updateUsageLogEntry` (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- `removeUsageLogEntry` (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- **propertyName** string of the propertyName (only for setMetadataProperty)
- **value** string or object for the new value. If set to null or value is not set it will remove the property for setMetadataProperty. **required** for replaceAsset operation.
- **locale** string of the asset to be removed (only in multilingual setups for removeAsset)
- **note** optional string with a maximum length of 200 characters. Only supported by the `revokeAsset` operation. (Added in: [`release-2026-01`](/operations/releases/release-2026-01/))
- **usageLogEntryId** required string to identify the usage log entry to operate on. Only supported by the `updateUsageLogEntry` and `removeUsageLogEntry` operations. (Added in: [`release-2026-05`](/operations/releases/release-2026-05/))
- **oldValue** optional object containing the previous usage log entry which must match for the operation to proceed. Only supported by the `updateUsageLogEntry` operation. (Added in: [`release-2026-05`](/operations/releases/release-2026-05/)) | **Example Request** ```js { "version": "1", "patches": [ { // update a single metadata property "operation": "setMetadataProperty", "propertyName": "title", "value": "updated title" }, { // replace the asset "operation": "replaceAsset", "value": { // the file with this key should exist in the configured storage key: '2021/11/23/my-new-file.png', url: 'https://example.com/my-new-file.png', size: 10000, width: 1000, height: 800, filename: 'my-new-file.png', mimeType: 'image/png' } }, { // revoke the asset "operation": "revokeAsset", "note": "Case #1" }, { // unrevoke the asset "operation": "unrevokeAsset" }, { // archives a Media Library Entry "operation": "archive" }, { // removes a translated asset (the default locale asset cannot be removed) "operation": "removeAsset", "locale": "en" }, // add a usage log entry { operation: 'addUsageLogEntry', value: { state: 'pending', // Optional 'pending' or 'confirmed' (default: 'pending') purpose: 'print', // Required handle of usage log purpose publicationDate: '2026-05-01T11:00:00.000Z', // Required when state is 'confirmed' url: 'http://localhost', // Optional link to external editor or delivery params: {} // Any value for params defined in the `paramsSchema` of the selected purpose } }, // update a usage log entry { operation: 'updateUsageLogEntry', usageLogEntryId: 'g1x419UgQSS5', value: { state: 'confirmed', // Required for updates purpose: 'print', publicationDate: '2026-05-01T11:00:00.000Z', url: 'http://localhost', params: { medium: 'Paper' } }, oldValue: {} // Optional expected state condition }, // remove a usage log entry { operation: 'removeUsageLogEntry', usageLogEntryId: 'g1x419UgQSS5' } ] } ``` **Response** _200 OK_ — `/api/2026-01/mediaLibrary/{id}` ```json { "status": 200 } ``` _400 Bad Request_ — `/api/2026-01/mediaLibrary/{id}` ```json { "status": 400, "error": "Bad Request", "error_details": { "patches.0.operation": "No enum match for: \"notExistingOperation\"" } } ``` _404 Not Found_ — `/api/2026-01/mediaLibrary/{id}` ```json { "status": 404, "error": "Not Found", "error_details": { "name": "NotFound", "message": "MediaLibrary Entry does not exist (id: 'yLBGtTjWN4ba')" } } ``` _409 Conflict_ — `/api/2026-01/mediaLibrary/{id}` ```json { "status": 409, "error": "Conflict", "error_details": { "name": "Conflict", "message": "Version: Expected 36 to be equal to 1" } } ``` ## Get Media Library Entries **Required scope:** `public-api:read` Fetch multiple Media Library Entries by their `id`s or `externalId`s **History** | Version | Change | | ------- | ------ | | release-2026-01 | Responds with an object containing a `results` array. | | release-2020-10 | Initial support. | **Endpoint** ```http GET /api/2026-05/mediaLibrary ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | ids | string | | Comma separated list of media library entry ids | | externalId | string | | External id of the media library entry | | systemName | string | | System name of the media library entry | **Response** _200 OK_ — `/api/2026-05/mediaLibrary?ids=asze63i9,2er11b3i` ```json { "results": [ { "id": "asze63i9", "version": 1, "mediaType": "image", "asset": { "url": "https://livingdocs.io/img.jpg", "mimeType": "image/jpeg", "width": 1600, "height": 900, "size": 21000 }, "metadata": { "title": "An Image" }, "createdAt": "2020-12-27T09:19:00.928Z", "updatedAt": "2020-12-27T09:19:00.928Z" }, { "id": "2er11b3i", "version": 1, "mediaType": "image", "asset": { "url": "https://livingdocs.io/img2.jpg", "mimeType": "image/jpeg", "width": 1600, "height": 900, "size": 21000 }, "metadata": { "title": "An Other Image" }, "createdAt": "2020-12-27T09:19:00.928Z", "updatedAt": "2020-12-27T09:19:00.928Z" } ] } ``` _200 OK_ — `/api/2026-05/mediaLibrary?externalId=ex-1&systemName=externalSystem` ```json { "results": [ { "id": "a77ei8nm", "version": 1, "systemName": "externalSystem", "externalId": "ex-1", "mediaType": "image", "asset": { "url": "https://livingdocs.io/img.jpg", "mimeType": "image/jpeg", "width": 1600, "height": 900, "size": 21000 }, "metadata": { "title": "An Image" }, "createdAt": "2020-12-27T09:19:00.928Z", "updatedAt": "2020-12-27T09:19:00.928Z" } ] } ``` ## Get Media Library Entries > [!NOTE] > This endpoint has changes in version 2026-01. > **Required scope:** `public-api:read` Fetch multiple Media Library Entries by their `id`s or `externalId`s **History** | Version | Change | | ------- | ------ | | release-2020-10 | Initial support. | **Endpoint** ```http GET /api/2025-11/mediaLibrary ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | ids | string | | Comma separated list of media library entry ids | | externalId | string | | External id of the media library entry | | systemName | string | | System name of the media library entry | **Response** _200 OK_ — `/api/2025-11/mediaLibrary?ids=asze63i9,2er11b3i` ```json { "mediaLibraryEntries": [ { "id": "asze63i9", "version": 1, "mediaType": "image", "asset": { "url": "https://livingdocs.io/img.jpg", "mimeType": "image/jpeg", "width": 1600, "height": 900, "size": 21000 }, "metadata": { "title": "An Image" }, "createdAt": "2020-12-27T09:19:00.928Z", "updatedAt": "2020-12-27T09:19:00.928Z" }, { "id": "2er11b3i", "version": 1, "mediaType": "image", "asset": { "url": "https://livingdocs.io/img2.jpg", "mimeType": "image/jpeg", "width": 1600, "height": 900, "size": 21000 }, "metadata": { "title": "An Other Image" }, "createdAt": "2020-12-27T09:19:00.928Z", "updatedAt": "2020-12-27T09:19:00.928Z" } ] } ``` _200 OK_ — `/api/2025-11/mediaLibrary?externalId=ex-1&systemName=externalSystem` ```json { "mediaLibraryEntries": [ { "id": "a77ei8nm", "version": 1, "systemName": "externalSystem", "externalId": "ex-1", "mediaType": "image", "asset": { "url": "https://livingdocs.io/img.jpg", "mimeType": "image/jpeg", "width": 1600, "height": 900, "size": 21000 }, "metadata": { "title": "An Image" }, "createdAt": "2020-12-27T09:19:00.928Z", "updatedAt": "2020-12-27T09:19:00.928Z" } ] } ``` ## Get Incoming Publication References for a Media Library Entry **Required scope:** `public-api:read` This endpoint returns all publications which link to this Media Library Entry (via content or metadata) **Use Cases** - Useful to know if the Media Library Entry is in use when revoking or archiving **History** | Version | Change | | ------- | ------ | | release-2026-01 | Responds with an object containing a `results` array, the `total` number of results, and a `cursor` for pagination. | **Curl Example** ```bash ACCESS_TOKEN=ey1234 curl -k -X GET "https://server.livingdocs.io/api/2026-05/mediaLibrary/{mediaId}/incomingDocumentReferences" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` **Endpoint** ```http GET /api/2026-05/mediaLibrary/{mediaId}/incomingDocumentReferences ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | mediaId | string | x | | | ?limit | integer | | A limit for how much published documents to retrieve. Defaults to 100. Max. 100. | | ?offset | integer | | An offset into the query. Useful when getting more than 100 results (pagination). | | ?after | string | | The `cursor` provided in the response can be passed back for pagination instead of using `offset`. | **Response** _200 OK_ ```json { "total": 5, "cursor": "eyJhIjpbIjE3NjUyNjIxODYuMjgyIiw2NCw2NF19", "results": [ { "id": 2, "references": [ { "id": "9fKagDCiN6sb", "type": "image", "location": "image-directive", "componentId": "doc-1ev8345oj0", "componentName": "image", "directiveName": "image" }, { "id": "9fKagDCiN6sb", "type": "image", "location": "metadata", "propertyName": "teaserImage" } ] }, { "id": 3, "references": [ { "id": "9fKagDCiN6sb", "type": "image", "location": "image-directive", "componentId": "doc-1euq8lq1o0", "componentName": "image", "directiveName": "image" }, { "id": "9fKagDCiN6sb", "type": "image", "location": "metadata", "propertyName": "teaserImage" } ] } ] } ``` ## Get Incoming Publication References for a Media Library Entry > [!NOTE] > This endpoint has changes in version 2026-01. > **Required scope:** `public-api:read` This endpoint returns all publications which link to this Media Library Entry (via content or metadata) **Use Cases** - Useful to know if the Media Library Entry is in use when revoking or archiving **Curl Example** ```bash ACCESS_TOKEN=ey1234 curl -k -X GET "https://server.livingdocs.io/api/2025-11/mediaLibrary/{mediaId}/incomingDocumentReferences" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` **Endpoint** ```http GET /api/2025-11/mediaLibrary/{mediaId}/incomingDocumentReferences ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | mediaId | string | x | | | ?limit | integer | | A limit for how much published documents to retrieve. Defaults to 100. Max. 100. | | ?offset | integer | | An offset into the query. Useful when getting more than 100 results (pagination). | **Response** _200 OK_ ```json [ { "id": 2, "references": [ { "id": "9fKagDCiN6sb", "type": "image", "location": "image-directive", "componentId": "doc-1ev8345oj0", "componentName": "image", "directiveName": "image" }, { "id": "9fKagDCiN6sb", "type": "image", "location": "metadata", "propertyName": "teaserImage" } ] }, { "id": 3, "references": [ { "id": "9fKagDCiN6sb", "type": "image", "location": "image-directive", "componentId": "doc-1euq8lq1o0", "componentName": "image", "directiveName": "image" }, { "id": "9fKagDCiN6sb", "type": "image", "location": "metadata", "propertyName": "teaserImage" } ] } ] ``` ## Get Incoming Media References for a Media Library Entry **Required scope:** `public-api:read` This endpoint returns all Media Library Entries which link to this Media Library Entry (via metadata) **History** | Version | Change | | ------- | ------ | | release-2026-01 | Responds with an object containing a `results` array, the `total` number of results, and a `cursor` for pagination. | **Curl Example** ```bash ACCESS_TOKEN=ey1234 curl -k -X GET "https://server.livingdocs.io/api/2026-05/mediaLibrary/{mediaId}/incomingMediaReferences" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` **Endpoint** ```http GET /api/2026-05/mediaLibrary/{mediaId}/incomingMediaReferences ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | mediaId | string | x | | | ?limit | integer | | A limit for how much published documents to retrieve. Defaults to 100. Max. 100. | | ?offset | integer | | An offset into the query. Useful when getting more than 100 results (pagination). | | ?after | string | | The `cursor` provided in the response can be passed back for pagination instead of using `offset`. | **Response** _200 OK_ ```json { "total": 5, "cursor": "eyJhIjpbIjE3NjUyNjIxODYuMjgyIiw2NCw2NF19", "results": [ { "id": "B1LPgANhJFpo", "references": [ { "id": "9fKagDCiN6sb", "type": "image", "location": "metadata", "propertyName": "imageLink" } ] } ] } ``` ## Get Incoming Media References for a Media Library Entry > [!NOTE] > This endpoint has changes in version 2026-01. > **Required scope:** `public-api:read` This endpoint returns all Media Library Entries which link to this Media Library Entry (via metadata) **Curl Example** ```bash ACCESS_TOKEN=ey1234 curl -k -X GET "https://server.livingdocs.io/api/2025-11/mediaLibrary/{mediaId}/incomingMediaReferences" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` **Endpoint** ```http GET /api/2025-11/mediaLibrary/{mediaId}/incomingMediaReferences ``` **Parameters** | Name | Type | Required | Notes | | ---- | ---- | :------: | ----- | | mediaId | string | x | | | ?limit | integer | | A limit for how much published documents to retrieve. Defaults to 100. Max. 100. | | ?offset | integer | | An offset into the query. Useful when getting more than 100 results (pagination). | **Response** _200 OK_ ```json [ { "id": "B1LPgANhJFpo", "references": [ { "id": "9fKagDCiN6sb", "type": "image", "location": "metadata", "propertyName": "imageLink" } ] } ] ``` ## Serve Image **Required scope:** `public-api:read` This endpoint delivers an image in its original dimensions, provided the asset remains valid (i.e., not revoked or marked as invalid). It is designed to serve as a reliable source for image proxies or resizing services, ensuring only authorized and valid images are accessible. **History** | Version | Change | | ------- | ------ | | release-2025-03 | Initial support. | **Curl Example** ```bash ACCESS_TOKEN=ey1234 curl -k -X GET "https://server.livingdocs.io/api/2026-05/mediaLibrary/serve-image/2025/03/14/c316ace8-0ded-4e41-9388-386a5759c01f.jpeg" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` **Endpoint** ```http GET /api/2026-05/mediaLibrary/serve-image/{key} ``` **Response** _200 OK_ — `/api/2026-05/mediaLibrary/serve-image/2025/03/14/c316ace8-0ded-4e41-9388-386a5759c01f.jpeg` ```json binary ``` ## Get the Usage Log of a Media Library Entry **Required scope:** `public-api:read` Fetch the Usage Log of a Media Library Entry. **History** | Version | Change | | ------- | ------ | | release-2026-05 | Initial support. | **Endpoint** ```http GET /api/2026-05/mediaLibrary/{id}/usageLog ``` **Response** _200 OK_ — `/api/2026-05/mediaLibrary/{id}/usageLog` ```json { "results": [ { "id": "g6Hmp49Y", "url": "https://example.com/article/slug-121", "state": "confirmed", "params": { "medium": "Internet" }, "purpose": "web", "documentId": 121, "publicationId": 110, "reportingDate": "2026-04-02T13:34:30.263Z", "publicationDate": "2026-04-02T13:34:26.353Z" } ] } ``` ## Get All Media Library Entry Keys **Required scope:** `public-api:read` Fetch all asset keys (including variants) for a Media Library Entry. Useful for cache purging when image caches are handled by external systems. **History** | Version | Change | | ------- | ------ | | release-2026-03 | Initial support. | **Endpoint** ```http GET /api/2026-05/mediaLibrary/{id}/keys ``` **Response** _200 OK_ — `/api/2026-05/mediaLibrary/{id}/keys` ```json { "results": [ "my/key.jpg", "my/replaced-key.jpg", "my/translated-key.jpg", "v/my/variant-key.webp" ] } ```