Skip to main content
A build record is created automatically when you push to a connected branch or create a new project. These two endpoints let you interact with builds directly: re-run any build using its original commit hash, and fetch the current state of a specific build. Both endpoints verify that the build’s project belongs to the authenticated user before responding.

POST /api/build/rebuild/:buildId

Re-runs the build pipeline using the commit hash recorded on an existing build. A new build record is inserted with status: "queued" and the pipeline starts immediately in the background. The original build record is not modified. Requires JWT. The rebuild copies the original build’s commit, branch, commitAuthor, commitHash, and projectId into the new record. This means a rebuild is always tied to the same snapshot of the repository — it does not re-fetch the latest commit.

Path parameters

number
required
Numeric ID of the existing build to re-run. Build IDs are returned in the builds array of GET /api/project/projects.

Curl example

Response

The server responds immediately with the new build record. The actual pipeline runs asynchronously after the response is sent.

Response fields

object
The newly created build record.
number
Unique ID of the new build. Use this to poll GET /api/build/:buildId or subscribe to buildStatusUpdate Socket.io events.
string
Initial status. Always queued immediately after creation.
string
The commit hash that will be checked out for this build — identical to the original build’s hash.
number | null
null until the build completes. On completion, 0 means the build passed; any non-zero value means it failed.
Rebuild runs asynchronously. Monitor progress in real time by subscribing to the buildStatusUpdate Socket.io event, filtering by the new build’s id. The event is emitted each time the build status changes (queued → running → passed/failed).

Error responses


GET /api/build/:buildId

Fetches a single build record by ID, including the nested project details. Use this to check a build’s final status and exit code after it completes, or to retrieve a snapshot of a build’s metadata. Requires JWT.

Path parameters

number
required
Numeric ID of the build to fetch.

Curl example

Response

Response fields

object
The build record.
number
Unique build ID.
string
Current build status. One of queued, running, passed, or failed.
string
The commit message from the triggering push.
string
Branch the build was triggered on.
string
Name of the commit author as reported by GitHub.
string
Full SHA of the commit that was checked out for this build.
number | null
Exit code of the build container. null while the build is running. 0 on success; any other value indicates a failure.
number
ID of the project this build belongs to.
string
ISO 8601 timestamp of when the build record was created.
string | null
ISO 8601 timestamp of when the build completed. null while running.

Error responses