Skip to content

The REST API

For scripts and CI pipelines your server has a REST API with the same permissions and the same audit trail as the portal. Rather not write curl? The command-line client hddeploy wraps the same API in commands with job waiting, revision handling and folder uploads.

Base address https://<your-server>.hddeploy3000.nl/api/v1
Description OpenAPI 3.1 at /api/v1/openapi.json, available without a token
Sign in header Authorization: Bearer hdd_... (see API tokens and scopes)
Errors application/problem+json with a readable detail
Limit 120 requests per minute per token (uploads excepted); 429 above that

Long actions return a job. A deploy, stop or backup answers 202 Accepted with a job id. Wait for it with GET /jobs/{id}/wait?timeout=120; the answer holds the status and the output. If done is not yet true, call again.

Writes carry the revision. Whoever changes the compose file, the variables or the settings sends the revision number the change is based on: header If-Match: "7" (with quotes) or the field revision in the body. If the stack changed in the meantime, the answer is 412 Precondition Failed: read the stack again and retry.

A refused compose file gives 422. The answer holds one line in errors[] per broken platform rule. See Compose files and platform rules.

A missing scope gives 403, a wrong or expired token 401.

Method and path Does
GET /me Who you are and which scopes the token carries
GET /overview Attention items and summary
GET /templates The template catalogue you may use, with every template’s fields (key, label, type, required, advanced, default, generate, hashed, help, options, keySet), the recommended memory minMemoryGB (0 = no advice), memoryWarning when this server has less, and keySet when the server makes a key set at creation (supabase; leave those fields empty)
POST /stacks Create a stack from a template: name, template, values ({KEY: value}), optionally source (git source) and deploy. Answers 201 with the stack, the once-shown secrets, generated, nextSteps, warnings (for example a server below the recommended memory; creation goes ahead), for a key set keySet (generated, derived or given) and for a static website the site; 404 for an unknown template, 409 when the name is taken, 422 listing every refused value by field
GET /stacks, GET /stacks/{name} Stacks and one stack; the detail holds domains (per address: points to this server, elsewhere, no record yet, unknown; while it does not point here also record, the DNS record HD Services creates) and clientCreated
DELETE /stacks/{name}?confirm={name} Delete a stack your organisation created itself (204; 403 for stacks HD Services set up). Containers are brought down, the definition and the stack’s images are removed, volumes and site content are kept
GET/PUT /stacks/{name}/compose Read and replace the compose file
POST /stacks/{name}/validate Check a compose file without saving
GET/PUT /stacks/{name}/env Read and change the variables
PUT /stacks/{name}/settings Change the template settings
GET/POST /stacks/{name}/template-update Compare the stack with its template’s current version (available, the diffs, newFields, inputs = fields you must answer in values, such as a statement to accept, localEdits: yes = your own compose edits would be replaced) and apply it with the revision of that answer (new fields get values, else their default or a generated secret; 412 when stale, 409 when there is nothing to apply)
POST /stacks/{name}/deploy, .../stop, .../pull Deploy, stop, pull images (202 + job)
PUT /stacks/{name}/autoupdate Nightly update on or off
GET /stacks/{name}/revisions, GET .../revisions/{id}, POST .../revisions/{id}/restore Read and restore revisions
GET/PUT /stacks/{name}/source, POST .../source/check, .../pin, .../unpin The git source
PUT /stacks/{name}/source/files Write source files as JSON (path + content; see Uploading files)
PUT /stacks/{name}/source/upload Upload the source tree as an archive
GET/POST /stacks/{name}/access The access list (actions add, remove, enable, disable, setup, delete)
POST/DELETE /stacks/{name}/webhooks/deploy Enable, rotate or disable the deploy webhook
GET /containers, POST /containers/{id}/start, .../stop, .../restart, GET .../logs Containers
GET /jobs, GET /jobs/{id}, GET /jobs/{id}/wait Jobs
GET /sites, GET /sites/{name}, PUT /sites/{name} Sites; PUT creates an upload-only site
POST /sites/{name}/check, POST /sites/{name}/restore Check the source, restore a previous version
PUT /sites/{name}/content Upload an archive
GET/PUT /sites/{name}/draft/files, POST .../draft/publish, DELETE .../draft The draft
GET /sites/{name}/files, GET /sites/{name}/file?path= Read files
GET /backups, POST /backups, GET /backups/{name}/files, POST /backups/{name}/run Backups (create: stack, engine, service or volume; edit and delete in the portal)
GET /alerts, GET/POST /alerts/channels, DELETE /alerts/channels/{id}, POST /alerts/test Alerts; a channel’s kind is email, webhook or chatbridge (target = the name of an HD Chat Bridge stack: alerts as WhatsApp messages)
GET /certificates, POST /certificates/request, POST /certificates/upload, DELETE /certificates/{name} Certificates
GET/POST /registries, DELETE /registries/{host} Registry logins
GET /variables, GET/PUT/DELETE /variables/{name} Global variables: PUT creates (201) or changes (200; omitted fields keep their value; hidden: false on a hidden variable requires a new value in the same request, 422 otherwise); hidden values are never returned, not after a restore through /variables/history/{id}/restore either; usedBy names the stacks that take the variable
GET /variables/history, POST /variables/history/{id}/restore The versions of the list and restoring one
GET /sso, POST /sso/enable, POST /sso/disable Single sign-on: the state (login pages with DNS status, users, applications, protected stacks), enable (202 + job), disable (409 while a stack requires the login)
GET/POST /sso/users, GET/PUT/DELETE /sso/users/{username}, POST /sso/users/{username}/password Login users: create (201; without password a generated one comes back once), change (disabled: true blocks), reset the password, remove
GET/POST /sso/apps, DELETE /sso/apps/{clientId} OpenID Connect applications: register (201 with issuer, discovery, clientSecret once), remove
GET/PUT /stacks/{name}/sso A stack’s login requirement: mode off/login/two_factor, groups, publicPaths, deploy: true queues the deploy; the answer names a new domain whose login page needs a DNS record
GET/POST /users, PATCH/DELETE /users/{id} Portal users with a Microsoft account (scope users.manage; HD Services connects the tenant): list, add (201), enable/disable or grant user management (id may be the address; 409 for the last manager), remove
GET/PUT /sso/entra The Microsoft sign-in for applications: availability, the sign-in service per domain (callback URI), and who of the organisation may open the stacks (mode tenant/groups/emails, groups, emails; a job when the service is recreated). A stack uses it with mode: entra on PUT /stacks/{name}/sso
GET /resources Server resources now (scope resources.read): processor, memory, swap, load, pressure, network, disks, disk space, what HDDeploy itself uses, the latest minute per container and the active alerts (firing); ready is false until the first reading is in, source simulated on a test server; 503 when measuring is switched off on this server
GET /resources/history?chart=&range=&container=&points= One chart’s history (cpu, memory, swap, load, pressure, network, disk-io, filesystems, container-cpu, container-memory, or container with a container name), over 1h/6h/24h/7d/30d/90d, at most 720 points (points) with average and maximum; null = no data; 422 for an unknown chart or range, 404 for an unknown container
GET /resources/containers?range= Use per container over 1h, 6h, 24h, 7d or 30d: average and maximum processor (share of the whole server) and memory, limit, network, disk, out-of-memory kills
GET/POST /resources/rules, PUT/DELETE /resources/rules/{id}, POST /resources/rules/{id}/reset Alert rules: the list with states and the metrics; add (201; metric, value, minutes, optionally comparison, severity, enabled; a client’s rule always notifies the client’s own channels, scope resources.rules.client.manage); change (omitted fields stay; metric and owner are fixed; 403 on an HD Services rule); remove (answer {deleted, disabled}: a built-in rule is switched off); reset puts a built-in rule back (technicians, 409 for a rule of your own)
GET /printing Printing (scope printing.read): whether it is on, the printers with their state (ready, offline, setup, refused), alerts and their queue’s options, the print targets and the latest print jobs (never their content). An application prints at the print service itself, see Printing from an application
PUT/DELETE /printing/targets/{id}, POST /printing/targets/{id}/test Print targets (scope printing.targets.write): create (201) or replace (200; the code is fixed; options are checked against what the printer offers, 422 with every rule), remove; print a test page (scope printing.test, 202 with the print job, 503 when the printer is not reachable or blocked)
GET /smb, PUT/DELETE /smb/shares/{id}, POST /smb/shares/{id}/test, GET /smb/shares/{id}/files?path=, GET/PUT /stacks/{name}/smb SMB shares: the shares with their state and mounts (scope smb.read; the password is write-only, omit it on a change to keep it), add (201) or change (200) a share (smb.manage; public server addresses are refused, every broken rule is named in the 422), remove (refused while a stack mounts it), test (ok + message), list a folder, and a stack’s mounts (smb.mounts.write; the list is replaced, applies at the next deploy)
GET /dns/bindings, PUT/DELETE /dns/bindings/{host} DNS records the server makes for itself: the allowlist HD Services set and the records made (GET, scope stacks.read); PUT points a name on the allowlist that a stack or login page uses at this server (a CNAME to its own name, never over an existing record: 409 names it; 403 = not on the allowlist, HD Services creates it), DELETE removes only such a record (scope dns.bind). A stack’s domains say per name binding: allowed or bound
POST /images/update Technicians (scope system.update): pull and redeploy now every stack that runs an image of the repository in image, whether or not its nightly update is on; the answer names per stack queued (with the job), already-queued, pinned (an exact version or digest, left alone), stopped (no container runs; the stack is not started), platform or failed; 404 when no stack runs it
POST /templates/{name}/autoupdate Technicians (scope system.update): the nightly update on (enabled: true) or off for every stack created from the template; dryRun: true writes nothing. The answer names per stack switched, unchanged, would-switch or failed and composeEdited (yes when its compose file changed since); noOrigin = stacks not created from a template, left as they are

