updateWidgetPreviewImage
PUT
/api/v1/widgets/{id}/preview-image
const url = 'https://example.com/api/v1/widgets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/preview-image';const options = {method: 'PUT', headers: {'Content-Type': 'image/jpeg'}, body: 'binary'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/widgets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/preview-image \ --header 'Content-Type: image/jpeg' \ --data binaryStores the frozen image captured from the actual Widget editor render. Requires an editor-capable dashboard session and CSRF token. The server accepts only a 960 by 540 JPEG no larger than 500 KB; Widget configuration updates clear the prior snapshot so stale renders are never shown.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Query Parameters
Section titled “Query Parameters”renderedUpdatedAt
string format: date-time
The Widget asset updatedAt the image was rendered from. When present and the Widget has changed since, the server refuses the image with 409 widget_preview_stale. Omit it to store unconditionally.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeimage/jpeg
string format: binary
Responses
Section titled “ Responses ”Widget preview image stored
Widget not found
The Widget changed after the preview was rendered (widget_preview_stale)
Preview image exceeds 500 KB
Preview is not a valid 960 by 540 JPEG