Apps
An app is a container that runs on its own VM (the host) in the
workspace’s cloud account, served at
https://<app>.<workspace slug>.<apps zone> (for example
https://web.acme.apps.mayadyn.com). Each deploy creates a numbered
release and an app.deploy operation. Mayadyn’s agent
on the host pulls the release, runs it and reports back. A release that
does not become healthy leaves the previous one running.
Guide: Apps.
{ref} is the app’s id or name.
Status values
Section titled “Status values”App status |
Meaning |
|---|---|
new |
created, never deployed |
deploying |
a deploy is running |
live |
a release is serving (also after a failed deploy when an earlier release was put back) |
failed |
the deploy failed and there was no earlier release to put back |
deleting |
a delete is running |
Release status |
Meaning |
|---|---|
pending |
created, not yet picked up |
deploying |
the host is applying it |
live |
serving |
failed |
did not run or did not become healthy; message says why |
superseded |
was live, replaced by a later release |
Host state (host_state, reported by the agent): idle, applying,
running, failed.
GET /v1/apps
Section titled “GET /v1/apps”List apps, by name.
Auth: scope read. Project tokens see their project’s only.
Response 200:
{"items": [ {"id": "1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b", "name": "web", "project_id": "0c9d8e7f-1a2b-4c3d-8e5f-6a7b8c9d0e1f", "connection_id": "9a7b6c5d-4e3f-4a2b-9c1d-0e8f7a6b5c4d", "region": "me-jeddah-1", "size": "small", "port": 8080, "url": "https://web.acme.apps.mayadyn.com", "status": "live", "release": 4, "host_resource_id": "6a5b4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d", "host_state": "running", "host_healthy": true, "host_last_seen": "2026-11-30T09:20:11Z", "has_secrets": true, "created_at": "2026-11-20T10:00:00Z"}]}Fields: App.
POST /v1/apps
Section titled “POST /v1/apps”Create an app. Nothing runs until the first deploy.
Auth: scope write.
Request body (CreateAppRequest)
| Field | Type | Required | Description |
|---|---|---|---|
connection |
string | yes | connection id or name |
name |
string | yes | ^[a-z]([a-z0-9-]{0,38}[a-z0-9])?$ (lowercase letter first, max 40); unique in the workspace; becomes the first DNS label |
region |
string | no | default: the connection’s default_region |
size |
string | no | host size, default small (catalog or native; checked when the host is created) |
port |
integer | no | port the container listens on, 1–65535, default 8080 |
secrets |
object | no | AppSecrets (see PUT /v1/apps/{ref}/secrets) |
{"connection": "oci-jeddah", "name": "web", "port": 3000}Response 201 (App, status: "new").
Errors: 400 invalid_input (name, port, region, secrets); 404 connection; 409 conflict “an app named
web exists”; 424 connection_unhealthy.
Audit: app.create (name, connection, region).
curl -s -X POST "$MAYADYN/v1/apps" -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" -d '{"connection":"oci-jeddah","name":"web","port":3000}'GET /v1/apps/{ref}
Section titled “GET /v1/apps/{ref}”Get one app: URL, status, live release number, host health.
Auth: scope read. Response 200 (App). Errors: 404 “app X
not found”, hint “List apps to see their names.”
POST /v1/apps/{ref}/deploy
Section titled “POST /v1/apps/{ref}/deploy”Deploy a container image, or build a git repository on the host.
Auth: scope write. Deploying gives the new code the app’s
environment and secrets.
Request body (DeployRequest): exactly one of image or git.
| Field | Type | Required | Description |
|---|---|---|---|
image |
string | one of | image reference, e.g. ghcr.io/acme/web:1.4 (^[a-zA-Z0-9][a-zA-Z0-9._/:@-]{0,254}$) |
git |
object | one of | GitSource: repository with a Dockerfile, built on the host |
git.url |
string | yes | https:// URL without credentials (no @, spaces or newlines). Private repos: set git_token and git_host in the secrets |
git.ref |
string | no | branch or tag, default main ([A-Za-z0-9._/-]{1,200}, no .., not starting with -) |
git.dockerfile |
string | no | path inside the repo (no .., not absolute); default Dockerfile |
port |
integer | no | change the app’s port with this deploy (1–65535). Saved when the deploy is accepted. |
{"image": "ghcr.io/acme/web:1.4"}{"git": {"url": "https://github.com/acme/web", "ref": "release-1.4", "dockerfile": "deploy/Dockerfile"}, "port": 3000}Response 202 with an app.deploy operation (200 if finished within
wait). Result on success:
{"release": 4, "url": "https://web.acme.apps.mayadyn.com", "host_ip": "203.0.113.10"}.
Dry run 200, nothing written:
{"dry_run": true, "release": {"id": "00000000-0000-0000-0000-000000000000", "number": 0, "source": "image", "image": "ghcr.io/acme/web:1.4", "status": "", "created_at": "0001-01-01T00:00:00Z"}}Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_input |
“give either image or git, not both”; “give an image, or a git repository to build”; bad image, git url, ref, dockerfile or port |
| 404 | not_found |
app |
| 409 | conflict |
“another operation is in progress on web” (operation_id); “the app is being deleted”; Idempotency-Key reused |
| 429 | rate_limited |
200 operations in flight |
What the deploy does (in the operation): creates the host VM on the
first deploy (or if it is gone; image ubuntu-24.04, ports 80 and 443
open, label mayadyn-app), points the DNS name at it, ensures the
workspace’s TLS certificate, hands the release to the agent, and waits for
its report (up to 20 minutes for a new host, 10 for an existing one). Then
it publishes DNS, marks the release live and earlier live releases
superseded.
Operation errors: deploy_failed “release N failed: …” (the previous
release keeps or resumes serving), timeout “the host did not report
release N within …”, connection_unhealthy, provider_error (DNS, no
public IP, TLS), or a cloud code from creating the host.
Audit: app.deploy.requested (operation, release, source, image, git),
then app.deploy.
curl -s -X POST "$MAYADYN/v1/apps/web/deploy" -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \ -d '{"image":"ghcr.io/acme/web:1.4"}'POST /v1/apps/{ref}/rollback
Section titled “POST /v1/apps/{ref}/rollback”Deploy an earlier release again.
Auth: scope write.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
release |
integer | yes | release number from GET /v1/apps/{ref}/releases |
Response 202 app.deploy operation for that release. Dry run: 200
{"dry_run": true, "release": <the Release>}.
Errors: 404 “release N not found”; others as for deploy.
Notes: no new release number is created; the chosen release goes back
to live if it becomes healthy. Audit: app.deploy.requested.
curl -s -X POST "$MAYADYN/v1/apps/web/rollback" -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" -d '{"release":3}'GET /v1/apps/{ref}/releases
Section titled “GET /v1/apps/{ref}/releases”The app’s latest 50 releases, newest first.
Auth: scope read.
Response 200:
{"items": [ {"id": "8c7b6a59-4d3e-4f2a-9b1c-0d9e8f7a6b5c", "number": 4, "source": "git", "git": {"url": "https://github.com/acme/web", "ref": "release-1.4", "dockerfile": "deploy/Dockerfile"}, "status": "live", "created_at": "2026-11-30T09:15:00Z", "finished_at": "2026-11-30T09:17:40Z"}, {"id": "4b3a2918-7c6d-4e5f-8a9b-1c2d3e4f5a6b", "number": 3, "source": "image", "image": "ghcr.io/acme/web:1.3", "status": "failed", "message": "release 3 failed: release 3 did not answer on port 8080 within ...", "created_at": "2026-11-29T16:00:00Z", "finished_at": "2026-11-29T16:03:10Z"}]}GET /v1/apps/{ref}/logs
Section titled “GET /v1/apps/{ref}/logs”Recent output of the app’s container and the host’s state, as last reported by the agent.
Auth: scope read.
Response 200 (AppLogs):
{"host_state": "running", "last_seen": "2026-11-30T09:20:11Z", "logs": "listening on :3000\nGET / 200 3ms\n"}logs is the tail of the container’s output (the agent sends the last 100
lines). Before the host has reported: {"host_state": "", "logs": ""}.
PUT /v1/apps/{ref}/secrets
Section titled “PUT /v1/apps/{ref}/secrets”Set the app’s environment and private-source credentials. Write-only:
stored encrypted, delivered only to the app’s own host, never returned
(has_secrets shows whether any are set). They apply on the next
deploy.
Auth: scope write.
Request body (AppSecrets)
| Field | Type | Required | Description |
|---|---|---|---|
env |
object | no | environment variables. Replaces the whole current set (omitted or {} clears it). Up to 200; names ^[A-Za-z_][A-Za-z0-9_]{0,127}$; values without line breaks or NUL; names + values at most 64 KB |
registry |
object | no | RegistryAuth {server, username, password} for a private image registry; all three required; server is host[:port]. Kept if omitted |
git_token |
string | no | token for a private git repository. Kept (with its host) if omitted |
git_host |
string | with git_token |
the only host the token is sent to, e.g. github.com |
{"env": {"DATABASE_URL": "postgres://app:...@10.0.0.5/app", "LOG_LEVEL": "info"}, "git_token": "github_pat_11A...", "git_host": "github.com"}Response 204.
Errors: 400 invalid_input (“at most 200 environment variables”,
“environment is larger than 64 KB”, “a git token needs git_host, the host
it may be sent to (e.g. github.com)”, “registry needs server, username and
password”, …); 404.
Notes: there is no way to remove a stored registry credential or git
token through this endpoint other than replacing it. Audit: app.secrets
(env variable names, whether registry and git token are set; never
values). When the host fetches them: app.secrets_delivered.
curl -s -X PUT "$MAYADYN/v1/apps/web/secrets" -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" -d '{"env":{"LOG_LEVEL":"info"}}'DELETE /v1/apps/{ref}
Section titled “DELETE /v1/apps/{ref}”Delete the app: its DNS name, its host VM (with the app’s /data), its
releases and secrets. Irreversible.
Auth: scope destroy.
Response 202 app.delete operation. Result
{"deleted": "web", "hostname": "web.acme.apps.mayadyn.com"}. Dry run:
200 {"dry_run": true}.
Errors: 404; 409 operation in progress.
Notes: the app’s status becomes deleting at once (further deploys:
409 “the app is being deleted”). Audit: app.delete.requested, then
app.delete.
curl -s -X DELETE "$MAYADYN/v1/apps/web" -H "Authorization: Bearer $TOKEN" -H "Idempotency-Key: $(uuidgen)"