API Reference

Projects & Deploys

Create, deploy, and manage projects over the REST API.

Deploy and manage projects programmatically. Authenticate with an API key (X-API-Key: sm_live_...) — a deploy-scoped key is enough for everything here.

The deploy lifecycle

  1. Create a project (from a git repo, a prebuilt image, or an upload)
  2. Set env vars (optional)
  3. Deploy — builds (if needed) and starts the container
  4. Poll the project until status is running or failed

List projects

GET/api/v1/projects

Create a project

POST/api/v1/projects

From a GitHub repo:

{ "name": "api", "subdomain": "api", "repo_url": "https://github.com/you/api.git", "github_repo": "you/api", "branch": "main" }

From a prebuilt image (no build — docker pull + run):

{ "name": "proxy", "subdomain": "proxy", "image": "nginx:alpine" }

From an upload: create with "deploy_source": "upload", then POST a .tar.gz build context to /api/v1/projects/:id/upload before deploying.

The response is the project object, including its id.

Set environment variables

PUT/api/v1/projects/:id
{ "env_vars": { "DATABASE_URL": "postgres://...", "NODE_ENV": "production" } }

Advanced build settings

PUT/api/v1/projects/:id/build-config
{ "install_cmd": "npm ci", "build_cmd": "npm run build", "start_cmd": "npm start", "root_dir": "apps/web", "port_override": 3000 }

Multiple services (one container)

Deploy several directories of a monorepo as services inside a single container. Pass a services array to the build-config endpoint — the primary app keeps the project's port + subdomain, and each service gets a flat sibling subdomain (<subdomain>-<name>.deployzy.app):

{  "services": [    { "name": "api", "root_dir": "apps/api", "port": 4000, "install_cmd": "npm ci", "build_cmd": "npm run build", "start_cmd": "npm start", "env_overrides": { "SERVICE_MODE": "api" } },    { "name": "worker", "root_dir": "worker", "port": 4001, "start_cmd": "node worker.js" }  ]}

Names must be lowercase DNS-safe labels, unique, with unique ports (max 5 services). Omit services (or send []) for a single-service project.

Deploy

POST/api/v1/projects/:id/deploy

Logs & status

GET/api/v1/projects/:id
GET/api/v1/projects/:id/logs

project.status moves through building → running (or failed).

Stop / delete

POST/api/v1/projects/:id/stop
DELETE/api/v1/projects/:id

End-to-end (curl)

KEY=sm_live_...# 1. Create from a repoPID=$(curl -s -X POST https://api.deployzy.com/api/v1/projects \  -H "X-API-Key: $KEY" -H "Content-Type: application/json" \  -d '{"name":"api","subdomain":"api","repo_url":"https://github.com/you/api.git","github_repo":"you/api","branch":"main"}' \  | jq -r .id)# 2. Deploycurl -s -X POST https://api.deployzy.com/api/v1/projects/$PID/deploy -H "X-API-Key: $KEY"# 3. Poll statuscurl -s https://api.deployzy.com/api/v1/projects/$PID -H "X-API-Key: $KEY" | jq -r .project.status
Prefer a client library? See the JavaScript and Python SDKs, or the `deployzy deploy` CLI.

Was this page helpful?