Builds API

Builds

Trigger builds, check status, and download artifacts programmatically.

List Builds

Retrieve a list of all builds for a project.

GET/projects/:projectId/builds

Request

curl -X GET https://api.deskforge.app/projects/proj_abc123/builds \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "builds": [
    {
      "id": "build_xyz789",
      "projectId": "proj_abc123",
      "version": "1.0.0",
      "platform": "mac",
      "arch": "arm64",
      "status": "success",
      "createdAt": "2024-01-20T10:00:00Z",
      "completedAt": "2024-01-20T10:15:00Z",
      "artifactUrl": "https://cdn.deskforge.app/builds/..."
    }
  ],
  "total": 1
}

Get Build

Retrieve details for a specific build.

GET/builds/:buildId

Request

curl -X GET https://api.deskforge.app/builds/build_xyz789 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "id": "build_xyz789",
  "projectId": "proj_abc123",
  "version": "1.0.0",
  "platform": "mac",
  "arch": "arm64",
  "status": "success",
  "createdAt": "2024-01-20T10:00:00Z",
  "startedAt": "2024-01-20T10:01:00Z",
  "completedAt": "2024-01-20T10:15:00Z",
  "duration": 840,
  "artifactUrl": "https://cdn.deskforge.app/builds/build_xyz789/MyApp-1.0.0-mac-arm64.dmg",
  "artifactSize": 45678912,
  "buildLog": "https://api.deskforge.app/builds/build_xyz789/logs"
}

Trigger Build

Start a new build for a project.

POST/projects/:projectId/builds

Request Body

platformstring (required)

Target platform: "mac", "windows", or "linux"

archstring (optional)

Architecture: "x64" or "arm64" (defaults to "x64")

versionstring (optional)

Semantic version (e.g., "1.0.0")

Request

curl -X POST https://api.deskforge.app/projects/proj_abc123/builds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "mac",
    "arch": "arm64",
    "version": "1.0.0"
  }'

Response

{
  "id": "build_xyz789",
  "projectId": "proj_abc123",
  "platform": "mac",
  "arch": "arm64",
  "version": "1.0.0",
  "status": "queued",
  "createdAt": "2024-01-20T10:00:00Z",
  "message": "Build queued successfully"
}

Build Status

Builds can have the following statuses:

queued

Build is waiting to start

building

Build is in progress

success

Build completed successfully

failed

Build failed with errors

Download Artifact

Download the build artifact (installer/executable).

GET/builds/:buildId/download

Request

curl -X GET https://api.deskforge.app/builds/build_xyz789/download \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -L -o MyApp-1.0.0-mac-arm64.dmg

Note: The download URL is also available in the artifactUrl field when getting build details.

Build Logs

Retrieve build logs for debugging.

GET/builds/:buildId/logs

Request

curl -X GET https://api.deskforge.app/builds/build_xyz789/logs \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "buildId": "build_xyz789",
  "logs": [
    {
      "timestamp": "2024-01-20T10:01:00Z",
      "level": "info",
      "message": "Starting build process..."
    },
    {
      "timestamp": "2024-01-20T10:02:30Z",
      "level": "info",
      "message": "Compiling Rust code..."
    },
    {
      "timestamp": "2024-01-20T10:15:00Z",
      "level": "success",
      "message": "Build completed successfully"
    }
  ]
}