Extend preview expiry

Re-up a preview page's expiration, keeping the same URL. Defaults to the caller's current plan TTL; pass `expiresInSeconds` to choose a shorter lifetime (the plan TTL is a hard ceiling — longer requests are clamped). Works on live previews and on previews that have already expired (expired pages keep their stored content; only serving is blocked). Applies to preview-rendering assets created by `publish_page` — download assets are not time-gated at the serving layer and cannot be extended.

Authentication

AuthorizationBearer
API key or Clerk session token

Path parameters

assetIdstringRequired

Asset ID (e.g. “asset_01k…”). A trailing file extension (“.html”) is ignored.

Request

This endpoint expects an object.
expiresInSecondsdoubleOptional

New lifetime in seconds (positive integer). Capped at the plan’s preview TTL — shorter is honored, longer is clamped. Omit for the plan default.

Response

Expiry extended
assetIdstring
The asset ID that was extended.
expiresAtstring or null

New expiration timestamp (ISO 8601). null = permanent (plan grants no-expiry previews).

expiresIndouble or null

Seconds until the new expiration. null = permanent.

renderingenum
urlstring

The public URL of the asset (unchanged by extension).

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
410
Gone Error
500
Internal Server Error
503
Service Unavailable Error