Project Builds
Projects
Project Builds
Retrieve build history and individual build details for a project
GET
Project Builds
List Project Builds
The unique identifier of the project (MongoDB ObjectId)
Authentication
Requires JWT authentication via theverifyJWT middleware.
Response
Indicates whether the request was successful
Total number of builds for this project. Returns
totalBuilds from project document if available, otherwise returns the count of builds in the response.Array of build objects, sorted by creation date (newest first), limited to 50 most recent builds
Example Request
Example Response
Get Build by ID
Retrieve detailed information about a specific build.Path Parameters
The unique identifier of the project (MongoDB ObjectId)
The unique identifier of the build (MongoDB ObjectId)
Response
Indicates whether the request was successful
Detailed build information
Example Request
Example Response
Error Responses
404 Not Found - Project
Returned when the project doesn’t exist, doesn’t belong to the user, or has been deleted
404 Not Found - Build
Returned when the build doesn’t exist or doesn’t belong to the specified project
500 Internal Server Error
Returned when a server error occurs
Implementation Notes
List Builds
- Returns up to 50 most recent builds
- Builds are sorted by
createdAtin descending order (newest first) - Only selects relevant fields to minimize response size
- Verifies project ownership before returning builds
- Uses
.lean()for optimized read-only queries
Get Build by ID
- Verifies that the build belongs to the specified project
- Verifies project ownership through the project lookup
- Includes
dockerImagefield which is not returned in the list endpoint - Returns additional build metadata for debugging and analysis
Build Status Flow
- pending - Build is created and queued
- success or failed - Build completes with final status
startedAtis set when build processing beginsfinishedAtis set when build completes (success or failure)
Related Endpoints
- To trigger a new build, use the redeploy endpoint:
POST /api/redeploy/:projectId - Build logs can be accessed via the
logUrlfield - The most recent build is also included in the project overview endpoint
Source Reference
- List builds:
backend/src/controllers/slices/Project/Buildscontroller.js:4 - Get build by ID:
backend/src/controllers/slices/Project/Buildscontroller.js:32 - Build model:
backend/src/models/slices/build.model.js:3