Management API
Automate Clouzark over HTTP.
The CLI and MCP server are built on this API; anything they do, you can do with plain HTTP.
https://api.clouzark.com/v1Authentication
Send a team access token, created under the team's Settings → Access Tokens (or by clouzark login):
curl https://api.clouzark.com/v1/me -H "Authorization: Bearer cz_pat_..."A token acts with its creator's current role in the team. Requests and responses are JSON, errors are { "error": "..." }, and each token can make 120 requests a minute. Wherever a path has :ref, pass a project's slug or id.
Account
| Request | |
|---|---|
GET /me | User, team, role, and token expiry |
DELETE /tokens/current | Revoke the calling token |
Hosting projects
| Request | |
|---|---|
GET /projects | List projects |
GET /projects/:ref | One project, including runtime_memory_mb (its instance size, null for the platform default) and the resulting runtime_limits |
PATCH /projects/:ref { runtime_memory_mb } | Set the instance size: 512, 1024, 2048, 4096, or null. Owner role. Returns { project, runtime_limits_applied: { updated, skipped } } |
POST /projects { repo, name?, root_directory?, framework?, production_branch?, install_command?, build_command?, output_directory? } | Import a GitHub repo (owner/name) and queue its first production build; returns { project, deployment_id } |
GET /projects/:ref/deployments?limit=20 | Recent deployments |
POST /projects/:ref/deployments { branch?, skip_build_cache? } | Build a branch's latest pushed commit (the production branch by default) |
POST /projects/:ref/deployments/upload?environment=preview&skip_build_cache=false | Build an uploaded .tar.gz of the project (Content-Type: application/gzip) |
POST /projects/:ref/rollback | Roll production back |
POST /projects/:ref/repository/sync | Re-read the repo from GitHub and follow a rename or transfer to its current URL. A project ref (and app URL) made from the old repo name moves to one made from the new name, and the old app URL redirects to it. Deployer role. Returns { project, changed, previous_repo_url, previous_ref, previous_url } |
GET /deployments/:id?log_offset=0 | Deployment status, plus build log from log_offset |
POST /deployments/:id/promote | Promote to production |
POST /deployments/:id/redeploy { skip_build_cache? } | Rebuild; skip_build_cache: true builds without the build cache |
POST /deployments/:id/cancel | Cancel a queued deployment |
A deployment's status is one of queued, building, deploying, live, failed, canceled, or stopped; done is true once it stops changing. To follow a build, poll GET /deployments/:id and pass the previous log_length as log_offset.
Environment variables
| Request | |
|---|---|
GET /projects/:ref/env | Names and targets |
GET /projects/:ref/env/values?environment=preview | Resolved values for one environment |
POST /projects/:ref/env { key, value, target } | Add or update |
DELETE /projects/:ref/env/:key?target=all | Remove |
Domains
| Request | |
|---|---|
GET /projects/:ref/domains | Domains, with the DNS records each needs |
POST /projects/:ref/domains { hostname } | Add |
POST /projects/:ref/domains/:hostname/verify | Check DNS |
DELETE /projects/:ref/domains/:hostname | Remove |
App cron jobs
Cron jobs are addressed by :job, the job's name or id. Creating, changing, deleting, and running jobs needs the deployer role. A job with source: "config" comes from clouzark.json: it only accepts enabled, and can't be deleted.
| Request | |
|---|---|
GET /projects/:ref/cron-jobs | Jobs, each with source (config or api), next_run_at, and last_run |
GET /projects/:ref/cron-jobs/:job | One job |
POST /projects/:ref/cron-jobs { name, path, schedule, method?, timezone?, timeout_seconds?, retries?, enabled? } | Add a job. method defaults to GET, timezone to UTC, timeout_seconds to 60 (at most 300), retries to 0 (at most 3). Returns { cron_job } |
PATCH /projects/:ref/cron-jobs/:job { name?, path?, schedule?, method?, timezone?, timeout_seconds?, retries?, enabled? } | Change only the fields sent; enabled: false pauses the job |
DELETE /projects/:ref/cron-jobs/:job | Delete the job and its runs |
POST /projects/:ref/cron-jobs/:job/run | Call the path now and wait; returns { run: { id, status, status_code, attempts, duration_ms, message } } |
GET /projects/:ref/cron-jobs/:job/runs?limit=20 | Recent runs, newest first |
Database projects
| Request | |
|---|---|
GET /database-projects | List databases |
GET /database-projects/:ref | One database |
POST /database-projects { name } | Create |
DELETE /database-projects/:ref | Delete permanently |
POST /database-projects/:ref/query { sql, read_only? } | Run SQL; returns { command, row_count, fields, rows, duration_ms } |
GET /database-projects/:ref/migrations | Applied migrations |
POST /database-projects/:ref/migrations { version, name, sql } | Apply a migration. version is YYYYMMDDHHMMSS; re-sending the same SQL is a no-op, different SQL for an applied version is a 409 |
GET /database-projects/:ref/types/typescript | { types } |
GET /database-projects/:ref/keys | { rest_url, anon_key, service_key } |
GET /database-projects/:ref/credentials | Host, port, database, username, password, and connection string |
Database cron jobs
Cron jobs are addressed by :job, the job's name or id. Creating, changing, deleting, and running jobs needs the deployer role.
| Request | |
|---|---|
GET /database-projects/:ref/cron-jobs | Jobs, each with next_run_at and last_run |
GET /database-projects/:ref/cron-jobs/:job | One job |
POST /database-projects/:ref/cron-jobs { name, schedule, command, timezone?, timeout_seconds?, enabled? } | Add a job. schedule is 5-field cron; timezone defaults to UTC, timeout_seconds to 60 (at most 300). Returns { cron_job } |
PATCH /database-projects/:ref/cron-jobs/:job { name?, schedule?, command?, timezone?, timeout_seconds?, enabled? } | Change only the fields sent; enabled: false pauses the job |
DELETE /database-projects/:ref/cron-jobs/:job | Delete the job and its runs |
POST /database-projects/:ref/cron-jobs/:job/run | Run now and wait; returns { run: { id, status, duration_ms, message } } |
GET /database-projects/:ref/cron-jobs/:job/runs?limit=20 | Recent runs, newest first |