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.
General Settings
Update General Settings
PATCH /api/projects/:id/settings/general
Update project name, branch, and folder configuration.
Project display name (trimmed automatically)
Git branch to deploy from (default: “main”)
Configuration for monorepo or subfolder deploymentsProperties:
enabled(boolean): Whether to deploy from a subfoldername(string): Subfolder path (required ifenabledis true)
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.
Command to build the project (for static projects)Examples:
npm run build, yarn build, pnpm buildOutput directory after build (for static projects)Examples:
dist, build, out, .nextCommand to start the server (for Node.js projects)Examples:
node server.js, npm start, yarn startPort the application listens on (for Node.js projects)Must match the port in your application code
Build Configuration by Project Type
Static Projects
Required:
buildCommandpublishDir
Node Projects
Required:
startCommandport
Environment Variables
Update Environment Variables
PATCH /api/projects/:id/settings/env
Set or update environment variables for the project.
Key-value pairs of environment variables. Must be an object (not an array).Empty keys are not allowed and will return a 400 error.
Environment Variable Storage
Environment variables are stored as a MongoDB Map:- 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’.
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
- 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 usesrunValidators: true and context: 'query' to ensure proper validation: