Skip to main content

Overview

Project settings are divided into three categories: general settings, build settings, and environment variables. Each can be updated independently through dedicated endpoints.

Get Project Settings

GET /api/projects/:id/settings

Retrieve all project settings including general, build, and environment configuration.
Authentication Required: Yes (JWT) Response:

General Settings

Update General Settings

PATCH /api/projects/:id/settings/general

Update project name, branch, and folder configuration.
Authentication Required: Yes (JWT) Request Body:
string
Project display name (trimmed automatically)
string
Git branch to deploy from (default: “main”)
object
Configuration for monorepo or subfolder deploymentsProperties:
  • enabled (boolean): Whether to deploy from a subfolder
  • name (string): Subfolder path (required if enabled is true)
Example Request:
Response:
Folder Validation: If folder.enabled is true, folder.name must be provided. The validator will return an error if the name is missing.

Settings Schema

The settings object in the project model:

Build Settings

Update Build Settings

PATCH /api/projects/:id/settings/build

Update build commands and configuration based on project type.
Authentication Required: Yes (JWT) Request Body:
string
Command to build the project (for static projects)Examples: npm run build, yarn build, pnpm build
string
Output directory after build (for static projects)Examples: dist, build, out, .next
string
Command to start the server (for Node.js projects)Examples: node server.js, npm start, yarn start
number
Port the application listens on (for Node.js projects)Must match the port in your application code
Example for Static Project:
Example for Node Project:
Response:

Build Configuration by Project Type

Static Projects

Required:
  • buildCommand
  • publishDir
Internal Port: 80

Node Projects

Required:
  • startCommand
  • port
Port: User-defined

Environment Variables

Update Environment Variables

PATCH /api/projects/:id/settings/env

Set or update environment variables for the project.
Authentication Required: Yes (JWT) Request Body:
object
required
Key-value pairs of environment variables. Must be an object (not an array).Empty keys are not allowed and will return a 400 error.
Example Request:
Response:

Environment Variable Storage

Environment variables are stored as a MongoDB Map:
Key Points:
  • Variables are converted to a Map internally: new Map(Object.entries(env))
  • When retrieved, the Map is converted back to a plain object
  • All values are stored as strings
  • Empty or whitespace-only keys are rejected
Complete Replacement: This endpoint replaces all environment variables. To preserve existing variables, include them in your request along with any new or updated variables.

Reading Environment Variables

Environment variables are returned in the GET settings response:

Delete Project

DELETE /api/projects/:id

Soft-delete a project by setting its status to ‘deleted’.
Authentication Required: Yes (JWT) Response:
Soft Delete: Projects are not permanently removed from the database. The status is set to 'deleted', and they are excluded from all queries that filter by status: { $ne: 'deleted' }.

Error Responses

400 Bad Request

404 Not Found

Returned when:
  • Project ID doesn’t exist
  • Project doesn’t belong to authenticated user
  • Project status is ‘deleted’

500 Server Error

Example: Update All Settings

Settings Update Context

The general settings endpoint uses runValidators: true and context: 'query' to ensure proper validation:
This ensures the folder name validator runs correctly when updating settings.