Get a preview
Request the preview of a project’s latest version:-H "Authorization: Bearer YOUR_TOKEN" with a token that has the streams:read scope.
The paths keep the server’s original words:
branches for models and commits for versions.
URL-encode the / in a nested model name.
Other images of the same preview
Add an angle segment to the end of any path, such as/preview/{projectId}/spin, and
?postprocess=og for a 1200×627 Open Graph image with the project name over the preview. Which
angles exist depends on the server:
A key the preview does not have returns a placeholder with
X-Preview-Error-Code: ANGLE_NOT_FOUND.
When there is no preview yet
The endpoints always answer with an image. A project, model, or version without a preview gets a placeholder PNG, and the first request for an object without a preview queues its render. While a render is queued, running, or failed, the response carriesX-Preview-Error: true and an
X-Preview-Error-Code, and it is not cached. Check that header rather than the status code if your
app needs to know whether it got a real preview.
Errors differ by server. Speckle Cloud and Speckle Enterprise Server answer with the error status
(401, 403, 404) and a placeholder image. The open-source Speckle Server answers 200 with an
error image, so check the image, not the status.