Skip to content

Read the configured preview variant ladder

GET
/previews

The rungs the operator has configured — the key, fit and longest-edge of every preview variant this install generates.

This is the companion to ladder_available (#591). That flag says a given asset HAS the whole ladder; this says what the ladder IS. A client needs both to build a responsive srcset: the keys become /assets/{id}/variants/{key} URLs and max_dim becomes the Nw width descriptor. Without this endpoint a client would have to hardcode the four default keys, which is exactly the assumption the flag exists to remove — an install that tuned its ladder would serve 404s.

GOVERNED BY PUBLIC MODE (#445), like /assets and /collections: anonymous on a public install, 401 on a private one. It is NOT open to anonymous callers unconditionally, and it is deliberately NOT excused the way /appearance is. The difference is what each endpoint is for — fonts render the login card, so an install that refused them anonymously could not draw its own sign-in page, whereas nothing before sign-in needs image rungs. The first consumer is the browse grid, which on a private install is already behind auth. So this endpoint follows the content it describes rather than being treated as boot-critical when it is not.

The registration and the full reasoning live in auth.PublicSurfaceRoutes — that table, not this description, is what the gate actually reads.

What it exposes on a PUBLIC install is the install’s own image-pipeline configuration: no asset, no user, no access decision.

The configured ladder, in the operator’s order

The preview variants this install generates, in configured order. See getPublicPreviewLadder.

object
variants
required
Array<object>
object
key
required

Variant key — the {key} in /assets/{id}/variants/{key}. Operator-defined, so do NOT assume the default set (col / preview / screen / hires).

string
fit
required

cover CROPS to a square of max_dim; contain preserves aspect ratio within max_dim. The distinction is load-bearing for layout: the default col rung is a 320x320 COVER crop, so a client wanting the true aspect ratio must use a contain rung, not col.

string
Allowed values: cover contain
max_dim
required

Longest edge in pixels. Doubles as the Nw width descriptor in a srcset for contain rungs.

integer
format
string
Allowed values: webp jpeg png