Get an artifact preview - Spacefast Docs
Get an artifact preview
The cached raster snapshot for a commit, as an image response.
GET /v1/artifacts/{ref}/preview
Authorization
Authorization Bearer token · header required
Authorization: Bearer <key>with the Space key (sfc_prefix) of an unclaimed Space. The same key is the fragment of the claim URL and the token in the Space's/_/__/<key>sign-in URL.
or
AuthorizationBearer token · header requiredAuthorization: Bearer <token>with an API key (sfa_prefix), an OAuth access token, a session token, or a Space machine credential (sfm_prefix).
or
AuthorizationOAuth2 access token · header requiredOAuth 2.0 with Spacefast scopes. People use the authorization code flow; machines use client credentials.
Scopes: connectors:read
Path parameters
refstring required
Query parameters
teamstring (min length 1)commitShastring required (min length 1)
Responses
- 200 The artifact preview, as an image.
- 404 No preview cached for that commit.
Try it
Server
Base URL https://api.spacefast.com
Custom base URL Overrides the selected server when set.
Request
cURL
curl -X GET "https://api.spacefast.com/v1/artifacts/string/preview?commitSha=string" \
-H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.spacefast.com/v1/artifacts/string/preview?commitSha=string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
Python
import requests
response = requests.get(
"https://api.spacefast.com/v1/artifacts/string/preview?commitSha=string",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)
Response
200
The artifact preview, as an image.404
No preview cached for that commit.