HTTP API reference

Authenticate and invoke all 41 Formatio REST endpoints across applications, deployments, networking, workflows, inventory, and cluster recovery.

Formatio's JSON REST API lives under /api/.../ and authenticates requests with bearer tokens (Authorization: Bearer <access_token>). Browser UI routes serve Inertia pages via session cookies and are separate from REST JSON endpoints.

Authentication and token lifecycle

Authenticate with POST /api/user/authenticate/ using email and password:

{
  "email": "[email protected]",
  "password": "REPLACE_PASSWORD",
  "provider": "password"
}

Responses return tokens.access and tokens.refresh. Pass Authorization: Bearer <tokens.access> on API requests and renew expired tokens cleanly via POST /api/user/refresh-tokens/ with {"token":"REPLACE_REFRESH_TOKEN"}.

[!NOTE] REST API user bearer tokens (/api/user/authenticate/), MCP personal access tokens (Settings › Access tokens), and per-app OTLP ingest tokens (X-Formatio-Token) are distinct credential types and are not interchangeable.

Query applications and submit idempotent deployments

Set FORMATIO_URL, FORMATIO_ACCESS_TOKEN, ORGANIZATION_ID, APPLICATION_ID, and a unique DEPLOY_REQUEST_KEY per intended deployment:

curl --fail-with-body \
  -H "Authorization: Bearer $FORMATIO_ACCESS_TOKEN" \
  "$FORMATIO_URL/api/user/me/"

curl --fail-with-body --get \
  -H "Authorization: Bearer $FORMATIO_ACCESS_TOKEN" \
  --data-urlencode "organization=$ORGANIZATION_ID" \
  --data-urlencode 'limit=20' \
  "$FORMATIO_URL/api/application/"

curl --fail-with-body \
  -X POST \
  -H "Authorization: Bearer $FORMATIO_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $DEPLOY_REQUEST_KEY" \
  --data '{"ref":"main"}' \
  "$FORMATIO_URL/api/application/$APPLICATION_ID/build/"
  • GET /api/application/: requires exactly one of organization or project ID, and accepts search, offset, and limit. API tokens never assume your browser's active organization switcher.
  • POST /api/application/{id}/build/: returns HTTP 200 with a queued job containing id, app_id, deployment_id, and status. For image-backed apps, send {}. Reuse the exact Idempotency-Key and identical payload only when retrying an interrupted network response (a mismatched payload returns HTTP 409). Pass retry_of with a failed numeric queue ID to retry that exact source revision deliberately.
  • Poll queue progress: GET /api/deployment/queue/{id}/ transitions through pending, processing, completed, and failed (error_code indicates failure category).

Complete endpoint directory (41 routes)

Account and identity

Route Methods Purpose
/api/user/authenticate/ POST Exchange email/password credentials for access + refresh tokens
/api/user/refresh-tokens/ POST Refresh an expiring bearer access/refresh token pair
/api/user/forgot-password/ POST Request a 5-minute password recovery verification code
/api/user/reset-password/ POST Verify recovery code and commit a new account password
/api/user/me/ GET, PATCH Read or update authenticated user profile attributes

Organizations, projects, platforms, and plans

Route Methods Purpose
/api/organization/ GET, POST List accessible organizations or create an organization
/api/organization/{id}/ DELETE Delete an empty organization (owner only)
/api/organization/{id}/members/ GET, POST List or add organization members
/api/organization/{id}/members/{member}/ DELETE Remove an organization member
/api/project/ GET, POST List or create projects inside an organization
/api/project/{id}/ PATCH, DELETE Rename/update or delete an empty project
/api/project/{id}/members/ GET, POST List or add project-scoped members
/api/project/{id}/members/{member}/ DELETE Remove a project-scoped member
/api/project/{id}/platform/ PATCH Move an empty project to another enabled runtime platform
/api/platforms/ GET List enabled compute platforms and capabilities visible for project scheduling
/api/plan/ GET List available compute resource plans

Applications and deployments

Route Methods Purpose
/api/application/ GET, POST List apps (filter by organization or project) or create an application
/api/application/{id}/ GET, PATCH, DELETE Read, update configuration, or delete an application
/api/application/{id}/build/ POST Enqueue a Git ref or image deployment (Idempotency-Key, retry_of)
/api/application/{id}/restart/ POST Restart the running application service without rebuilding
/api/deployment/ GET Query deployment history (filter by application)
/api/deployment/queue/{id}/ GET Poll single queue job progress and error_code

Networking and workflows

Route Methods Purpose
/api/network/ GET, POST List or attach domain/port routing rules (Http or Tcp)
/api/network/{id}/ PATCH, DELETE Update or remove a domain/port route
/api/network/domain/ GET Retrieve platform subdomain DNS bases
/api/network/ip/ GET Retrieve platform ingress IP address for A records
/api/network/{domain}/lookup/ GET Verify DNS resolution for a custom domain before/after provisioning
/api/workflow/ GET, POST List or create deployment workflow graphs
/api/workflow/{id}/ GET, PATCH, DELETE Inspect, edit, or delete a deployment workflow

Platform administration (inventory, queue recovery, and cluster)

[!IMPORTANT] All /api/admin/*, /api/cluster/*, and queue recovery routes require platform administrator privileges.

Route Methods Purpose
/api/admin/credentials/ GET, POST List redacted credential summaries or add AES-256-GCM sealed inventory secrets
/api/admin/credentials/{id}/ GET Inspect metadata (never plaintext secrets) for one credential
/api/admin/credentials/{id}/secret/ PUT Rotate or replace an encrypted inventory credential secret
/api/admin/hosts/ GET, POST List server inventory hosts or register an SSH host
/api/admin/hosts/{id}/events/ GET Stream/fetch bootstrap, key-pinning, and join event logs for a host
/api/admin/inventory/status/ GET Summarize inventory vault health, host reachability, and key states
/api/cluster/ GET Inspect Swarm cluster nodes, reservations, and service states
/api/cluster/reconcile/ POST Trigger a Swarm reconciliation sweep (RECONCILE_DRY_RUN)
/api/cluster/restore/ POST Restore saved service images cleanly (supports offline only mode)
/api/deployment/queue/stats/ GET Aggregate worker depth, active claims, and queue diagnostics
/api/deployment/queue/{id}/recovery/ GET Read claim_token and source_revision for an interrupted job
/api/deployment/queue/{id}/resolve/ POST Commit verified recovery outcome (completed or failed) with evidence