Deploy
API, CLI and CI deploys
API tokens with scopes, the REST API v1, and deploying from GitHub Actions or GitLab CI; links to the zefily CLI and AI agents (MCP) guides.
Three ways to work with Zefily outside the panel, all with an API token:
- REST API — for your own scripts and tools (below). Its OpenAPI 3.1 description is public: download the spec (YAML, no token needed) and load it into any API client or code generator.
- Zefily CLI — the
zefilycommand for your terminal and CI pipelines: installation on Linux, macOS and Windows. - AI agents (MCP) — let Claude, Cursor or VS Code list your servers and sites and deploy, with your passkey approving each change.
API tokens
Create a token under Settings → API tokens: a Name, an expiry (Expires after a number of days, or Never expires) and the Scopes it may use. The token is shown once — copy it into your CI secrets. It acts as you, with your role in the organization, limited to its scopes. The list shows when each token was created and last used; Revoke token disables it at once. Tokens work only while your email address is verified: after you change it, verify the new one in the panel and your tokens work again (until then the API answers 403).
| Scope | Allows |
|---|---|
servers:read |
List servers and their state |
sites:read |
List sites and their settings, deploy settings, access and rules, and the one-click apps (GET /apps); read what a container keeps outside its volumes |
sites:write |
Create, change and delete sites, write a site's .env file, change its access and rules, open or close Vaultwarden sign-ups, create an app administrator, keep a container's data, and run WordPress tools (with the panel's validation) |
sites:deploy |
Start deploys and rollbacks (and discard a container's layer data on them); install one-click apps (with sites:write); change a container image or Compose file; change deploy settings and deploy options; the upgrade flag; choose an import's database dump |
jobs:read |
Follow jobs: a deploy's, or a server's recent ones |
variables:read |
List shared variables (names, groups and the sites that use them; never values) |
variables:write |
Create, change and delete shared variables |
backups:read |
List backup plans and list their snapshots |
backups:write |
Create, change and delete backup plans; run and test them |
backups:restore |
Restore files and databases from a snapshot |
webhooks:read |
List outgoing webhooks (their address, events and state; never the signing secret) |
webhooks:write |
Create, change, delete and test outgoing webhooks |
processes:read |
List server cron entries and daemons, and a site's workers and cron entries (never their commands) |
processes:write |
Create, change, delete, run and restart cron entries, daemons and site workers. A command also needs sites:deploy |
servers:write |
Add a server (POST /servers) and issue its enrollment token; server operations: install package updates, start, stop or restart services, install or remove PHP versions, change firewall rules; list and purge the agent trash. Each change waits for your passkey where the panel asks |
monitoring:read |
List uptime checks and the site incident timeline |
monitoring:write |
Create, change and delete uptime checks (owners and admins only, as in the panel) |
databases:read |
List a server's databases: name, engine and owner (never the password) |
databases:write |
Create and delete databases. Deleting waits for your passkey, as in the panel |
files:read |
Browse and read a site's files, inside the site's folder |
files:write |
Write and delete a site's files, inside the site's folder |
Requests per minute per token depend on your plan:
| Plan | API requests per minute (per token) |
|---|---|
| Free | No API access |
| Starter | 125 |
| Pro | 160 |
| Business | 190 |
| Agency | 240 |
A request over the limit gets 429 Too Many Requests with a Retry-After header, the number of seconds to wait before you try again.
Tick Require my passkey approval for every change to put a token in approval mode: every deploy, rollback or other job it requests waits on your dashboard until you approve it with your approval passkey. Reading is not affected. Use it for tokens you give to AI agents.
Legal acceptance and API tokens
When a material change to the legal documents takes effect and the token's owner has not accepted it yet, every API response carries Deprecation (RFC 9745), a Link with rel="deprecation" to the acceptance page and X-Legal-Acceptance-Required. Requests still work. See Legal documents and acceptance.
REST API v1
Base URL https://app.zefily.com/api/v1, with the token as a Bearer token:
curl -H "Authorization: Bearer $ZEFILY_TOKEN" https://app.zefily.com/api/v1/servers
| Method and path | Scope |
|---|---|
GET /servers |
servers:read |
GET /servers/{server} |
servers:read |
POST /servers |
servers:write |
POST /servers/{server}/enrollment-token |
servers:write |
GET /apps |
sites:read |
GET /servers/{server}/sites |
sites:read |
POST /servers/{server}/sites |
sites:write |
POST /servers/{server}/apps |
sites:write and sites:deploy |
GET /servers/{server}/sites/{site} |
sites:read |
PUT /servers/{server}/sites/{site} |
sites:write (and sites:deploy when image or compose_file changes) |
PATCH /servers/{server}/sites/{site} |
sites:write (and sites:deploy when image or compose_file changes) |
DELETE /servers/{server}/sites/{site} |
sites:write |
PUT /servers/{server}/sites/{site}/env |
sites:write |
GET /servers/{server}/sites/{site}/access |
sites:read |
PUT /servers/{server}/sites/{site}/access |
sites:write |
GET /servers/{server}/sites/{site}/rules |
sites:read |
PUT /servers/{server}/sites/{site}/rules |
sites:write |
PUT /servers/{server}/sites/{site}/vaultwarden-signups |
sites:write |
POST /servers/{server}/sites/{site}/app-admin |
sites:write |
POST /servers/{server}/sites/{site}/layer-data |
sites:read |
POST /servers/{server}/sites/{site}/layer-keep |
sites:write |
PUT /servers/{server}/sites/{site}/published-ports |
sites:write |
PUT /servers/{server}/sites/{site}/container-port |
sites:write |
PUT /servers/{server}/sites/{site}/container-socket |
sites:write |
PUT /servers/{server}/sites/{site}/compose |
sites:deploy |
PATCH /servers/{server}/sites/{site}/deploy/settings |
sites:deploy |
PATCH /servers/{server}/sites/{site}/deploy/options |
sites:deploy |
GET /servers/{server}/sites/{site}/wordpress/policy |
sites:read |
PUT /servers/{server}/sites/{site}/wordpress/policy |
sites:write |
DELETE /servers/{server}/sites/{site}/wordpress/policy |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/update |
sites:deploy |
POST /servers/{server}/sites/{site}/wordpress/plugins |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/search-replace |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/db-cleanup |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/integrity |
sites:read |
POST /servers/{server}/sites/{site}/wordpress/integrity/repair |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/debug-log |
sites:read |
POST /servers/{server}/sites/{site}/wordpress/permissions |
sites:write |
GET /servers/{server}/sites/{site}/wordpress/staging-refresh |
sites:read |
PUT /servers/{server}/sites/{site}/wordpress/staging-refresh |
sites:write |
DELETE /servers/{server}/sites/{site}/wordpress/staging-refresh |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/manage |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/sync |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/optimize |
sites:write |
PUT /servers/{server}/sites/{site}/wordpress/litespeed-cache |
sites:write |
POST /servers/{server}/sites/{site}/deploy |
sites:deploy |
POST /servers/{server}/sites/{site}/rollback |
sites:deploy |
POST /servers/{server}/site-imports |
sites:deploy |
GET /servers/{server}/site-imports/{siteImport} |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/archive |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/archive/{upload}/chunk |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/archive/{upload}/finish |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/analyze |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/archive-dump |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/host-key |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/proposal |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/copy |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/finish |
sites:deploy |
POST /servers/{server}/site-imports/{siteImport}/cancel |
sites:deploy |
GET /variables |
variables:read |
POST /variables |
variables:write |
PATCH /variables/{variable} |
variables:write |
DELETE /variables/{variable} |
variables:write |
GET /servers/{server}/backup-plans |
backups:read |
POST /servers/{server}/backup-plans |
backups:write |
PATCH /servers/{server}/backup-plans/{backupPlan} |
backups:write |
DELETE /servers/{server}/backup-plans/{backupPlan} |
backups:write |
POST /servers/{server}/backup-plans/{backupPlan}/run |
backups:write |
POST /servers/{server}/backup-plans/{backupPlan}/test |
backups:write |
POST /servers/{server}/backup-plans/{backupPlan}/snapshots |
backups:read |
POST /servers/{server}/backup-plans/{backupPlan}/restore |
backups:restore |
POST /servers/{server}/backup-plans/{backupPlan}/restore-database |
backups:restore |
GET /webhooks |
webhooks:read |
POST /webhooks |
webhooks:write |
PATCH /webhooks/{webhook} |
webhooks:write |
DELETE /webhooks/{webhook} |
webhooks:write |
POST /webhooks/{webhook}/test |
webhooks:write |
GET /servers/{server}/cron |
processes:read |
POST /servers/{server}/cron |
processes:write and sites:deploy |
PATCH /servers/{server}/cron/{cronJob} |
processes:write (and sites:deploy for a new command) |
DELETE /servers/{server}/cron/{cronJob} |
processes:write |
POST /servers/{server}/cron/{cronJob}/run |
processes:write |
GET /servers/{server}/daemons |
processes:read |
POST /servers/{server}/daemons |
processes:write and sites:deploy |
PATCH /servers/{server}/daemons/{daemon} |
processes:write (and sites:deploy for a new command) |
DELETE /servers/{server}/daemons/{daemon} |
processes:write |
POST /servers/{server}/daemons/{daemon}/action |
processes:write |
GET /servers/{server}/sites/{site}/processes |
processes:read |
POST /servers/{server}/sites/{site}/processes/workers |
processes:write and sites:deploy |
PATCH /servers/{server}/sites/{site}/processes/workers/{worker} |
processes:write (and sites:deploy for a new command) |
DELETE /servers/{server}/sites/{site}/processes/workers/{worker} |
processes:write |
POST /servers/{server}/sites/{site}/processes/cron |
processes:write and sites:deploy |
PATCH /servers/{server}/sites/{site}/processes/cron/{entry} |
processes:write (and sites:deploy for a new command) |
DELETE /servers/{server}/sites/{site}/processes/cron/{entry} |
processes:write |
GET /servers/{server}/sites/{site}/tls |
sites:read |
PUT /servers/{server}/sites/{site}/tls |
sites:write |
POST /servers/{server}/sites/{site}/tls/renew |
sites:write |
PUT /servers/{server}/sites/{site}/tls/force-https |
sites:write |
GET /servers/{server}/updates |
servers:read |
POST /servers/{server}/updates/check |
servers:write |
POST /servers/{server}/updates/apply |
servers:write |
GET /servers/{server}/services |
servers:read |
POST /servers/{server}/services/action |
servers:write |
GET /servers/{server}/php |
servers:read |
POST /servers/{server}/php |
servers:write |
DELETE /servers/{server}/php/{version} |
servers:write |
GET /servers/{server}/firewall |
servers:read |
POST /servers/{server}/firewall/rules |
servers:write |
DELETE /servers/{server}/firewall/rules/{position} |
servers:write |
POST /servers/{server}/trash/list |
servers:write |
POST /servers/{server}/trash/purge |
servers:write |
GET /monitoring/checks |
monitoring:read |
GET /monitoring/incidents |
monitoring:read |
POST /monitoring/checks |
monitoring:write |
PATCH /monitoring/checks/{check} |
monitoring:write |
DELETE /monitoring/checks/{check} |
monitoring:write |
GET /servers/{server}/sites/{site}/dns/records |
sites:read |
POST /servers/{server}/sites/{site}/dns/records |
sites:write |
PUT /servers/{server}/sites/{site}/dns/records/{record} |
sites:write |
DELETE /servers/{server}/sites/{site}/dns/records/{record} |
sites:write |
GET /servers/{server}/databases |
databases:read |
POST /servers/{server}/databases |
databases:write |
DELETE /servers/{server}/databases/{database} |
databases:write |
GET /servers/{server}/sites/{site}/files |
files:read |
GET /servers/{server}/sites/{site}/files/content |
files:read |
PUT /servers/{server}/sites/{site}/files/content |
files:write |
DELETE /servers/{server}/sites/{site}/files/content |
files:write |
POST /servers/{server}/sites/{site}/aliases |
sites:write |
DELETE /servers/{server}/sites/{site}/aliases |
sites:write |
POST /servers/{server}/checks |
servers:write |
POST /servers/{server}/databases/{database}/copy |
databases:write |
POST /servers/{server}/databases/{database}/export |
databases:write |
POST /servers/{server}/databases/{database}/import |
databases:write |
POST /servers/{server}/databases/{database}/query |
databases:read |
PUT /servers/{server}/databases/{database}/remote |
databases:write |
POST /servers/{server}/databases/{database}/rotate |
databases:write |
PUT /servers/{server}/databases/{database}/password |
databases:write |
POST /servers/{server}/disk/analyze |
servers:write |
POST /servers/{server}/disk/cleanup |
servers:write |
PUT /servers/{server}/firewall |
servers:write |
POST /servers/{server}/node |
servers:write |
POST /servers/{server}/object-cache |
servers:write |
POST /servers/{server}/php-extensions |
servers:write |
POST /servers/{server}/python |
servers:write |
POST /servers/{server}/runtimes |
servers:write |
DELETE /servers/{server}/runtimes/{runtime}/{version} |
servers:write |
POST /servers/{server}/services/refresh |
servers:write |
POST /servers/{server}/sites/{site}/artisan |
sites:deploy |
PUT /servers/{server}/sites/{site}/cache |
sites:write |
PUT /servers/{server}/sites/{site}/cache-exclude |
sites:write |
POST /servers/{server}/sites/{site}/cache/purge |
sites:write |
POST /servers/{server}/sites/{site}/database |
sites:write |
POST /servers/{server}/sites/{site}/database/apply |
sites:write |
POST /servers/{server}/sites/{site}/deploy/check |
sites:read |
POST /servers/{server}/sites/{site}/deploy/hook |
sites:deploy |
POST /servers/{server}/sites/{site}/image-check |
sites:deploy |
PUT /servers/{server}/sites/{site}/image-updates |
sites:deploy |
POST /servers/{server}/sites/{site}/laravel |
sites:deploy |
POST /servers/{server}/sites/{site}/logs |
sites:read |
GET /servers/{server}/sites/{site}/move |
sites:read |
POST /servers/{server}/sites/{site}/move |
sites:deploy |
POST /servers/{server}/sites/{site}/move/cancel |
sites:deploy |
POST /servers/{server}/sites/{site}/move/delete-old-copy |
sites:deploy |
POST /servers/{server}/sites/{site}/move/put-back |
sites:deploy |
POST /servers/{server}/sites/{site}/move/switch |
sites:deploy |
PUT /servers/{server}/sites/{site}/nginx |
sites:write |
GET /servers/{server}/sites/{site}/nginx |
sites:read (operate role) |
GET /servers/{server}/sites/{site}/nginx/versions |
sites:read |
POST /servers/{server}/sites/{site}/nginx/versions/{version}/restore |
sites:write |
PUT /servers/{server}/sites/{site}/object-cache |
sites:write |
POST /servers/{server}/sites/{site}/octane |
sites:deploy |
PUT /servers/{server}/sites/{site}/ols |
sites:write |
GET /servers/{server}/sites/{site}/ols |
sites:read (operate role) |
GET /servers/{server}/sites/{site}/ols/versions |
sites:read |
POST /servers/{server}/sites/{site}/ols/versions/{version}/restore |
sites:write |
PUT /servers/{server}/sites/{site}/php |
sites:write |
POST /servers/{server}/sites/{site}/suspend |
sites:write |
POST /servers/{server}/sites/{site}/tls/certificate |
sites:write |
POST /servers/{server}/sites/{site}/tls/csr |
sites:write |
POST /servers/{server}/sites/{site}/unsuspend |
sites:write |
PUT /servers/{server}/sites/{site}/waf |
sites:write |
PUT /servers/{server}/sites/{site}/waf-exclude |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/clone |
sites:deploy |
PUT /servers/{server}/sites/{site}/wordpress/cron |
sites:write |
PUT /servers/{server}/sites/{site}/wordpress/hardening |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/hardening/recommended |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/hardening/undo |
sites:write |
PUT /servers/{server}/sites/{site}/wordpress/heartbeat |
sites:write |
POST /servers/{server}/sites/{site}/wordpress/login |
sites:write |
PUT /servers/{server}/sites/{site}/wordpress/login-roles |
sites:write |
POST /servers/{server}/stack |
servers:write |
POST /servers/{server}/stack/switch |
servers:write |
GET /servers/{server}/system-settings |
servers:read |
PUT /servers/{server}/system-settings |
servers:write |
GET /servers/{server}/users |
servers:read |
POST /servers/{server}/users |
servers:write |
DELETE /servers/{server}/users/{serverUser} |
servers:write |
PATCH /servers/{server}/users/{serverUser} |
servers:write |
POST /servers/{server}/users/{serverUser}/password |
servers:write |
POST /servers/{server}/users/{serverUser}/removal/cancel |
servers:write |
POST /servers/{server}/waf |
servers:write |
GET /servers/{server}/jobs |
jobs:read |
GET /jobs/{job} |
jobs:read |
Every write goes through the same checks as the panel (validation, plan limits, the audit log).
A site create or change answers with the site and job: the job the server runs for it (site.apply, or site.deploy when a one-click app is installed). Follow it with GET /jobs/{job}. PUT replaces every setting, so send the site's current values with your change; the Zefily CLI does that for you. DELETE answers 202 Accepted with the removal job; ?delete_files=1 deletes the files too (a job that waits for the owner's passkey), and ?delete_database=1 drops the linked database.
PATCH changes only the fields you send. PUT replaces the settings.
Secrets are write-only. A .env file, a shared variable's value and a backup plan's repository password can be written through the API, but no endpoint returns them. Reading them stays in the panel behind your password. A restore of a plan with its own encryption key uses the key file already on the server; enter its passphrase in the panel. A PUT .../env keeps a linked database's keys (DATABASE_URL and the DB_* keys) at the database's values: a file that leaves them out gets them back, and a different value you set for one of them is replaced. The reply's database_kept lists those keys.
The panel's site access, rules and app tools have API equivalents: PUT .../access (canonical host, basic auth, source allowlist), PUT .../rules (redirects, headers, protected folders, rate limit, blocks, countries) and POST .../app-admin (an administrator account in an installed app). GET on access and rules returns the settings without any password: a protected folder keeps its path and user names, and auth_password_set tells whether basic auth has a password. The write-only password of an app administrator is sent to the server in its job and never returned. A Vaultwarden site's sign-ups are switched with PUT .../vaultwarden-signups, a WordPress site is optimised with POST .../wordpress/optimize, and LiteSpeed Cache is switched with PUT .../wordpress/litespeed-cache.
POST /servers adds a server with the panel's Add server checks and returns its enrollment_token once: the agent on the server enrols with it. POST /servers/{server}/enrollment-token issues a new one, and the older unused ones stop working. An app install needs both sites:write and sites:deploy, because it creates a site and deploys it at once.
A WordPress or container site's writable-layer data is read with POST .../layer-data (the job lists what a redeploy would discard) and kept with POST .../layer-keep. Deploy and rollback accept discard_layer_data: true to go ahead with that data discarded, as the explicit choice the panel asks for. When the site first installs its runtime, the response has deploy_deferred: true and data is the job the deploy waits for; the deploy job is queued once that finishes.
Site lifecycle and server stack. Suspending a site needs an owner or an admin, as in the panel. A move copies the site first (sites:deploy); its switch, cancel, put-back and old-copy steps are the panel's, and deleting the old copy waits for your passkey. A web server switch waits for your passkey too. The lifecycle and configuration replies never return a database password, a deploy hook secret, a login user's password or a custom certificate's private key. A protected WordPress clone's password comes back once, in the clone's reply, and never again. A WordPress magic login link is returned once and works for 60 seconds. Account, team, billing and API token management stay in the panel by design.
A webhook's signing secret is returned once, by POST /webhooks, and no later reply carries it; rotating it stays in the panel, as do chat channels (Slack, Discord, Telegram, PagerDuty, Opsgenie), whose address is a secret.
A command that runs on the server (a cron entry, a daemon, a site worker) needs processes:write and sites:deploy; commands are never returned. A root or sudo cron entry or daemon waits for your passkey, as in the panel. The uploaded certificate and its key stay in the panel.
Server operations, monitoring, DNS, databases and files reuse the panel's actions. A PHP version is installed next to the ones installed; POST /updates/apply, a service restart and a firewall change are jobs, and a sensitive port or a database drop waits for your passkey. A firewall rule is identified by its position in GET /firewall, which changes when the rules are saved. A DNS record change needs the DNS account the customer connected, and PUT saves the whole record. File paths are relative to the site's folder (sites/<domain> under the site's user): a path that leaves that folder is refused, and reading or writing through a symbolic link (such as current) is refused by the agent. File contents are base64. The file manager needs the plan feature, as in the panel.
A heartbeat check's URL holds its secret: it is returned once, by POST /monitoring/checks. Database passwords are never returned; reveal one in the panel.
A restore waits for approval like the panel's: with a token in approval mode, or for a high-risk job such as a database restore, the job's state is awaiting_intent until you approve it in the panel.
The zefily CLI and AI agents
The Zefily CLI page explains how to install zefily on Linux, macOS and Windows, put it on your PATH and give it a token. AI agents (MCP) shows how to add it to Claude Code, Claude Desktop, Cursor, VS Code and other MCP clients.
Deploy from CI
Use a token with sites:read, sites:deploy and jobs:read, stored as a CI secret.
GitHub Actions:
deploy:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Deploy
env:
ZEFILY_TOKEN: ${{ secrets.ZEFILY_TOKEN }}
run: |
curl -fsSLo zefily https://dl.zefily.com/cli/zefily-linux-amd64
chmod +x zefily
./zefily deploy app.example.com --wait
GitLab CI:
deploy:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == "main"
script:
- curl -fsSLo zefily https://dl.zefily.com/cli/zefily-linux-amd64 && chmod +x zefily
- ./zefily deploy app.example.com --wait
To be notified when deploys finish, add a webhook for the deploy finished event.
Updated November 29, 2026 View as Markdown llms.txt