Check a managed source before building - Spacefast Docs
Check a managed source before building
Returns whether the named managed source can trigger a build. wordpress is the only source: sourceUrl must match a WordPress data source configured on the Space, and the Space’s connected repository must have finished syncing. Nothing about that repository or its builds is returned.
API Endpoint
GET /v1/spaces/{spaceId}/builds/preflight
Authorization
Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).
Path parameters
spaceIdstring required
Query parameters
sourcestring required
Allowed:wordpresssourceUrlstringrequired
min length 1 · max length 2048 · matches^https://[^/?#@%\s]+(?:/[^?#\s]*)?$
Responses
200 Response for status 200
{
"$schema": "string<uri>",
"data": {
"ready": true
}
}
Default Error Response
{
"$schema": "string<uri>",
"type": "string",
"title": "string",
"status": -9007199254740991,
"detail": "string",
"code": "string",
"pointer": "string",
"details": {
"property1": null,
"property2": null
},
"suggestions": ["string"],
"next": ["string"],
"requestId": "string"
}
Examples
Request
curl -X GET "https://api.spacefast.com/v1/spaces/string/builds/preflight?source=wordpress&sourceUrl=http%3A%2F%2Fexample.com" \
-H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.spacefast.com/v1/spaces/string/builds/preflight?source=wordpress&sourceUrl=http%3A%2F%2Fexample.com", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
Python
import requests
response = requests.get(
"https://api.spacefast.com/v1/spaces/string/builds/preflight?source=wordpress&sourceUrl=http%3A%2F%2Fexample.com",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)