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 |
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? } | Build a branch's latest pushed commit (the production branch by default) |
POST /projects/:ref/deployments/upload?environment=preview | Build an uploaded .tar.gz of the project (Content-Type: application/gzip) |
POST /projects/:ref/rollback | Roll production back |
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 | Rebuild |
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 |
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 |