Skip to main content
GET
Project Builds

List Project Builds

string
required
The unique identifier of the project (MongoDB ObjectId)

Authentication

Requires JWT authentication via the verifyJWT middleware.

Response

boolean
required
Indicates whether the request was successful
number
required
Total number of builds for this project. Returns totalBuilds from project document if available, otherwise returns the count of builds in the response.
array
required
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

string
required
The unique identifier of the project (MongoDB ObjectId)
string
required
The unique identifier of the build (MongoDB ObjectId)

Response

boolean
required
Indicates whether the request was successful
object
required
Detailed build information

Example Request

Example Response


Error Responses

Returned when the project doesn’t exist, doesn’t belong to the user, or has been deleted
Returned when the build doesn’t exist or doesn’t belong to the specified project
Returned when a server error occurs

Implementation Notes

List Builds

  • Returns up to 50 most recent builds
  • Builds are sorted by createdAt in 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 dockerImage field which is not returned in the list endpoint
  • Returns additional build metadata for debugging and analysis

Build Status Flow

  1. pending - Build is created and queued
  2. success or failed - Build completes with final status
  3. startedAt is set when build processing begins
  4. finishedAt is set when build completes (success or failure)
  • To trigger a new build, use the redeploy endpoint: POST /api/redeploy/:projectId
  • Build logs can be accessed via the logUrl field
  • 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