The exact fields of every request and response are in the OpenAPI document; most API tools (Postman, Bruno, the OpenAPI generators) read it directly.

Terminal window
# Who am I?
curl -H "Authorization: Bearer hdd_..." \
https://<your-server>.hddeploy3000.nl/api/v1/me
# Deploy a stack and wait for the job
curl -X POST -H "Authorization: Bearer hdd_..." \
https://<your-server>.hddeploy3000.nl/api/v1/stacks/myapp/deploy
curl -H "Authorization: Bearer hdd_..." \
"https://<your-server>.hddeploy3000.nl/api/v1/jobs/j-.../wait?timeout=120"
# Change variables, based on revision 7
curl -X PUT -H "Authorization: Bearer hdd_..." -H 'If-Match: "7"' \
-H "Content-Type: application/json" \
-d '{"values": {"PHP_MEMORY_LIMIT": "512M"}}' \
https://<your-server>.hddeploy3000.nl/api/v1/stacks/myapp/env
# Create a static website from the nginx template (not deployed yet)
curl -X POST -H "Authorization: Bearer hdd_..." \
-H "Content-Type: application/json" \
-d '{"name": "landing", "template": "nginx", "values": {"SITE_DOMAIN": "landing.example.com"}}' \
https://<your-server>.hddeploy3000.nl/api/v1/stacks
# Check a compose file without saving
curl -X POST -H "Authorization: Bearer hdd_..." \
-H "Content-Type: application/json" \
-d '{"content": "services:\n web:\n image: nginx:stable\n"}' \
https://<your-server>.hddeploy3000.nl/api/v1/stacks/myapp/validate

The API above works with your personal token and can do everything you can. For a CI pipeline that only needs to deploy or to have a site synced, there are separate webhooks with their own token that allows exactly one action on one stack or site.