/v1/workspaces/{workspace_slug}/avatar/from-url/previewAuthPreview the workspace image a website or image address would set
Fetches the address and returns the image it would set, without saving anything. An image address is used as is; for a web page, its best icon is used (apple-touch-icon, the largest `<link rel="icon">` or SVG icon, web app manifest icons, then `/favicon.ico`; square and at least 64 px preferred). Fetching is https only, to public addresses only (re-checked on every redirect, at most 4), 5 s per request, at most 2 MB; the format is read from the bytes (PNG, JPEG, WebP, GIF first frame, ICO, SVG rasterised; an SVG with script or external references is refused). Gated by `workspace.settings.update`.
Path parameters
workspace_slug*stringSlug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve("acme")`); the product APIs bind `workspace_id` instead.
Request body
url*string · uriA website or an image address. An image is used as is; for a page, its icon is used (apple-touch-icon, then `<link rel="icon">`, then the web app manifest, then `/favicon.ico`). `https://` is assumed when no scheme is given, and `http://` is upgraded to `https://`.
Example: "https://acme.com"
Response · 200 What the address resolves to.
source_url*string · uriThe address that was given, normalised (https, no fragment). Saved as `avatar_source_url` when the image is set.
Example: "https://acme.com/"
image_url*string · uriThe image that was found: the address itself, or the icon found on that page.
Example: "https://acme.com/apple-touch-icon.png"
source_kind*objectWhere the image came from. Open enum: new values may be added.
Example: "apple_touch_icon"
site_host*stringHost of the site the image came from (after redirects), for copy like "Found the icon of acme.com".
Example: "acme.com"
width*numberWidth in px of the image as it will be stored (at most 512).
Example: 180
height*numberHeight in px of the image as it will be stored (at most 512).
Example: 180
preview_data_url*stringThe image exactly as it will be stored (webp), as a `data:` URL, so a preview needs no second request.
Example: "data:image/webp;base64,UklGR…"
Example
Request
POST https://api.platform-auth.productcraft.co/v1/workspaces/{workspace_slug}/avatar/from-url/preview
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"url": "https://acme.com"
}Response
{
"source_url": "https://acme.com/",
"image_url": "https://acme.com/apple-touch-icon.png",
"source_kind": "apple_touch_icon",
"site_host": "acme.com",
"width": 180,
"height": 180,
"preview_data_url": "data:image/webp;base64,UklGR…"
}