REST API
The dashboard uses Fluxo's JSON API under /api/v1. The API is currently versioned by path but does not promise compatibility beyond documented release behavior; test automation against the target Fluxo release.
Base URL
https://YOUR_SERVER_IP:9595/api/v1When a panel domain is active, the equivalent base URL is:
https://admin.example.com/api/v1For the initial self-signed certificate, development clients may need an explicit trust exception. Do not disable TLS verification in production automation.
Authentication
Sign in:
POST /api/v1/auth/login
Content-Type: application/json
{
"username": "admin",
"password": "your-password"
}Use the returned JWT on protected requests:
Authorization: Bearer YOUR_JWTPublic endpoints are limited to login, bootstrap status, health, version, the signed GitHub webhook receiver, and WebSocket authentication. The dashboard stores its session token in browser local storage.
Version and update awareness
GET /version is unauthenticated and returns the version of the installed Fluxo binary:
{"version":"0.4.47"}Authenticated clients can call GET /update-status. Fluxo compares the installed version with the validated public manifest at https://fluxo.fabiotech.dev/api/v1/releases/latest and returns current_version, latest_version, update_available, release_url, and check metadata. Successful checks are cached for six hours; temporary failures are cached briefly and return check_available: false so update awareness never blocks normal dashboard use. The current base excludes the bridge lineage through stable v0.4.55 from its update channel: while public latest is that bridge or an earlier release, it returns check_available: false, update_available: false and omits latest-release fields. Later public base releases use normal version comparison; this does not install or promote a release.
These endpoints are informational. They cannot download, install, or activate a release. Administrators must review the release notes and perform upgrades from the server terminal.
Main resource groups
| Resource | Representative endpoints |
|---|---|
| Authentication | POST /auth/login, GET /auth/bootstrap |
| Sites | GET/POST /sites, GET/PUT/DELETE /sites/{id} |
| Deployments | POST /sites/{id}/deploy, list, rollback, dismiss failure |
| Configuration | Site environment, WordPress config, deployment settings, and Nginx vhost |
| Files | List, read, write, create, move, upload, download, delete |
| Domains and SSL | Domain CRUD, Let's Encrypt, custom, clone, activate, deactivate |
| Site processes | Daemons and scheduled jobs, actions, and logs |
| Commands | Execute, stream, list, inspect, and delete history |
| Laravel features | Scheduler, Queue Worker, Nightwatch, Horizon, Octane, maintenance |
| Databases | Databases, users, grants, password rotation, sizes, exports |
| Backups | Destinations, plans, runs, artifacts, downloads |
| Runtimes | PHP, Node.js, Python, Nginx, database engines, service actions |
| Observation | Metrics, logs, downloads, clearing, activity |
| Traffic analytics | GET/PUT /traffic-analytics, GET/PUT/DELETE /sites/{id}/traffic-analytics, GET/PUT /sites/{id}/traffic-analytics/api-settings |
| Settings | General settings, panel domain and SSL, GitHub accounts, SSH keys and effective SSH security policy, firewall |
Traffic analytics
Traffic Analytics V1 is off by default. It stores hourly aggregates separately from the main control database. Both the server switch and a site's selection must be enabled to collect; at most 32 sites may be effectively enabled. See the operator guide for estimates, privacy, soft log limits, and retained history.
Every endpoint below requires Authorization: Bearer YOUR_JWT. Collection-toggle PUT requests require Content-Type: application/json; send a JSON object with the single required boolean field enabled, within a 1024-byte body limit. Missing, null, non-boolean, unknown, or additional fields and invalid JSON are rejected. API classification settings have their separate JSON contract below. There are no multipart requests. Successful responses are JSON, and these endpoints use Cache-Control: no-store. Error bodies are plain text.
| Method and full path | Parameters and request body | Success |
|---|---|---|
GET /api/v1/traffic-analytics | No body, path parameters, or query parameters. | 200 State with the saved server setting and current site statuses. |
PUT /api/v1/traffic-analytics | {"enabled":true} or {"enabled":false} to change collection; alternatively {"retention_days":60} to change the server retention policy. Exactly one field; no path/query parameters. | 200 State when applied; 202 State while configuration or worker draining remains pending. Retention-only updates return 200 without reloading Nginx. |
GET /api/v1/sites/{id}/traffic-analytics | Required positive integer site id. Optional range=today|7d|30d|60d|90d|180d|365d|all, default today. No body. | 200 Report from aggregate tables, including unavailable intervals. |
PUT /api/v1/sites/{id}/traffic-analytics | Required positive integer site id; JSON {"enabled":true} or {"enabled":false}. No query parameters. | 200 SiteStatus when applied; 202 SiteStatus while pending. A selection can remain enabled while the server switch is off. |
DELETE /api/v1/sites/{id}/traffic-analytics | Required positive integer site id. No body or query parameters. Explicit history deletion only. | 200 with {"deleted":true,"site":SiteStatus}. Collection selection is unchanged. |
GET /api/v1/sites/{id}/traffic-analytics/api-settings | Required positive integer site id. No query parameters or body. | 200 APISettingsState; reading defaults does not create analytics storage. |
PUT /api/v1/sites/{id}/traffic-analytics/api-settings | Required positive integer site id. No query parameters. JSON {"prefixes":["/api"],"routes":["/api/users/:id"]}; both string arrays are required, including when empty. | 200 APISettingsState. Settings do not enable collection or reload Nginx. |
today starts at midnight UTC. 7d starts at midnight UTC six days before today; 30d starts 29 days before today. All end at the current server time, so the current hour is still in progress. There are no caller-supplied start/end dates, timezone, grouping, visitor, or IP filters.
State and collection status
Example request:
PUT /api/v1/traffic-analytics
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"enabled":true}Example 200 OK State:
{
"master_enabled": true,
"pending": false,
"status": "enabled",
"retention_days": 30,
"freshness_seconds": 30,
"sites": [{
"site_id": 8,
"domain": "example.com",
"enabled": true,
"effective_enabled": true,
"status": "enabled",
"pending": false,
"last_processed_at": "2026-11-19T12:14:30Z",
"last_checked_at": "2026-11-19T12:14:30Z",
"backlog_bytes": 0,
"incomplete": false,
"dropped_bytes": 0
}]
}State fields are master_enabled (saved server selection), pending (configuration transition unfinished), status (diagnostic state), optional error (current configuration failure), retention_days (integer 0, 30, 60, 90, 180 or 365; default 30), freshness_seconds (nominal collection refresh), and sites (SiteStatus array, empty when there are no sites). State diagnostic values include disabled, enabled, applying, draining, and error.
Retention is one persisted server-wide policy, including for disabled sites. Existing configurations without the setting retain the 30-day default. Send an integer from 30, 60, 90, 180, 365, or 0 for Keep until manually deleted. Null, strings, booleans, fractional/exponent forms, unsupported values, duplicate fields, extra fields and combined enabled/retention_days requests return 400. Changes during an unfinished producer transition return 409.
Example request to retain history until explicit deletion:
PUT /api/v1/traffic-analytics
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"retention_days":0}A successful response is the same 200 OK State shape above with "retention_days":0; collection selections are unchanged. Finite policies apply to both parser age acceptance and incremental aggregate cleanup. Shorter retention removes older history during cleanup; longer retention cannot recover deleted history or backfill disabled intervals. Manual retention disables age deletion only: report ranges, page/referrer/API cardinality limits and work/storage budgets remain in force. At storage capacity or disk pressure collection pauses visibly, without evicting retained aggregates; free space or explicitly delete history before re-enabling. The 256 MiB database ceiling uses the actual SQLite page size, with 8 MiB ingestion headroom for controls and an approximately 8 MiB WAL baseline.
SiteStatus fields:
| Field | Type and meaning |
|---|---|
site_id, domain | Integer site identity and current domain. |
enabled | Boolean saved per-site selection. It does not establish that collection is effective. |
effective_enabled | Boolean reflecting the effective producer/ingestion selection. |
status, pending | Diagnostic string and boolean unfinished-transition indicator. Site diagnostics also include disabled_by_master. |
error | Optional string describing a configuration or collection failure. |
last_processed_at | Nullable UTC timestamp of the most recent processed request; null before processing. |
last_checked_at | Nullable UTC timestamp of the last collection check, including checks of quiet sites. |
backlog_bytes | Nonnegative bytes still awaiting processing. |
incomplete | Boolean indicating known incomplete or capped data. |
dropped_bytes | Nonnegative known discarded-byte count. It is not a request count. |
For example, disabling a site can return 202 Accepted with a SiteStatus such as:
{
"site_id":8,"domain":"example.com","enabled":true,"effective_enabled":true,
"status":"draining","pending":true,
"last_processed_at":"2026-11-19T12:14:30Z","last_checked_at":"2026-11-19T12:14:30Z",
"backlog_bytes":2048,"incomplete":false,"dropped_bytes":0
}202 acknowledges an unfinished change, not completed enablement or disablement. Poll the corresponding GET until pending is false and inspect error, the saved setting, and effective_enabled. During a transition the response can retain the earlier committed selection. On failure, reload saved truth before retrying. Re-enable through the same PUT with enabled: true; no resume endpoint exists. Disabling preserves history under the saved server retention policy. Enabling starts a new collection interval without importing older ordinary access logs.
Reports
GET /api/v1/sites/8/traffic-analytics?range=7d
Authorization: Bearer YOUR_JWTA Report contains range, retention_days (the current server policy), positive integer bucket_seconds (chart period width), nullable UTC available_from (oldest retained aggregate/verified coverage; not proof of continuous coverage), UTC from/to timestamps, master_enabled, site (SiteStatus), totals (Metrics), buckets (Bucket array, at most 720 entries), top_paths and referrers (Rank arrays), gaps (Gap array), notes (explanatory strings), and api (APIReport, described below). Empty arrays are returned as [].
The menu offers ranges up to retention_days; zero (manual retention) offers every preset plus all. Known presets remain valid API reads even if longer than the policy; expired coverage is not presented as quiet zero data. Presets include today and the preceding N−1 UTC calendar days. all begins at the oldest retained aggregate/verified collection interval, rounded down to its UTC hour; if none exists, it returns today with unavailable coverage. API settings alone do not invent retained history.
Periods are 3,600 seconds up to 30 days, 86,400 seconds up to 180 days, and 604,800 seconds thereafter; a very long all range uses wider integer multiples of a week to keep both overview/API series at most 720 entries. Periods start at from, and each ends at min(hour + bucket_seconds, to). to is exclusive; the current final period may be unfinished. SQL combines stored hourly counters without rereading logs, preserves request-weighted averages and caps rankings as before. Reads have a five-second query budget; a failed/cancelled read returns an error, not a truncated success. Retention and collection/deletion policies are unchanged.
Metrics fields are nonnegative numbers: integer requests, page_views, not_found, other_4xx, server_errors, and response_bytes; numeric avg_request_time_ms is the request-weighted Nginx duration in milliseconds. not_found counts 404 responses, other_4xx excludes 404, and server_errors counts 5xx. Response bytes count Nginx response bodies at the origin, without headers. Nginx timing includes upstream work and response transmission; it is not browser page speed. Page views estimate successful/redirected page GET requests after bot/API/asset filtering; they are not people or sessions.
Each Bucket has UTC hour (the historical field name for the start of a chart period), nullable metrics, collection (enabled, disabled, partial, or unknown), and boolean incomplete. metrics: null means unavailable coverage and must not be drawn as zero requests. A partial period can contain valid aggregates alongside a collection gap. A zero Metrics object for a fully observed quiet period is a valid zero. Totals may be zero when nothing was collected; use bucket coverage to distinguish that case from an observed quiet range.
Each Rank is {"value":"/pricing","requests":143} or {"value":"google.com","requests":57}. Page ranks contain paths without query strings and count estimated page requests. Referrer ranks contain usable referring hostnames, without full URLs; missing referrers are omitted. Bounded dimensions can produce an (other) value. Each Gap is {"from":"2026-11-19T00:00:00Z","to":"2026-11-19T10:00:00Z","reason":"Analytics was disabled or collection is unknown"}. Reasons explain unavailable or incomplete intervals, not zero traffic.
For longer history, use GET /api/v1/sites/8/traffic-analytics?range=90d or ?range=all with the same Bearer header. A 90-day response normally has bucket_seconds: 86400; metrics: null still marks missing data.
For example, an uncollected site can return 200 OK at 00:30 UTC:
{
"range":"today","retention_days":30,"bucket_seconds":3600,"available_from":null,
"from":"2026-11-19T00:00:00Z","to":"2026-11-19T00:30:00Z",
"master_enabled":false,
"site":{
"site_id":8,"domain":"example.com","enabled":false,"effective_enabled":false,
"status":"disabled","pending":false,"last_processed_at":null,"last_checked_at":null,
"backlog_bytes":0,"incomplete":false,"dropped_bytes":0
},
"totals":{"requests":0,"page_views":0,"not_found":0,"other_4xx":0,"server_errors":0,"response_bytes":0,"avg_request_time_ms":0},
"buckets":[{"hour":"2026-11-19T00:00:00Z","metrics":null,"collection":"unknown","incomplete":false}],
"top_paths":[],"referrers":[],
"gaps":[{"from":"2026-11-19T00:00:00Z","to":"2026-11-19T00:30:00Z","reason":"Analytics was not collected"}],
"notes":["Times and daily boundaries use UTC."],
"api":{
"settings":{"prefixes":["/api"],"routes":[]},
"effective_from":null,"available_from":null,
"totals":{"requests":0,"status_1xx":0,"status_2xx":0,"status_3xx":0,"status_4xx":0,"status_5xx":0,"response_bytes":0,"avg_request_time_ms":0},
"buckets":[{"hour":"2026-11-19T00:00:00Z","metrics":null,"collection":"unknown","incomplete":false}],
"endpoints":[],
"gaps":[{"from":"2026-11-19T00:00:00Z","to":"2026-11-19T00:30:00Z","reason":"API analytics was not collected"}],
"notes":["Earlier API data is unavailable; existing traffic totals are never reconstructed as API history."],
"incomplete":false
}
}Normal freshness is approximately 30–60 seconds, subject to collection work and backlog. Read aggregate tables rather than expecting a historical log scan. Poll only visible screens, at intervals such as 15–30 seconds while pending or 30 seconds while active; stop polling disabled screens. Delayed, capped, or dropped data must remain visibly qualified.
Based on requests reaching this server. Visits served entirely from a CDN or browser cache are not included.
API classification and reports
The Overview, Pages and API traffic tabs consume the same Report and range. They do not start separate collectors. API aggregation uses the existing sanitized origin metadata; it stores no authorization headers, cookies, tokens, bodies or visitor identities.
Example settings update:
PUT /api/v1/sites/8/traffic-analytics/api-settings
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"prefixes":["/api","/services"],"routes":["/api/users/:id","/api/users/me","/services/health"]}Example 200 OK:
{
"settings": {
"prefixes": ["/api", "/services"],
"routes": ["/api/users/:id", "/api/users/me", "/services/health"]
},
"effective_from": "2026-11-19T12:20:00Z"
}APISettingsState fields are settings (the saved prefixes and routes arrays) and nullable UTC effective_from (when those rules became effective). Defaults are prefixes: ["/api"] and routes: []. Saving classification while collection is off records the preference without starting logging or ingestion.
Settings requests are limited to 16,384 bytes, 16 prefixes, and 32 routes. Paths are case-sensitive, valid UTF-8 and at most 512 bytes. Use canonical paths without a trailing slash, except /; a prefix still matches requests with a trailing slash. Prefixes are literal absolute path prefixes with segment boundaries: /api matches /api and /api/users, not /apiculture. Routes are absolute paths with literal segments or single-segment parameters such as :id; explicit routes also classify paths outside the prefixes. Parameter names start with an ASCII letter or underscore, continue with letters, digits or underscores, and must be unique within a route. Regexes, wildcards, dot segments, whitespace, control characters, query strings, fragments and ambiguous patterns are rejected. Routes matching the same path are ordered by literal-segment count, then segment count, then lexical order; overlapping patterns with the same specificity are rejected. Unmatched prefix paths retain their sanitized literal path within the endpoint bounds. Grouping is by method and the selected explicit pattern or literal path, with an (other) group when limits are reached. Standard GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT and TRACE methods retain their labels; other valid methods use OTHER to bound dimensions. No ID patterns are guessed.
Rule changes apply forward only. Previously stored aggregates keep their original interpretation; pending records use rules effective at the recorded request time. Changes are bounded to 128 retained rule intervals and 64 KiB of serialized rule settings per site. Reaching either limit returns 409 without replacing the saved rules or evicting rules needed by queued requests. Up to 256 living sites can have API preferences; preferences for deleted panel sites are reclaimed during reconciliation while their historical rules and aggregates retain their normal retention. A capacity conflict must not be retried in a tight loop. Disabling and explicit history deletion retain the same protections against disabled-period backfill and resurrecting queued history.
APIReport fields:
| Field | Meaning |
|---|---|
settings, effective_from | Current classification arrays and nullable effective timestamp. |
available_from | Nullable UTC start of retained API-specific collection. Older overall summaries cannot reconstruct API history. Check buckets and gaps for coverage within the range. |
totals | APIMetrics for the available selected period. |
buckets | Hourly objects with hour, nullable metrics (APIMetrics), collection, and incomplete, with the same gap semantics as overall buckets. |
endpoints | Bounded array of { "method": "GET", "path": "/api/users/:id", "metrics": APIMetrics } groups. |
gaps, notes, incomplete | Coverage explanations, metric limitations and a boolean capped/incomplete indicator. |
APIMetrics contains integer requests, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, response_bytes, and numeric avg_request_time_ms. Counts include matching bots and non-GET methods. Status classes sum to requests; redirects belong to 3xx, and the API error line is 4xx + 5xx only. Average timing is the sum of Nginx request durations divided by requests, not the average of hourly or endpoint averages. Bytes exclude response headers. HTTP 200 may contain an application or GraphQL error that these logs cannot identify. Classification of /graphql is possible as an explicit configured path, without operation/body inspection.
Settings errors use plain-text bodies: 400 for malformed JSON, missing/null/wrong-type arrays, unknown fields, trailing JSON, query parameters or invalid site IDs; 401 for missing/invalid JWT; 404 for a missing site; 409 for a pending collection transition or rule capacity; 413 for a body over 16,384 bytes; 415 for a non-JSON content type; 422 for invalid classification rules; and 503 for unavailable storage. An example validation response is:
HTTP/1.1 422 Unprocessable Entity
Content-Type: text/plain; charset=utf-8
Cache-Control: no-store
invalid API prefix "/api?private=1": use a clean absolute path of at most 512 bytes without trailing slash, query, whitespace or wildcardsUnavailable API hours have metrics: null, including before API aggregation was supported. They must not be displayed as zero requests even if the overall report has data for those hours.
Explicit history deletion and errors
DELETE /api/v1/sites/8/traffic-analytics
Authorization: Bearer YOUR_JWTConfirm this destructive action with the administrator before sending it. A successful response returns deleted: true and the current SiteStatus. The action removes retained aggregates and excludes earlier queued records from recreating them; an enabled site continues collecting subsequent requests. It does not disable collection or delete ordinary Nginx access logs.
| Status | Meaning and example plain-text body |
|---|---|
400 Bad Request | Invalid JSON/fields, non-boolean enabled, invalid or null retention_days, duplicate/combined settings fields, invalid site ID or range, or selection beyond the supported site limit. Example: invalid traffic range; use today, 7d, 30d, 60d, 90d, 180d, 365d or all. |
401 Unauthorized | Missing or invalid Bearer token. Example: Unauthorized. |
404 Not Found | The requested site does not exist. Example: Site not found. |
409 Conflict | Another collection change is applying, or history deletion conflicts with that change. Example: traffic collection is still applying; wait for the current change. |
503 Service Unavailable | Nginx activation, storage, or collection state could not be applied/read safely. Example: traffic Nginx reload failed: nginx reload failed. Read state again; a failed disable must not be presented as stopped. |
For example:
HTTP/1.1 409 Conflict
Content-Type: text/plain; charset=utf-8
Cache-Control: no-store
traffic collection is still applying; wait for the current changeRuntime maintenance conflicts
Site, daemon, scheduled-job, runtime, settings and phpMyAdmin mutations require maintenance admission. Reads remain available. A refused mutation does not clear recovery records or start the requested application action.
An HTTP 409 response with code: "maintenance_busy" distinguishes pending PHP/Node.js maintenance or recovery from temporary lease contention:
{"code":"maintenance_busy","message":"Runtime maintenance access is busy. Try again shortly."}If durable work is pending, the message asks you to review PHP and Node.js. If the lock itself cannot be validated or opened, HTTP 503 returns:
{"code":"maintenance_unavailable","message":"Runtime maintenance access could not be verified. Check the Fluxo service log."}The running panel automatically requalifies supported Scheduler policy changes on the same live cron engine after runtime maintenance and before Scheduler configuration requests. It retains the prior policy and requires fresh real cron acknowledgements for enabled jobs. Pending work defers renewal; replaced engines, unsupported profiles and unfinished installer operations remain refused.
A Scheduler configuration request whose compatibility refresh cannot finish returns HTTP 409 with code: "scheduler_policy_pending" and a message describing the refusal. No request fields are added. Reads, job execution, disable and delete actions do not initiate policy renewal. For example:
{"code":"scheduler_policy_pending","message":"Scheduler compatibility needs attention: finish the exact interrupted installation before automatic Scheduler renewal"}The service log retains the refusal reason. Do not remove maintenance lock files, barriers or Scheduler holds to force a retry.
POST /sites/{id}/features/scheduler/enable requires Bearer authentication, a positive site ID and a Laravel installation in the active composer.lock. It has no query parameters or request fields. Success is HTTP 201 with an empty body. The cron record is committed before guarded trigger publication so an independent reader can verify its site, command, schedule and user. An existing Scheduler returns HTTP 409 text asking you to review that job. A publication failure returns HTTP 500 text and preserves the saved job for review in Site > Processes > Scheduler; it does not discard evidence that an interrupted publication may need. Invalid/missing Laravel remains HTTP 422, and a missing site returns HTTP 404.
Database user grants
Both endpoints require Authorization: Bearer YOUR_JWT. They have no path parameters.
GET /api/v1/databases/users/grants?user=app_user&engine=mysql accepts no body. user identifies the database account; engine selects mysql (default) or postgres. Identifiers contain letters, digits, underscores or hyphens. A successful 200 response lists literal database names, for example ["app_db", "reporting_db"]; escaped MySQL grant patterns are decoded for this response. A missing/invalid user or an unavailable grant lookup returns 200 with []. A MySQL account with global ALL PRIVILEGES is represented by "*" in the list.
Update the selected grants:
POST /api/v1/databases/users/grants
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"user":"app_user","engine":"mysql","databases":["app_db"]}The JSON fields are user (required nonempty identifier), engine (mysql or postgres, defaults to mysql) and databases (selected database-name identifiers; an omitted/empty array selects none). Unknown fields, including a password field, are rejected. Successful updates return 204 No Content with no body. For Fluxo-managed MySQL TCP accounts, this replaces database-level ALL PRIVILEGES grants and preserves the password; additions precede removals. Database names are literal, including underscores. Saving the intended selection explicitly replaces historical wildcard grants; review all intended access before doing so.
Errors use plain-text bodies: 400 Invalid username format for an invalid identifier, 400 Invalid engine for an unsupported engine, 403 Fluxo's managed database grants cannot be changed for the protected fluxo account, 409 when the MySQL account is not in the required managed ownership state, or 500 Failed to update MySQL privileges: … if engine changes fail. Missing/invalid authentication returns 401.
Scheduler status and configuration
GET /api/v1/scheduler/status requires Authorization: Bearer YOUR_JWT. It accepts no body, path parameters or query parameters. It observes the installed scheduler and existing coordination state; it does not install a provider, publish cron files, stop jobs or advance migration. Operational observations share a 30-second cache. Maintenance authorization uses fresh independent checks.
Example 200 response:
{
"backend": {
"engine": "cronie", "state": "active", "unit": "cronie.service",
"package": "cronie", "version": "1.7.1-1", "architecture": "amd64",
"enabled": "enabled", "qualification": "qualified", "observed_at": 1792612800
},
"branches": [{"version": "8.4", "state": "ready"}]
}backend.engine is cron, cronie, custom, none or unknown. Operational state is active, inactive, masked, missing, ambiguous, unqualified or unknown; qualification is qualified or unqualified. Optional code and message explain unavailable or unsupported observations. observed_at is a Unix timestamp in seconds. Package, architecture, unit and enabled state are omitted when they cannot be identified. An active engine does not establish that application jobs succeeded.
branches contains branch/version identifiers and maintenance states: ready, pending, blocked or paused, with optional code/message. Examples include waiting_for_reload, waiting_for_legacy_jobs, backend_identity_changed, legacy_origin_unproven, reconciliation_failed, panel_proof_required and maintenance_active. A missing/inactive/unqualified engine is a successful observation (200), rather than an HTTP failure:
{"backend":{"engine":"none","state":"missing","qualification":"unqualified","code":"backend_missing","message":"No scheduling engine was found. Scheduled jobs cannot be verified; configure a scheduler before PHP maintenance.","observed_at":1792612800},"branches":[]}An unreadable coordination journal produces a 200 observation with state_error describing the failure and no inferred readiness. Missing/invalid authentication returns 401 Unauthorized.
GET /api/v1/crons and GET /api/v1/sites/{id}/crons retain their existing array responses. The site path takes an integer site ID; neither request has a body or query parameters. Both require the same Bearer token. Each row adds optional configuration_state: configured, missing, modified or unknown, derived from the actual managed file. This field describes configuration, not successful execution:
[{"id":4,"site_id":2,"name":"Laravel Scheduler","expression":"* * * * *","command":"php8.4 /home/fluxo/example.com/current/artisan schedule:run","user":"fluxo","created_at":"2026-10-21T12:00:00Z","configuration_state":"configured"}]The global list also includes site_domain when available. Missing/invalid authentication returns 401; database query failure returns 500. Unknown configuration is represented in the row rather than removing that row.
DELETE /api/v1/crons/{cron_id} requires a Bearer token and an integer cron ID, with no body or query parameters. Success returns 204 with no body. If scheduler coordination or removal fails, it returns 409 with a plain-text explanation such as Scheduler is held for PHP maintenance; the database record is retained. Database deletion failure returns 500. An already absent file does not itself prevent record deletion. Missing/invalid authentication returns 401.
Guarded scheduled jobs
POST /api/v1/crons/{cron_id}/run and POST /api/v1/sites/{id}/crons/{cron_id}/run require the existing Bearer token and integer path IDs, with no body or query parameters. A supported guarded job returns 200 with {"output":"Scheduled system task started. Output is available in its cron log."} after submission; completion is asynchronous and output remains available from the existing cron-log endpoint. A durable maintenance/recovery hold returns 409 with its existing plain-text explanation before launch. Unreadable/changed registration or unconfirmed earlier effects also return 409; there is no fallback to executing the stored command directly. Missing jobs return 404, missing/invalid authentication returns 401. Readiness/configuration observations do not imply that the job succeeded.
Node and PHP review responses optionally include impact.scheduled_tasks. Each server-generated receipt binds name, optional domain, optional informational notice, contract, identity (registration UUID), database (absolute registration database), helper (retained executable digest), and profile (dispatcher protocol identifier). profile is fixed-dispatch-v1 for an admitted active registration or retired-dispatch-v1 for a positively verified guarded retirement with no trigger and settled execution. The latter records inactivity for maintenance review; it cannot launch or re-enable the job. contract contains id, kind (application-job, package-cleanup, certificate-renewal, composer-update), expression, command, site_id, user and directory. Clients display these values; they are not caller-supplied execution overrides. For example:
{"scheduled_tasks":[{"name":"Daily report","domain":"example.com","contract":{"id":12,"kind":"application-job","expression":"0 2 * * *","command":"php8.4 artisan reports:generate","site_id":8,"user":"fluxo","directory":"/home/fluxo/example.com/current"},"identity":"c5f71faa-d3bb-42c9-8fef-3ed8043eb9b8","database":"/var/lib/fluxo/fluxo.db","helper":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","profile":"fixed-dispatch-v1"}]}A server-wide renewal receipt can include the informational notice alongside its existing bindings:
{"name":"\"SSL renewal\" (server-wide)","notice":"Some certificates use manual validation and cannot renew automatically. This update keeps their SSL configuration unchanged.","contract":{"id":2,"kind":"certificate-renewal","expression":"0 */12 * * *","command":"certbot renew --quiet","site_id":0,"user":"root","directory":"/"},"identity":"8d695753-0416-4502-9a57-8af33b02dfd8","database":"/var/lib/fluxo/fluxo.db","helper":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","profile":"fixed-dispatch-v1"}notice is escaped display text, not an execution permission or caller input. A protected manual Certbot lineage without executable authentication/cleanup hooks can be coordinated while reporting "Some certificates use manual validation and cannot renew automatically. This update keeps their SSL configuration unchanged.". The notice does not block submission and does not assert that certificate renewal succeeded. Existing Bearer authentication, path validation and review/apply conflict responses are unchanged; clients must still honor blocked_reasons and the reviewed plan. Global task diagnostics identify the job as server-wide rather than suggesting a missing site domain.
A reviewed command/schedule/site-layout change requires a new review. Existing immutable recovery plans are retained; a new recovery review explicitly approves current scheduled-job contracts. Deletion revokes future authority before removing the trigger; an already admitted invocation drains naturally and its unresolved journal can still block maintenance after the row is deleted.
PHP version list
GET /api/v1/server/php/versions/available requires Authorization: Bearer YOUR_JWT and accepts no request body, path parameters or query parameters. It returns the supported PHP branches, whether each is installed, its FPM status, and its installed FPM package's upstream patch when available:
[
{"version":"8.5","full_version":"","installed":false,"status":"not_installed"},
{"version":"8.4","full_version":"8.4.26","installed":true,"status":"running"}
]version remains the branch identifier for all actions and selectors. installed reflects a configured or incomplete FPM package, or an existing unqualified FPM executable. A removed package in config-files state with only a retained /etc/php/<branch> directory does not count. full_version is display-only; it is empty when the configured package's upstream patch cannot be identified. Status is running, stopped, not_installed, or unavailable. unavailable means the package is incomplete, its executable is missing/unusable, or an FPM executable exists outside a configured package; the UI shows Needs attention and prevents replacement installation from the selector. Package-inventory failure returns 503 with Could not read installed PHP packages, rather than claiming nothing is installed. A missing or invalid JWT returns 401 Unauthorized. The displayed patch is not a security assessment: distro backports can change package revisions without changing this value, and it does not independently verify that an already-running process adopted newly installed packages.
GET /api/v1/server/php has the same authentication and no parameters. It returns a JSON array of installed branch identifiers with usable FPM and CLI executables, for example ["8.3","8.4"], or [] when none qualify. It never invents an installed default branch. Inventory failure returns 503 as above.
PHP patch maintenance
These endpoints use the base /api/v1/server/php and require Authorization: Bearer YOUR_JWT. Send Content-Type: application/json for requests with a body. Responses use Cache-Control: no-store; JSON responses also use Content-Type: application/json. There are no query parameters. Branch identifiers match ^[0-9]{1,2}\.[0-9]{1,2}$, such as 8.4, rather than an upstream patch number. Revisions use Debian ordering, including epochs and backports.
Checks only discover package updates: they do not inspect application runtimes, stop services or assess service restart eligibility. Selecting Update requests a separate installation review. Package installation requires explicit confirmation of a reviewed update or a reviewed Repair/Rollback plan. Neither page loads, daily checks, panel closure nor process restart authorize installation or automatic rollback.
| Method and path | Request and validation | Success |
|---|---|---|
GET /updates | No body. Reads persisted state without refreshing APT. | 200 with branches, nullable active_operation, failures, and recoveries. |
POST /updates/check | {"version":"8.4"}. Required branch; a configured FPM package and usable executable must be installed. | 202 Operation. Concurrent identical checks, including a running daily batch, coalesce. A check refreshes repositories once and inventories installed branches. |
GET /updates/plans/{plan_id} | Required UUID path parameter. | 200 immutable Plan. |
POST /updates/plans/{plan_id}/review | Required UUID of the current discovery plan; JSON {} only. | 200 new immutable Plan with reviewed: true and parent_plan_id referencing discovery. Read-only runtime preflight; no package install or service start/stop. Installation blockers are returned in impact.blocked_reasons, not as failed package checks. |
POST /updates/apply | Required version, plan_id UUID and request_id UUID; optional boolean acknowledge_no_rollback, default false. See example below. | 202 Operation, kind apply. Requires a reviewed plan less than 15 minutes old, without package/runtime blockers. Its parent must still be the current eligible discovery snapshot, less than 24 hours old. Discovery-only and legacy unreviewed plans are rejected. |
GET /updates/operations/{operation_id} | Required UUID path parameter. | 200 Operation, including durable progress and bounded diagnostics. |
POST /updates/operations/{operation_id}/recovery-plan | Required current-head operation UUID in the path; JSON {"kind":"repair"} or {"kind":"rollback"}. No other kind is accepted. | 200 immutable RecoveryPlan. This reviews state and records a plan; it does not install packages or start/stop services. |
POST /updates/recovery/apply | Required plan_id and request_id, both UUIDs. plan_id is the recovery plan ID. | 202 Operation with the reviewed repair or rollback kind. Recovery plans expire after 15 minutes. |
POST /updates/operations/{operation_id}/verify | Required operation UUID. No body required. Legacy operations without a recovery generation only. | 202 legacy verify Operation. New maintenance generations return 422 unsupported_configuration; use reviewed Repair instead. |
POST /updates/notices/dismiss | {"version":"8.4","candidate_id":"<64-character candidate fingerprint>"}. Both required; fingerprint must identify a stored candidate. | 204, no body. Dismissal applies to that candidate, not the check timestamp. |
Check, installation-review, apply, recovery-plan, recovery/apply and dismissal JSON bodies are limited to 4096 bytes. Unknown fields, malformed JSON, extra JSON values, invalid branches and malformed UUIDs are rejected. No maintenance request accepts caller-selected package names, package paths, commands, unit names, APT options, archive URLs or native process IDs. Commands and paths in responses are server-derived evidence, not executable request inputs.
A check for a removed or absent FPM package returns 422 with {"code":"runtime_not_installed","message":"PHP-FPM is not installed: PHP 8.5 has no installed FPM package. Use Install version in Runtime > PHP before checking for updates; retained configuration files are not an installed runtime"} and launches no worker. An installed package with a missing or unusable executable returns 422 unsupported_configuration with a package-repair explanation. These new-check prerequisites do not prevent reviewed recovery of an already recorded partial package transaction.
Confirmation and idempotency
First review the discovered package plan:
POST /api/v1/server/php/updates/plans/7c8401be-4337-4cf4-86bf-02f11ba33990/review
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{}The 200 response has the Plan schema below, with a new id, parent_plan_id equal to the discovery ID and reviewed: true. A completed review may contain blockers; show those explanations and disable installation. For example, impact.blocked_reasons may contain Scheduler setup is waiting for earlier cron jobs to finish. PHP has not been changed. Package discovery and its availability notice remain intact. Close and repeat review after resolving the issue.
Use the returned reviewed id, rather than the discovery ID, for an update request with rollback available:
POST /api/v1/server/php/updates/apply
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"version":"8.4","plan_id":"061ce8b3-94d7-4d70-8aa1-021c01a4630f","request_id":"f5f34f6b-9d65-4f2a-bbd5-46b4fd0d7637","acknowledge_no_rollback":false}If plan.rollback.available is false, the client must present its reason and obtain explicit acknowledgement before sending acknowledge_no_rollback: true. Otherwise the API returns 422 rollback_acknowledgement_required. The server retains and verifies the complete target package family before draining consumers. Previous revisions must form a complete authenticated archive set for rollback; installed files or an arbitrary cached .deb are not proof. Discovery-time availability does not guarantee that later downloading succeeds. Without acknowledgement, failure to retain the old set aborts before Scheduler holds, consumer drainage or package changes. A subsequent installation review revalidates that retention failure using a fresh temporary archive probe; recovered availability restores the normal confirmation. Persistent unavailability requires a fresh unchecked exceptional acknowledgement and a new request UUID. The original approval is never amended automatically.
Keep a client-generated request_id across transport retries. Reusing an apply UUID for the same kind, branch and plan returns its original operation, even after completion. A different kind/branch/plan returns 409 plan_changed. Repeating a UUID does not amend the original saved acknowledgement; a changed confirmation requires a new request UUID. Recovery UUIDs are bound to the exact recovery plan; reusing one for another plan returns 409.
Repair continues the generation's current target: after for the intended update, or before after rollback was selected. It can install/reinstall the exact retained family if package state requires it, or only finish activation/verification when revisions already match. Rollback requires a separate review and confirmation, and restores the complete retained previous package family. It does not reverse application code, configuration edits, database changes or completed jobs. There is no automatic rollback.
POST /api/v1/server/php/updates/operations/0a1b7fe7-18c5-4a53-a1a6-d344ae73b42a/recovery-plan
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"kind":"rollback"}Example 200 recovery-plan response excerpt (the full response also includes observation, packages and impact as described below):
{"id":"72311db4-90a5-44ee-86fc-9e786699c24d","generation_id":"0a1b7fe7-18c5-4a53-a1a6-d344ae73b42a","operation_id":"0a1b7fe7-18c5-4a53-a1a6-d344ae73b42a","version":"8.4","kind":"rollback","goal":"before","created_at":1792573500,"retry_fpm_reload":false}After reviewing the returned target packages, impact and limitations, submit its id:
POST /api/v1/server/php/updates/recovery/apply
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"plan_id":"72311db4-90a5-44ee-86fc-9e786699c24d","request_id":"fba15cb6-a854-4b74-bb1a-fa1c85d23d6f"}A recovery plan binds the generation, its current operation head, package observation and affected applications. A newer attempt supersedes that head. Changed packages, marks, repository policy, service definitions or application/native-runtime evidence can require another review or manual reconciliation. Enqueue-time checks do not replace worker-side verification. Legacy /verify never installs packages: it rechecks approved revisions/marks and retries runtime activation. Repeating a legacy parent returns its existing verification; a superseded parent without an existing verification returns 409.
Snapshot and plan responses
An empty successful snapshot is:
{"branches":[],"active_operation":null,"failures":[],"recoveries":[]}branches contains Snapshots with all these fields:
version;state:unknown,current,available,blocked,stale, orcheck_failed.checked_at,attempted_at: Unix seconds for successful check/latest attempt.- Optional
errorandplan;blocked_reasons: array of explanations. update_available: a fresh, eligible plan is available. A failed refresh does not authorize a cached candidate.notice: the known candidate has an undismissed notice. A prior notice can remain visible while apply is disabled.
failures contains latest unresolved terminal maintenance reports per branch. A queued retry does not hide an earlier failure. recoveries contains RecoverySummary objects:
{
"generation_id":"0a1b7fe7-18c5-4a53-a1a6-d344ae73b42a",
"operation_id":"0a1b7fe7-18c5-4a53-a1a6-d344ae73b42a",
"version":"8.4","state":"recovery_pending",
"can_repair":true,"can_rollback":true
}operation_id is the latest head to use for review. rollback_reason is an optional string explaining unavailable rollback. Capability flags are discovery hints, not permission to skip review. The persistent internal Pending flag is exposed as state: "recovery_pending", not a separate response boolean; it keeps conflicting mutations gated even after the worker exits or an operation reports failure. Successful resolution exposes succeeded or rolled_back. An idle worker alone does not imply maintenance is resolved.
A Plan has id, reviewed (boolean), optional parent_plan_id (discovery UUID for installation reviews), version, candidate_id, created_at (Unix seconds), inventory, impact, and rollback: {"available":true} or {"available":false,"reason":"..."}. The candidate fingerprint identifies selected package identities and target revisions rather than a check timestamp. Discovery plans have reviewed: false and empty runtime impact. Installation reviews expire after 15 minutes and cannot outlive or replace their parent discovery result. A failed or newer Check invalidates earlier reviews. GET remains a pure fetch and never converts discovery into installation authorization.
inventory contains version, packages (the complete installed branch family), changes (proposed upgrades), blocked_reasons, and policy_hash (repository/pinning fingerprint). Each package contains:
name,architecture,installed,candidate: binary identity and full Debian revisions.source,source_version,candidate_source,candidate_source_version: source/build identity; independently packaged extensions retain their own numbering.sha256,size: candidate archive digest and byte size.held,automatic,configured: hold, automatic-installation and fully-configured flags.origins: records withorigin,label,archive,component,site,trusted. These are repository evidence, not proof of historical installed provenance.- Optional
installed_archive: authenticated repository metadata for the installed revision, using the PackageArchive schema below. Omission means the old archive has not been established as available.
A PackageArchive has name, architecture, version, sha256, size, origins (same schema), and control, a string-to-string map containing Package, Version, Architecture, Source, Depends, Pre-Depends, Conflicts, Breaks, Replaces, Provides, Multi-Arch, and Essential (missing control values are empty strings). Recovery validates archive bytes, identity and control metadata against retained authenticated evidence; it uses a private offline resolver constrained to that family and preserves installation marks/holds.
impact contains sites, workers, optional schedulers, maintenance_policy (currently 2 for new reviews; omitted for historical reviews), config_hash, unit_hash, phpmyadmin (boolean), blocked_reasons, and optional notes. Each site has id, domain, path, strategy, app_type, port. Each worker has id, site_id, name, kind, command, directory, instances, stop_seconds; protocol, stop_signal, nonzero port and an octane descriptor are optional.
Qualified custom direct PHP processes retain kind: "" and use protocol: "managed-service-v1" in new policy-2 reviews. For example:
{"id":12,"site_id":8,"name":"Reverb","kind":"","protocol":"managed-service-v1","command":"php8.4 artisan reverb:start --port=8080","directory":"/home/fluxo/hotel","instances":1,"stop_seconds":42,"stop_signal":"SIGINT"}The server derives these fields from the saved process and verifies the effective service, explicit package-owned interpreter, site directory and process identities. The configured signal must be HUP, INT, QUIT or TERM and the timeout 1–86400 seconds. The timeout bounds observation, never authorizes SIGKILL. Children must also drain before mutation. Unsupported launch configurations appear in blocked_reasons. This does not add client-selected commands or signals to update endpoints.
Historical laravel_queue reviews retain their original queue-handler contract. Historical artisan_natural reviews send no signal and wait for natural exit. An unfinished generation always uses its saved policy; upgrading Fluxo cannot change its shutdown authority. Custom records, enabled state and originally stopped instances are preserved. Originally running custom commands resume once; verified successful completion is retained so recovery cannot replay it. Failed, unconfirmed or rebooted activation requires review. See custom process maintenance.
A scheduler entry has id (cron ID), site_id, identity (registration UUID), version (the actual command interpreter branch), directory, command, database (root-owned registration database path), enabled, ready, and optional legacy_boot (migration boot UUID) and migration_nonce (server-generated reload-receipt UUID). These fields are server-generated evidence, not caller-supplied executable overrides. Readiness is checked during installation review, never package discovery. Supported entries use the same admission/cgroup path for scheduled and manual execution. Their ticks are skipped during unresolved PHP maintenance; current tasks and descendants drain naturally, and successful activation restores future ticks. Custom commands/schedules remain unsupported by this automatic workflow. Qualified legacy entries wait for authenticated cron reload receipts, verified old panel admission and natural legacy-work drainage without a VPS reboot; newly registered managed entries are ready immediately. Missing/invalid established state blocks admission rather than clearing recovery evidence.
An OctaneDescriptor contains backend, directory, storage, vendor, app_name, fingerprint, grace, rr_binary, rr_worker, rr_sha256, and nullable extension. extension, when present, contains name, version, file, sha256. Backend-specific strings may be empty. These bind the approved application/native runtime and are not caller-supplied overrides. Managed, verified Swoole/RoadRunner consumers can be drained through their native master process; unsupported/custom runtimes and active FrankenPHP controllers are blocked. FrankenPHP’s embedded serving PHP is outside this APT transaction and remains unchanged. An update that changes the running Swoole native extension requires separate qualification and is blocked. Fluxo does not force-kill workers or shorten native deadlines; the application's existing request/task limits remain in effect.
A RecoveryPlan contains id, generation_id, operation_id (reviewed head), version, kind (repair or rollback), goal (before or after), created_at, observation, packages (complete target PackageArchive array), impact (same schema), and retry_fpm_reload (boolean). The latter identifies a reviewed FPM reload retry; it is not an extra request field. observation contains version, policy_hash, journal_dirty, unrelated_pending (package names), and packages: each with name, architecture, installed, state (dpkg current-state integer; 6 means fully installed), automatic, held.
Operation progress and recovery limits
An accepted apply response:
{
"id":"0a1b7fe7-18c5-4a53-a1a6-d344ae73b42a",
"kind":"apply","version":"8.4",
"plan_id":"061ce8b3-94d7-4d70-8aa1-021c01a4630f",
"status":"queued","phase":"queued","message":"","output":"",
"username":"admin","ip_address":"192.0.2.10",
"created_at":1792573200,"updated_at":1792573200,
"started_at":0,"finished_at":0,"checkpoint":"","result":null
}All operations expose those fields. kind is check, apply, repair, rollback, or legacy verify; version may be empty for a scheduled all-branch check. plan_id remains the original package Plan ID for recovery operations. Timestamps are Unix seconds, with zero before the corresponding event. output is bounded to the last 64 KiB of diagnostics. Active statuses are queued and running; terminal statuses are succeeded, failed, partial, restart_required, health_failed, and interrupted.
Progress phases include queued, waiting_for_lock, refreshing, revalidating, preparing_recovery, draining, applying, packages_updated, activating, and verifying; legacy work may report downloading. Terminal phase equals terminal status. checkpoint is initially empty and can record package_transaction or packages_updated; historical records may carry earlier checkpoint names. It is evidence, not authorization to replay a transaction.
On subsequent reads an uninitialized result is {}. Captured runtime evidence can include units (name, active, pids mapping PID to boot/process identity, cgroup, main_pid, restarts, state, sub_state, optional octane with backend, master_pid, manager_pid), sockets, default_cli, and optional signalled, signal_delivery, signal_attempts, reload_approved_head. Clients should display progress and poll the operation instead of interpreting these journals as instructions to issue signals.
Managed queue/Horizon and supported Octane consumers stop accepting new work and drain before package mutation. Persistent barriers preserve stopped services and prevent premature restart across interruption/reboot. FPM configuration, process replacement and request health are checked before success. Shared-cache Laravel restart broadcasts are not used. Missing or contradictory process identities, changed native bindings, unconfirmed signal delivery, corrupt archives or journals, dirty dpkg state, unrelated pending packages and changed repository policy can require operator intervention. Repair is scoped recovery, not unrestricted dpkg --configure -a or apt --fix-broken.
Terminal response excerpts:
{"status":"succeeded","phase":"succeeded","message":"PHP 8.4 previous package revisions restored and affected services verified. Application files, data and jobs were not rolled back"}{"status":"partial","phase":"partial","message":"The package transaction did not verify completely. Review Repair or Roll back PHP packages; no automatic rollback was attempted. Operator repair may still be required."}HTTP 202 means accepted, not installed or healthy. Poll through completion and consult recoveries for the latest reviewed action. A package transaction may complete while runtime health still fails. Neither Repair nor Rollback guarantees that every interrupted system is recoverable without manual work.
Errors
Maintenance errors use { "code": "...", "message": "..." }:
| HTTP | Code | Meaning |
|---|---|---|
400 | invalid_request, invalid_version, invalid_id | Invalid body, required field, kind, branch or UUID. |
401 | Existing authentication response | Missing/invalid JWT. |
404 | not_found | Missing plan, operation or recovery resource. |
409 | maintenance_busy | Another operation or persistent maintenance gate blocks the request. |
409 | review_changed | Runtime readiness changed or the 15-minute installation review expired. Choose Update to review again; successful package discovery remains available. |
409 | plan_changed | Stale/expired plan, superseded head, or reused UUID with another intent. |
409 | recovery_required | Resolve previous package/runtime maintenance before starting another update. |
422 | rollback_acknowledgement_required | Explicit acknowledgement is missing for an update without retained rollback. |
422 | unsupported_configuration | Unsupported action/configuration, including legacy verification requested for a recovery generation. |
503 | supervisor_unavailable | Installed root-owned Fluxo/systemd supervision is unavailable. |
500 | maintenance_unavailable | Other errors, including database failures and some operator-repair/recovery-validation failures. Inspect message; a generic error does not authorize broad repair or bypassing a hold. |
{"code":"rollback_acknowledgement_required","message":"explicit acknowledgement is required to update without verified package rollback"}{"code":"maintenance_unavailable","message":"The package journal or unrelated packages require operator repair before this scoped recovery"}{"code":"plan_changed","message":"PHP packages or affected applications changed; check for updates again"}Managed Laravel Octane enablement
GET /api/v1/sites/{id}/features includes octane_installed, octane_version, octane_available, and octane_enabled. Enable with POST /api/v1/sites/{id}/features/octane/enable; disable with POST /api/v1/sites/{id}/features/octane/disable. Both require the JWT header, an existing numeric site ID, and no request body or query fields. The server chooses the configured PHP branch, active application directory, managed command and available local port; callers do not supply a launcher or native PID.
POST /api/v1/sites/42/features/octane/enable
Authorization: Bearer YOUR_JWTA new, verified enable returns 201 with an empty body; reconciliation of an already enabled feature returns 204. Disable returns 204. New enablement checks the installed Composer capability, runtime compatibility and startup readiness before routing traffic to Octane. Pending enablement claims and running deployments exclude one another. Zero-downtime deployment is incompatible (400); missing sites return 404; unsupported configuration, custom Nginx overrides, missing Octane capability or failed readiness return 422. Other startup/cleanup/persistence failures can return 500.
If startup or cancellation leaves an uncertain live runtime, protected cleanup retains its daemon record and reserved port until native drainage can be proved. Re-enabling first retries cleanup and then performs fresh compatibility/startup verification; unresolved cleanup returns 409. Pending statuses are enable_pending, enable_publish_pending, enable_fallback_pending, and enable_cleanup_pending. They are exposed in daemon listings but do not count as octane_enabled; ordinary failed/stopped states of a previously enabled runtime retain enabled semantics. Pending site edits/deletion and generic daemon start/stop/restart return 409 to preserve recovery identity.
For interrupted publication, cleanup restores, reloads, verifies and durably records safe routing before backend removal. Failures before publication do not publish Octane routing. Custom Nginx overrides remain unsupported for enablement. Native cleanup does not force-kill in-flight work; unsupported/uncertain runtimes remain held for retry or operator action. Octane endpoint errors are plain text, unlike the PHP-maintenance JSON error envelope. For example:
HTTP/1.1 409 Conflict
Content-Type: text/plain; charset=utf-8
Octane enablement cleanup remains pending; routing was not changed: Octane service changed during failed-enable cleanupEnvironment save preference
GET /sites/{id}/env returns content and the boolean cache_config_after_save preference. POST /sites/{id}/env accepts JSON such as {"content":"APP_ENV=production\n","cache_config_after_save":true}. The optional boolean defaults to false for new and existing sites; omitting it preserves and uses the saved preference. Enabling it on a non-Laravel site returns 400. Missing sites return 404; file or preference persistence failures return 500.
After saving the file and preference, the endpoint automatically rebuilds Laravel's configuration cache when enabled, using the site's PHP version and active application directory with a two-minute timeout. It returns HTTP 200 with status: "saved" and cache_status: "success", "failed", or "skipped". Failure also includes cache_error and does not roll back the environment save. No separate command request is needed, and automatic rebuilding does not create command-history entries. Explicit commands submitted through /commands retain their normal history behavior.
Managed Laravel Queue Worker
GET /sites/{id}/features returns queue_worker_enabled, queue_worker_available, the saved queue_worker_config, the current queue_connection, and custom_queue_workers. Enable or reconfigure the managed worker with:
POST /api/v1/sites/42/features/queue-worker/enable
Content-Type: application/json
{
"connection": "redis",
"queues": "high,default",
"processes": 2,
"sleep_seconds": 3,
"tries": 3,
"timeout_seconds": 60,
"backoff_seconds": 5,
"memory_mb": 128,
"max_time_seconds": 3600,
"force": false
}Connections and queue names must be shell-safe Laravel configuration keys; sync and null are rejected. Process count is 1–16, sleep is 0–60, tries is 0–100, timeout is 1–86400, backoff and maximum runtime are 0–86400, and memory is 32–4096 MB. A successful enable returns 201 Created; reconfiguration replaces the existing managed worker only after preserving its prior settings. Horizon conflicts return 409 Conflict.
POST /api/v1/sites/{id}/features/queue-worker/disable stops and removes the managed processes and deploy hook while preserving the saved settings, returning 204 No Content. It does not remove custom daemons that happen to run artisan queue:work.
Site mutation contract
POST /sites requires an app_type of laravel, php, wordpress, node, python, or html. Choose it as a provisioning contract rather than an editable label. After creation, PUT /sites/{id} may omit app_type or repeat the current value for compatibility with older clients, but a different value returns 409 Conflict. The deployment strategy follows the same immutable-after-creation rule. Other compatible settings, such as PHP version, repository, branch, web root, and runtime-specific options, remain editable.
Laravel, PHP, and Python creation requests may omit database fields. WordPress creation requires MySQL/MariaDB. Whenever database_name is supplied, database_user and database_password are also required, the user must not be a fluxo, root, or postgres control-plane identity, and Fluxo verifies that the supplied account can access the selected database before provisioning. For generated .env portability, the database password must not contain a single quote.
Python creation accepts python_preset (django, flask, fastapi, or generic), python_entrypoint, a relative app_directory, package_manager (pip or uv), build_command, start_command, and app_port. Generic repository-backed applications require an explicit start command. The Python runtime endpoints are GET /server/python/info, POST /server/python/install, POST /server/python/restart, and POST /server/python/remove.
Domain creation accepts www_redirect as from_www, to_www, or none. When the field is omitted, an ICANN registrable root domain defaults to from_www; subdomains, explicit www. hostnames, private suffixes, and unknown suffixes default to none. PUT /sites/{id}/domains/{domain_id} updates that behavior, where domain_id 0 identifies the primary domain. The update returns 409 Conflict when the generated hostname is already owned or when the domain's active certificate does not cover every hostname required by the proposed behavior. Deactivate the domain certificate, apply the behavior change, and then issue or assign a compatible certificate.
Panel-domain endpoints are grouped under /settings/panel-domain: GET returns status, POST /letsencrypt, POST /custom, and POST /clone activate a hostname with the selected certificate workflow, GET /cloneable lists compatible custom certificates, and DELETE removes the managed proxy. Activating a panel domain does not disable direct access on the configured dashboard port.
Site network
These authenticated endpoints use Authorization: Bearer <panel-token> and JSON request bodies (Content-Type: application/json). Paths below are relative to /api/v1; id is a positive site ID. No additional query parameters are used. Network request bodies are limited to 4,096 bytes, reject unknown fields and accept exactly one JSON object. Reading status never changes Nginx.
GET /sites/{id}/network returns 200 with Cache-Control: no-store:
{
"managed": true,
"revision": "OPAQUE_NETWORK_REVISION",
"pending": false,
"protection": {"enabled": false, "username": ""},
"redirects": [],
"wildcards": []
}managed means there is no saved custom vhost. pending identifies an interrupted activation whose restoration has not been confirmed. protection.enabled is true only for confirmed managed protection; false in custom or pending mode does not assert that operator-written rules or an uncertain live configuration are unprotected. username is the saved username, never a password. Redirect rows contain id, source, destination and integer status. wildcards lists configured canonical parents; in custom mode it is empty. Revision is opaque: do not derive it from other fields or reuse it after a successful mutation.
All Network mutations require expected_revision from a fresh GET and return the complete new response above with 200. Missing revision or invalid inputs return 400; missing site/redirect returns 404; stale revision, custom mode, pending operation, active/queued deployment, conflicting state or failed activation/restoration returns 409. Authentication failures remain 401. A failed or ambiguous request must be followed by GET; never automatically replay it. No mutation response includes saved password hashes or private keys.
| Method and path | JSON fields |
|---|---|
PUT /sites/{id}/network/protection | expected_revision string; enabled boolean required. Enabling or changing credentials also requires username and a new password. Disabling needs no credentials. |
POST /sites/{id}/network/redirects | expected_revision, source, destination, integer status (301 or 302). Returns state containing the generated redirect ID. |
PUT /sites/{id}/network/redirects/{redirect_id} | Same fields as creation; redirect_id is the exact returned row ID. |
DELETE /sites/{id}/network/redirects/{redirect_id} | JSON body containing only expected_revision. Deletes that rule. |
POST /sites/{id}/network/recover | JSON body containing only expected_revision. Explicitly reinstalls the last confirmed configuration for the pending operation; never replays the proposed change. No-op if nothing is pending and revision still matches. |
Username is 1–64 ASCII letters, digits, _, ., @ or -. Password is 8–72 UTF-8 bytes without control characters. Use TLS; the API does not retrieve saved credentials. A protection change looks like this (example value only):
{"expected_revision":"OPAQUE_NETWORK_REVISION","enabled":true,"username":"staging","password":"new-example-secret"}Redirect sources are case-sensitive exact canonical ASCII paths up to 1,024 bytes: letters, digits, /, _, ., ~, + and -. No query, encoding, dot segments, regex or // prefix. ACME challenge paths are reserved. At most 100 rules per site; duplicate sources and direct local self-loops are rejected. Original request query is ignored for matching; a trailing slash is distinct. Destinations are at most 2,048 bytes: local absolute paths or HTTP/HTTPS URLs without credentials, control/whitespace characters or Nginx syntax/variables. A destination may include its own query or fragment. Redirect responses occur before Basic authentication; ACME remains public.
{"expected_revision":"OPAQUE_NETWORK_REVISION","source":"/old-pricing","destination":"/pricing?from=old","status":302}Example refusal:
{"message":"Network settings changed; refresh before saving"}A pending change blocks other site mutations and background deployment admission until explicit recovery. The operation record, last confirmed generated config and immutable credential hash files are retained for recovery. Normal regeneration uses the saved settings; a failed Nginx test/reload or persistence step restores the prior working config when possible. No success is returned when restoration cannot be confirmed.
Domain wildcard configuration
POST /sites/{id}/domains accepts domain (required hostname), optional www_redirect (from_www, to_www, none) and optional wildcard boolean (default false). *.Example.com is normalized to example.com with wildcard enabled; the UI shows that choice before submission. Success 200 contains id, site_id, canonical domain, www_redirect and wildcard. Invalid domain/WWW syntax returns 400; duplicate/reserved/overlapping ownership, custom-mode wildcard use or activation conflict returns 409. No DNS or certificate issuance occurs as a side effect.
GET /sites/{id}/domains retains its existing fields and adds revision, wildcard, wildcard_ssl_active, wildcard_ssl_state to each row. SSL state is disabled, pending, active or inactive_custom. Root ssl_active does not imply wildcard coverage. Pending/invalid/missing wildcard certificates never become ready from the root certificate alone.
PUT /sites/{id}/domains/{domain_id} accepts www_redirect, optional wildcard and expected_revision. domain_id=0 means primary; positive IDs select that site's aliases. Sending wildcard requires the row's current expected_revision; stale revisions return 409, omitted required revision 400. Legacy WWW-only requests may omit revision and preserve the current wildcard choice. Success 200 contains domain, www_redirect and wildcard:
{"expected_revision":"OPAQUE_DOMAIN_REVISION","www_redirect":"from_www","wildcard":true}DELETE /sites/{id}/domains/{domain_id} accepts no body and deletes only a positive alias ID, returning 204. It removes that parent's managed wildcard setting and certificate binding atomically after validated routing activation. Deleting an exact-host alias can expose the enclosing wildcard route if DNS still reaches the server. Primary promotion retains canonical-domain keyed settings. Exact-host sites keep Nginx priority; overlapping wildcard owners and unresolved dynamic/custom hostname claims refuse rather than silently shadow one another.
Existing SSL routes retain their formats. POST /sites/{id}/ssl/custom takes certificate (PEM leaf and optional ordered intermediate chain), private_key (matching PEM key) and domain_id (0/default primary or positive alias). GET /sites/{id}/ssl/cloneable?domain_id=N lists compatible custom sources; POST /sites/{id}/ssl/clone takes certificate_id and domain_id. For enabled wildcard parents these now require complete apex/WWW/literal wildcard SAN coverage. Invalid, expired, wrong-key, wrong-usage or incompatible coverage returns 422 before activation. Custom import succeeds with 200 (id, provider, active, plus domain for aliases). Cloning succeeds with 201 (id, provider, domain, active, source_certificate_id, source_site); an already active certificate is preserved until explicit replacement/activation. Rotating a root certificate preserves inherited alias wildcard bindings until complete replacement coverage exists, and a replacement missing an already-active primary wildcard scope refuses before changing the active certificate. No PEM or key appears in list responses.
A certificate for *.example.com covers one label, not the apex or deeper names. The generated HTTPS wildcard scope serves only the covered one-label names; uncovered/deeper matching TLS handshakes are rejected without a fallback certificate, preserving root-domain HTTPS. HTTP wildcard routing can match deeper names. HTTP-01 issuance remains ordinary-host-only; imported/cloned certificates gain no renewal automation. Cloudflare Origin CA/private issuers are not asserted to be publicly browser-trusted. See Domains and SSL.
An enabled Fluxo-managed exact panel route may sit inside a site wildcard. Missing/unmanaged panel routes refuse wildcard activation. Panel mutations return 409 before removing a route/certificate if moving/removing it would expose that hostname to an active wildcard, if a custom exact vhost conflicts, or if Network recovery is pending. Disable the covering wildcard or resolve the reported conflict first. No DNS or certificate mutation is implicit.
Site vhost
GET /sites/{id}/vhost returns the effective stored or generated configuration:
{
"config": "server {\n listen 80;\n}\n",
"customized": false,
"revision": "SHA256_REVISION",
"path": "/etc/nginx/sites-available/example.com"
}Save a complete replacement with PUT /sites/{id}/vhost:
{
"config": "server {\n listen 80;\n server_name example.com;\n}\n",
"expected_revision": "SHA256_REVISION"
}Restore the current Fluxo-generated default with POST /sites/{id}/vhost/restore and an expected_revision field. A new custom save returns 409 while managed protection, redirects or wildcard routing are active; explicitly disable/remove them first. A pending Network operation also blocks saving/restoring. In custom mode managed controls stay unavailable; restoring defaults does not reactivate explicitly disabled features. Both mutations validate the full Nginx configuration and reload it transactionally before changing the stored override. Payloads are limited to 256 KiB, stale revisions return 409 Conflict, and configurations that fail validation or activation return 422 Unprocessable Entity without replacing the last working vhost.
Firewall list responses include managed_by and an active value verified against UFW's persisted rule state. Deleting an installer-managed baseline rule returns 409 Conflict; change protected SSH, HTTP, HTTPS, or dashboard access deliberately over SSH instead. Creating a rule that already exists directly in UFW also returns 409 so Fluxo does not silently adopt and later delete an externally managed rule.
Nginx package awareness
All paths below are relative to /api/v1. Bearer authentication is required; JSON mutations use Content-Type: application/json, at most 4,096 bytes and exactly one object. Unknown fields (including any install/apply flag) are rejected with 400. There are no path/query parameters. No endpoint installs/removes/upgrades packages, changes repositories/holds or activates services.
| Endpoint | Body | Result |
|---|---|---|
GET /server/nginx/updates | None | 200 saved discovery status, Cache-Control: no-store. No APT refresh. |
POST /server/nginx/updates/check | {} | 200 completed check status (including any discovery failure). Synchronous, bounded to 90 seconds including locks, metadata refresh and inspection. Duplicate check returns 409. |
POST /server/nginx/updates/notices/dismiss | {"identity":"CANDIDATE_IDENTITY"} | 200 updated status; 409 for changed/missing candidate identity or an active check. |
A status response has this shape (sample only):
{
"snapshot": {
"state": "update_available", "reason": "A newer revision is offered by the configured APT policy.",
"binary": "/usr/sbin/nginx", "package": "nginx-core", "architecture": "amd64",
"installed_version": "1.24.0-2ubuntu7.15", "candidate_version": "1.24.0-2ubuntu7.21",
"sources": [{"origin":"Ubuntu","archive":"noble-updates","site":"archive.ubuntu.com","component":"main","trusted":true}],
"held": false, "source_identity": "OPAQUE_POLICY_IDENTITY", "identity": "CANDIDATE_IDENTITY"
},
"last_successful_check": 1795341600, "attempted_at": 1795341600,
"error": "", "stale": false, "checking": false, "notice": true,
"running_adoption": "not_verified"
}Before any successful inspection snapshot is null and last_successful_check is zero. Times are Unix seconds. Snapshot states are current (no newer candidate offered by effective policy), update_available, held (newer but not automatically applicable), unavailable (missing/untrusted/non-downloadable/older candidate) or unsupported (manual/missing/modified/ambiguous package binary). Fields unavailable in unsupported cases can be empty, not guesses. Debian comparison uses libapt, including epoch/distro revisions. Package ownership and its installed binary payload are checked; this is informational inspection using installed dpkg records, not new execution authority or independent archive certification.
Automatic discovery runs daily after a two-to-five-minute startup delay, reusing recent results. Maintenance contention defers it for five minutes; failures retry after an hour. The schedule persists across panel restarts and is not configurable through these endpoints. GET/polling reads saved status only; manual checks can run before the next due time.
last_successful_check records completed inspection, including a conclusive unsupported/unavailable state; it does not assert successful installation. Refresh/inspection/admission failure preserves the previous snapshot/time and sets error, attempted_at, stale:true, notice:false. A 200 check response with nonempty error is not a successful discovery. Results older than 24 hours (or future-dated after clock change) are stale. Example failure retains prior snapshot:
{"snapshot":null,"last_successful_check":0,"attempted_at":1795341600,"error":"Repository refresh failed; previous candidates are stale and were not accepted","stale":true,"checking":false,"notice":false,"running_adoption":"not_verified"}Malformed requests return 400, missing/expired authentication 401, duplicate/check-in-progress or changed dismissal 409 ({"message":"The available Nginx update changed; refresh before dismissing it"}), and persistence/internal failures 500. No request supports installation or caller-supplied commands. Candidate identity binds package/architecture/installed revision, candidate, configured policy/repositories and binary content; dismissal survives reopen and applies only to that identity. External SSH changes are observed on the next manual or scheduled discovery. Polling saved status is inexpensive and never refreshes APT metadata. Dependency transaction success is not certified.
GET /server/nginx/info retains binary, version, config_dir, sites_available, sites_enabled and adds version_scope:"on_disk_binary", running_adoption:"not_verified". version from nginx -v is an on-disk observation, not running master/worker version. The legacy route POST /server/nginx/restart performs configuration validation/reload, returns 204, and reports reload errors with 500; its URL is retained for compatibility. The UI labels it Reload Nginx. No caller is silently switched to a real process restart. See Nginx instructions.
SSH access security
GET /ssh/security evaluates the effective OpenSSH policy for the fluxo user and bypasses response caching. Its response includes:
{
"available": true,
"password_authentication": "yes",
"keyboard_interactive_authentication": "no",
"public_key_authentication": "yes",
"permit_root_login": "prohibit-password",
"password_login_enabled": true,
"hardened": false,
"managed": false,
"authorized_key_count": 1,
"authorized_keys_valid": true,
"can_harden": true
}Activate Fluxo's validated key-only policy with:
POST /api/v1/ssh/security/harden
Content-Type: application/json
{
"key_access_confirmed": true,
"recovery_access_confirmed": true
}Both acknowledgement fields are required. The server also requires at least one usable bare RSA, Ed25519, or ECDSA key in the fluxo user's securely owned authorized_keys file. Fluxo validates the staged syntax and effective fluxo and root policies for remote IPv4, remote IPv6, and local IPv4/IPv6 contexts before installation, validates again after installation, reloads OpenSSH, and rolls back and reloads the prior live state on failure. An unmanaged file at Fluxo's policy path returns 409 Conflict rather than being overwritten.
DELETE /ssh/security/hardening removes only the Fluxo-managed policy and returns the newly effective status. It may still report key-only access when a VPS-provider or administrator policy independently disables passwords. Hardening transitions and key mutations are serialized. DELETE /ssh-keys/{id} returns 409 Conflict when removal would leave no usable key while effective password login is disabled. Privileged human-key and deploy-key filesystem operations fail closed if .ssh is a symlink or changes during the operation.
Asynchronous operations
Site deployment returns HTTP 202 Accepted after creating a pending deployment. Poll deployment history or connect to the WebSocket stream rather than assuming the HTTP request represents completion.
GET /sites/{id}/deployments requires the normal Bearer authentication. The path id must be a positive integer site ID. The optional page query parameter selects a history page; omitted, invalid, or non-positive values use page 1. Each page contains at most 12 records, newest first. There is no request body. Invalid site IDs return 400 (Invalid site ID); database read failures return 500 (Database error). A valid site ID with no deployment records returns an empty data array.
GET /sites/{id}/deployments/{depId} refreshes one deployment independently of history pagination. It requires Authorization: Bearer <panel JWT>, two positive integer path IDs, no query parameters and no request body. 200 OK returns the single deployment object illustrated below (without the pagination wrapper), with Content-Type: application/json and Cache-Control: no-store. Invalid IDs or any query parameters return 400 Use positive site and deployment IDs without query parameters; a missing deployment or one belonging to another site returns 404 Deployment not found; a database read failure returns 500 Database error. Missing or invalid authentication returns 401 through the normal middleware. The dashboard uses this when an open deployment moves off the visible page so a completed timer stops at its recorded finish.
Deployment objects in both data and unresolved_failure include two nullable UTC RFC 3339 timestamps:
| Field | Meaning |
|---|---|
started_at | Captured atomically when a pending deployment is admitted to run, after site locks and maintenance gates. Pending or rejected admissions have no execution start. |
finished_at | Observed terminal result after the admitted lifecycle, including preparation, scripts, runtime hooks, health checks, rollback, cleanup, and metadata collection. Database persistence retries retain the same captured finish. |
Execution duration is finished_at - started_at only when both boundaries are present and valid. Queue waiting is excluded. Early failures after admission have both boundaries even if no script started. A failure before admission has no execution duration. Restart interruption marks a running deployment failed while preserving its start and leaving finished_at as null, because restart detection is not the actual execution end. Historical rows and completed repository-sync (repo_sync) records without captured boundaries remain unknown; created_at and updated_at are never substitutes. Every new deployment or rollback request creates its own pending ID; later triggers and failure dismissal preserve earlier attempt timing.
Example 200 OK (Content-Type: application/json):
{
"data": [
{
"id": 42,
"site_id": 4,
"commit_hash": "e4c9b8a1a2b3c4d5e6f708192a3b4c5d6e7f8091",
"commit_message": "Update application",
"commit_author": "Alex Developer",
"branch": "main",
"trigger_source": "manual",
"status": "success",
"target_commit_hash": "",
"output": "Deployment completed successfully.\n",
"failure_reason": "",
"started_at": "2026-11-20T12:00:05.125Z",
"finished_at": "2026-11-20T12:01:12.375Z",
"created_at": "2026-11-20T12:00:00Z",
"updated_at": "2026-11-20T12:01:12Z"
}
],
"current_page": 1,
"total": 1,
"per_page": 12,
"unresolved_failure": null
}For a pending or historical record without timing evidence, the fields are explicitly "started_at": null, "finished_at": null. A failed interrupted execution may have a known started_at and "finished_at": null.
Runtime installation, backup execution, and other long-running operations may also continue beyond an initiating UI transition. Read the resource status returned by the relevant endpoint.
WebSocket
Deployment and command logs are delivered through:
wss://YOUR_SERVER_IP:9595/api/v1/ws?site_id=SITE_ID&token=YOUR_JWTWith a panel domain, use wss://admin.example.com/api/v1/ws?... instead. The managed proxy forwards WebSocket upgrades and the server requires the Origin hostname to match the request hostname.
The server validates the token and WebSocket origin. Keep the token out of logs and avoid sharing connection URLs.
Errors
Fluxo uses standard HTTP status families:
400for invalid input401for missing or invalid authentication404for missing resources409for lifecycle conflicts422for valid requests that cannot be applied to the current app/runtime state500for unexpected or system-operation failures
Some error responses are plain text because the Vue client surfaces the response body directly. API clients should handle both text and JSON errors.
Mutation safety
The API has no separate read-only token scope. A valid administrator JWT can perform privileged dashboard operations. Store it only in a trusted automation environment and prefer short-lived login sessions over embedding credentials in scripts.
PHP repository migration
These routes use the /api/v1 prefix and require Authorization: Bearer <token>. All POST bodies use Content-Type: application/json, reject unknown fields and trailing JSON, and are limited to 4 KiB. They never accept repository URLs, keys, filenames or commands from the client.
| Method and path | Request | Result |
|---|---|---|
GET /server/php/updates/repository | No parameters or body | 200 local configuration status; no network refresh or mutation |
POST /server/php/updates/repository/review | Required request_id UUID; no plan_id | 202 supervised repository_review operation |
POST /server/php/updates/repository/apply | Required plan_id UUID from review and request_id UUID | 202 supervised repository_apply operation |
Use GET /server/php/updates/operations/{operation_id} to poll progress and read the final operation. Request IDs are idempotent for the same operation intent; reusing one with different intent returns 409. A successful review operation’s result is a public repository review. The stored plan’s source-file contents stay private. Review expiry is 15 minutes. A pending interrupted migration can resume its original plan after expiry; failed or consumed plans require a new review.
Example review request:
{"request_id":"b1a43128-9fa2-4dc5-9a57-8581041a8791"}Example successful review result:
{
"id":"cdd3b690-3702-4342-b4d8-f6cb411c905a",
"created_at":1792598400,
"codename":"noble",
"architecture":"amd64",
"files":["/etc/apt/sources.list.d/ondrej-php.sources","/etc/apt/sources.list.d/fluxo-sury-php.sources"],
"disabled_ppa_entries":1,
"key_fingerprint":"15058500A0235D97F5D10063B188E2B695BD4743",
"rollback_unavailable":[],
"package_blockers":{},
"retained_extensions":[],
"migration_blockers":[]
}files lists source and managed branch-priority files changed by setup; the scoped signing key is also provisioned. rollback_unavailable names current packages whose complete verified rollback archive was unavailable during review. package_blockers maps installed PHP branches to installation issues under the proposed repository policy. retained_extensions names independent extensions preserved at verified installed revisions. migration_blockers identifies unsupported preservation or configuration conditions that prevent the switch itself. Review performs no package installation or active-source changes.
Example apply request:
{"plan_id":"cdd3b690-3702-4342-b4d8-f6cb411c905a","request_id":"f0585a5c-91a6-4ab3-91cd-4a7775887989"}Status responses contain state (current, available, blocked, interrupted), message, and can_review. An interrupted response also includes resume_plan_id and its public review. Status reads inspect local files only. Successful apply invalidates previous PHP discovery; clients must request a new check before reviewing package installation. It never installs PHP or restarts applications.
Malformed requests return 400 invalid_request; unauthenticated requests return 401; a missing plan returns 404 not_found; concurrent maintenance returns 409 maintenance_busy; expired/consumed reviews return 409 review_changed; unresolved recovery or repository publication returns 409 recovery_required; unsupported configuration returns 422 unsupported_configuration; an unavailable installed supervisor returns 503 supervisor_unavailable. Worker-time repository/network, inventory-drift or conflict failures are reported through the accepted operation’s terminal status and message, for example:
{"status":"failed","kind":"repository_apply","message":"Installed PHP packages or marks changed since repository review; review again"}Source publication is journaled across individual durable file replacements. Preimage restoration refuses concurrent operator edits. Resuming repository setup reconciles its journal; it is not a broad APT repair. PHP recovery policy authorizations bind exact repository transitions and immutable retained manifests; unknown source or pin edits remain invalid.
Node.js runtime updates
All routes below use the /api/v1/server/node/updates prefix and require Authorization: Bearer <token>. Send mutation bodies as Content-Type: application/json. There are no query parameters or caller-supplied versions, URLs, hashes, paths, commands, services or process IDs. Responses are JSON with Cache-Control: no-store, except successful dismissal (204, empty). GET requests read stored evidence only and never perform network discovery or install a runtime.
| Method and suffix | Path/body fields and validation | Success |
|---|---|---|
GET / (omit trailing slash) | No parameters or body. | 200 Status. |
POST /check | Required request_id: UUID identifying this intent. | 202 Operation, kind check. Daily checks use the same supervised discovery path. |
POST /plans/{id}/review | id: current snapshot's discovery_id UUID. Body {}. | 200 immutable Plan, kind apply for a managed runtime or migrate for a supported legacy source; installation blockers appear in impact.blocked_reasons. Review may stage/validate the inactive candidate but never activates it or stops apps. |
POST /apply | Required plan_id and request_id UUIDs. | 202 Operation. Requires an unblocked review less than 15 minutes old, the same successful discovery less than 24 hours old, and unchanged runtime/application evidence. |
POST /migrate | Required plan_id and request_id UUIDs; exactly the same JSON validation as /apply. | 202 Operation, kind migrate. Requires a fresh, explicitly reviewed migration plan and unchanged legacy source/discovery. Ordinary /apply cannot approve a migration, and /migrate cannot approve an ordinary update. |
GET /operations | No parameters or body. | 200 array of the latest 30 Operations, newest first. |
GET /operations/{id} | id: operation UUID. | 200 Operation, including current or terminal progress. |
POST /operations/{id}/recovery-plan | id: latest recovery generation's current head operation UUID. Required kind: repair or rollback. | 200 immutable recovery Plan, including freshly authenticated retained.before/retained.after Releases. Only the newest generation can be recovered; both exact retained releases and consumers must still qualify. Review downloads/verifies both official archives against current bundled trust; it never stops apps or changes the active runtime. |
POST /recovery/apply | Required plan_id and request_id UUIDs. | 202 Operation for the reviewed repair or rollback. Review expires after 15 minutes and must still name the current generation head. |
POST /notices/dismiss | Required nonempty candidate_id: exact snapshot candidate fingerprint. | 204. Dismissal applies to that candidate; a different candidate can notify again. |
Mutation JSON is limited to 4096 bytes. Unknown fields, malformed/trailing JSON, invalid UUIDs and unsupported recovery kinds return 400 invalid_request. Replaying a request ID with the same operation kind and plan returns the original operation before busy/expiry admission; reusing it for a different intent returns 409 review_changed. A new check has its own request ID. Accepted work may still fail worker-side revalidation; 202 does not mean installed or healthy.
Recovery review can also return 409 review_changed when an inspected consumer or Scheduler boundary is blocked. Its message includes the actual blocker; the status is not necessarily caused by an expired discovery check. For example:
{"code":"review_changed","message":"The Node.js update review changed or expired; check and review again: Scheduled task \"Laravel Scheduler\" on app.example: Refresh the managed Scheduler dispatcher with the current Fluxo installer before updating Node.js"}Legacy discovery uses snapshot.state: "migration_available", migration_available: true, a server-derived legacy_source and the authenticated official candidate. It does not set update_available or create an automatic installation notice. Expired evidence disables migration. A migration Plan has kind: "migrate", migration holding the approved legacy source and after holding the staged official Release; its empty before is not an official proof of the APT runtime. For example, explicitly approve the returned migration plan with:
POST /api/v1/server/node/updates/migrate
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"plan_id":"061ce8b3-94d7-4d70-8aa1-021c01a4630f","request_id":"f5f34f6b-9d65-4f2a-bbd5-46b4fd0d7637"}The 202 response uses the existing Operation schema with kind: "migrate". The migration/legacy_source receipt has schema (currently 1), kind (nodesource-apt-local-baseline), version, npm, package_version, architecture, node (exact path, sha256, device/inode/mode), native (dependency file receipts), npm_tree_sha256, package_files_sha256, links (original node/npm/npx presence and symlink targets), state (base64 prior toolchain receipt), state_mode, manager_tree_sha256, manager_links (exact command symlinks) and managers (versions). These are server-derived read-only evidence; requests never accept them. They record a local baseline, not official archive authentication.
Migration generations use plan.migration, separately refreshed migration_target (official Release) and migration_step (last journaled command-link/receipt mutation intent). They do not fabricate retained.before as an official Release. The existing recovery routes return a fresh Plan with migration and after equal to the reauthenticated official target; kind: "rollback" selects the original APT source instead. Repair selects the official destination. Both verify the unchanged legacy baseline, exact original/target link states and original consumer intent. Changed APT files, foreign command links or unavailable package locks fail closed. Native package locks disappear after interruption; API recovery never overwrites changed APT files to make rollback pass.
Example check and installation review:
POST /api/v1/server/node/updates/check
Authorization: Bearer <token>
Content-Type: application/json
{"request_id":"8f9e6390-a0c9-4c83-92c5-f93f4aa8166b"}{"id":"7e75f822-4900-43dc-a5d7-29d03227235b","kind":"check","plan_id":"","status":"queued","phase":"queued","message":"","created_at":1792695600,"updated_at":1792695600,"username":"admin","ip_address":"192.0.2.10"}After the check succeeds, read GET /api/v1/server/node/updates, then review its discovery ID:
POST /api/v1/server/node/updates/plans/b38ab807-96c7-465c-8183-729a531d3952/review
Authorization: Bearer <token>
Content-Type: application/json
{}Review returns an immutable plan with the fields described below. For example, its version/impact portion can contain:
{"kind":"apply","before":{"release":{"version":"24.19.0","npm":"11.17.0"}},"after":{"version":"24.20.0","npm":"11.18.0"},"impact":{"sites":[{"id":1,"domain":"app.example.com","mode":"server","app_type":"node"}],"units":[{"id":3,"site_id":1,"domain":"app.example.com","name":"fluxo-daemon-3.service","active":true,"bun_only":false}],"blocked_reasons":[]}}The example above is an excerpt: the real response also includes plan IDs/timestamps and complete release, runtime and unit evidence. Version numbers are illustrative. Submit the returned plan ID, not the discovery ID:
POST /api/v1/server/node/updates/apply
Authorization: Bearer <token>
Content-Type: application/json
{"plan_id":"29ef141c-e76b-47f2-9ad3-d11c75d06542","request_id":"f7114422-0cd5-4454-8ad9-eb4d995c74b7"}Success returns 202 with an Operation, initially queued. Poll its operation ID. After an interruption or for retained rollback, use the current recoveries[].head:
POST /api/v1/server/node/updates/operations/05959774-bb58-49a4-8b8b-3a34524b7817/recovery-plan
Authorization: Bearer <token>
Content-Type: application/json
{"kind":"rollback"}POST /api/v1/server/node/updates/recovery/apply
Authorization: Bearer <token>
Content-Type: application/json
{"plan_id":"bb7bb88d-141d-4c1a-9d10-59b2c0111977","request_id":"d23e349a-376b-4fef-8c32-1b7aa527207d"}A Status contains snapshot, nullable active_operation, operations (latest 30), recoveries (newest generation, at most one), and boolean locked. An initial response is:
{"snapshot":{"candidate_id":"74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b","state":"unchecked","checked_at":0,"attempted_at":0,"discovery_id":"","installed":{"release":{"version":"","npm":"","architecture":"","filename":"","sha256":"","manifest_sha256":"","signer":"","trust_revision":""},"root":"","managers":null},"candidate":null,"update_available":false,"notice":false},"active_operation":null,"operations":[],"recoveries":[],"locked":false}Snapshot fields: state is unchecked, available, current, stale or check_failed; checked_at is last successful discovery time; attempted_at is last attempted discovery; optional error explains failure; discovery_id names the successful discovery; installed is the authenticated observed runtime; nullable candidate is the exact newer same-major release; candidate_id is its fingerprint; update_available requires a fresh successful check; notice additionally respects dismissal. Times are Unix seconds. A failed check retains previous evidence for inspection, disables its eligibility and schedules a later retry. Historical lts flags do not establish current support: a reviewed support policy excludes EOL/non-LTS majors and itself expires.
A Release contains version and bundled npm (strict version strings), architecture (x64 or arm64), server-derived official filename, archive sha256, signed manifest manifest_sha256, verified public-key signer fingerprint, bundled keyring trust_revision, and optional tree_sha256 after staging/authentication. Candidate discovery does not yet have a tree digest. An OwnedRuntime contains release, absolute root, and managers (Corepack/pnpm/Yarn/Bun observed versions). These are evidence, not request overrides.
A Plan contains server-derived consumer_policy (currently 3), id, kind, discovery_id (normal apply), created_at, optional recovery generation_id and head, before (OwnedRuntime), after (Release), and impact. Impact contains sites, units, blocked_reasons, php_policy (currently 2; historical 1 retains its original shutdown contract), optional php_consumers and optional php_resumes. Each site has id, domain, mode and app_type; this is build-impact context, not a claim that every listed site executes Node. Each unit has id, site_id, domain, name, generated command, directory, port, active, enabled, definition fingerprint, main_pid, pids (PID-to-boot/start-identity map), bun_only, and optional observed systemd state and sub_state. Recovery also reports listener_present (boolean); active retains the original generation's running/stopped intent, even if the current service has failed. bun_only describes the recorded runtime observation and NEVER exempts a unit from holds, full-cgroup drainage, restart or verification. A Bun application also includes bun: {path, version, sha256}, binding the existing root-managed Bun executable, including for stopped Bun launchers. Any Node children must use the selected exact Node executable; Bun must remain unchanged. All originally active generated applications, including Bun, restart; originally stopped units remain stopped. Runtime-only fields are server-derived and never authorize client-selected signals or commands. Recovery authenticates the saved service configuration, barriers, retained runtimes, cgroup/process identities and any existing listener ownership. Failed, transitional and missing-listener states can be reviewed for recovery; health is verified after activation. Naturally exiting processes do not invalidate a recovery review; changed configuration, unknown runtimes and foreign listeners still block it.
Each php_consumers entry contains branch (exact CLI branch, independent of the site's FPM setting), domain, consumer (id, site_id, name, unchanged kind, optional protocol, exact command, directory, instances, stop_seconds, optional stop_signal/port/octane descriptor), php: {path, version, sha256} for the unchanged package-owned CLI, and units. Each PHP unit contains original enabled, exact normalized effective definition, and runtime: {name, active, pids, cgroup, main_pid, restarts, state, sub_state, natural?, managed_stop?, octane?}. active is retained intent; state/PIDs are current recovery observations. Every instance must be present. New protocol managed-service-v1 includes managed_stop: {signal, seconds} bound to the saved consumer; it sends that declared signal and requires full process-group drainage within its observation timeout, without forced kill. Historical protocol artisan_natural omits managed_stop, sends no signal, waits for full natural exit, and permits at most one journaled resume. The natural flag also retains once-only activation evidence for new custom processes; it is not by itself signal permission. Node coordination records schema 2 for policy 2 and schema 1 for historical policy 1; mismatched contracts refuse before effects. Optional php_resumes maps unit name to {boot, after_monotonic_usec, invocation?, completed?}. A successful completion is not replayed; missing/failed/rebooted/replaced execution evidence keeps recovery pending. These are server-derived observations, never client overrides. PHP-FPM and PHP packages are not changed by a Node operation.
Recovery Plans additionally contain retained: {before: Release, after: Release} with newly authenticated proofs for both original exact targets. after must equal the chosen retained target. Reauthentication can update signature/manifest/trust evidence only after current-key signature verification and canonical archive/tree validation; version, architecture, filename, npm, archive checksum and tree remain fixed. The worker repeats this preflight and persists the proofs before installing holds or stopping apps. Network/trust/persistence failures reject without runtime mutation; the queued operation alone closes admission during this preflight. Revoked/removed/expired signers fail closed. Fresh official signatures from currently trusted keys can authenticate the same recorded archive, but cannot replace its payload.
All daemon records are inventoried during normal/recovery review and worker revalidation, including global/orphan/duplicate records. Only positively inspected supported Node unit identities or qualified PHP consumer identities qualify; nonempty managed_kind is not an exemption. Unqualified Python/PHP/custom/unknown workers produce impact.blocked_reasons identifying the process name and site domain, even when stopped. For example: Background process "Bridge" on app.example.com requires manual Node.js maintenance. Global or orphaned records with no domain are explicitly marked no site domain available; they remain blocked. A new/changed unsupported record invalidates execution before proof staging or service holds. No request field or acknowledgement bypasses this policy. Cron inventory likewise includes every global/site/orphan record and requires exact managed Scheduler qualification plus verified admission. Review notes and blockers use domains and process/task names; numeric IDs remain in structured API fields for routing and identity checks.
An Operation contains id, kind (check, apply, repair, rollback), plan_id, status, phase, message, created_at, updated_at, initiating username, ip_address, and optional recovery generation_id. Statuses include queued, running, succeeded, failed, interrupted, recovery_required, rolled_back. Phases include queued, waiting_for_lock, staging, reauthenticating, stopping, activating, verifying, rolling_back, complete, failed, launch_failed, interrupted and recovery_required. Display message/status and poll; phase names do not grant permission to replay work. A verified automatic rollback reports rolled_back with the original failure, rather than update success.
Reviews with missing/older consumer_policy are rejected with 409 review_changed, including already queued work. Fresh recovery reviews can coordinate historical bun_only generations: they authenticate current managed Bun receipts, preserve the original service identity and active/stopped intent, and persist fresh coordination separately before holds. For historical generations without PHP coordination, a fresh review may explicitly add currently qualified PHP consumers; their current intent is captured separately and then bound across recovery attempts. Receipt/configuration drift after review rejects preflight without mutation; immutable historical plans are not rewritten.
A recovery Generation contains id, current operation head, state, original immutable plan, captured boot UUID, activation goal (after or before), optional retained (same before/after Release proof schema as recovery Plans), optional coordination (Impact with fresh runtime receipts used for execution), activation_attempted (durable Node activation intent), and optional php_state. php_state contains schema 1, immutable original consumer set, current attempt unit observations, native shutdown stops receipts, durable natural-command resumes, and optional server-owned evidence: {owner, generation, units, state}. Evidence owner is node; units are exact natural service names, and state is preparing, held, releasing or released. This independent systemd reference retains execution results across worker exit until they are journaled; it grants no dispatch or replay permission. Older generations acquire a reference on reviewed recovery without changing their original plan. Unknown schemas or inconsistent protocols fail closed. Node-owned PHP hold rows independently keep admission closed through partial cleanup. coordination covers every original supported unit, including historically exempted Bun units; absence requires a new recovery review before execution. States include prepared, stopping, activating, starting, rolling_back, verified, recovery_required, succeeded, rolled_back. Refreshed proofs never overwrite the original plan. A completed generation stays completed during non-mutating recovery preflight; its queued/running operation supplies admission until proofs and mutation intent are durable. Open generations and leftover service barriers keep admission closed regardless of a worker's terminal status. Success/rollback retains the newest recovery point; later updates supersede it. Recovery is manual approval; the worker only attempts automatic rollback after its own apply failure. Worker loss/reboot never authorizes an automatic new installation.
| HTTP | Code | Meaning |
|---|---|---|
400 | invalid_request | Invalid bounded JSON, unknown fields, UUID or recovery intent. |
401 | Plain text Unauthorized | Missing or invalid Bearer token. |
404 | not_found | Unknown plan/operation or no matching current recovery head. |
409 | maintenance_busy | Active operation, installer, PHP maintenance or unresolved Node recovery/hold. |
409 | review_changed | Expired/stale/superseded review, discovery/runtime/consumer drift or conflicting request-ID intent. |
422 | unsupported_configuration | Unsupported operation/recovery kind or configuration. Runtime blockers are normally returned in a successful review's impact.blocked_reasons. |
503 | supervisor_unavailable | Requires production/root/systemd supervisor. |
500 | maintenance_unavailable | Other trust, filesystem, database, staging or runtime inspection failures. The message explains the reason; it does not authorize broad repair. |
Example errors:
{"code":"review_changed","message":"The Node.js update review changed or expired; check and review again"}{"code":"maintenance_busy","message":"Runtime maintenance is in progress or requires recovery"}{"code":"maintenance_unavailable","message":"Node.js release signature is untrusted or invalid; update Fluxo trust data before retrying"}No update API performs a major migration, changes independent package-manager versions, rebuilds an application, or restores application data. Verification proves managed process/TCP/runtime adoption, not every application route. See Node.js runtime updates for supported consumer rules, cooperation boundaries, downtime and recovery limits.
Interactive Laravel Tinker
Tinker executes arbitrary administrator-supplied PHP under the shared fluxo account. It is not a site isolation boundary. HTTPS, a real root-managed Fluxo service with systemd 249 or newer and unified cgroup v2, a Laravel site, its configured PHP CLI and installed production Tinker dependency are required. There are no caller-selectable executables, paths, PHP versions or shell commands in these requests.
Create a connection ticket
POST /api/v1/sites/{id}/tinker/sessions
Headers: Authorization: Bearer <JWT>, Content-Type: application/json, and Origin: https://panel.example.com (exact scheme/host/port of the panel). JWT must have valid sub, integer ver, and future exp. Path id is a positive site ID. No query parameters.
{"password":"your-current-fluxo-password"}password is required, nonempty and at most 1024 bytes. Unknown fields and trailing JSON are rejected; the request body is limited to 4 KiB. Only the authenticated account's password is accepted; there is no username override or bootstrap fallback.
Success: 201, JSON, Cache-Control: no-store:
{"session_id":"ba5728e6fb4b2167bd60cf6f7033ed52","ticket":"67dd22d8a6430191c4a9bd401fa9fabfb7b00ca142533e4107f7f1d0f21b2d74","expires_at":"2026-11-01T18:00:30Z","max_seconds":900,"idle_seconds":300}Both ID and ticket are opaque; do not persist them. Ticket expires after thirty seconds and can be consumed once. Creating it does not start PHP. Four pending/active sessions globally and one per account/site are permitted. Five connection attempts per account and IP in fifteen minutes are allowed, including successful attempts.
Errors are plain text: 400 invalid ID/body/password length; 401 invalid/expired authentication or changed credentials; 403 incorrect password (Invalid password), missing/mismatched Origin or insecure transport (Tinker requires HTTPS and an exact same Origin); 409 unavailable/non-Laravel/deleting site, deployment/maintenance pending or session capacity (Disconnect the existing Tinker session first); 429 connection attempt limit; 415 missing/non-JSON Content-Type; 503 unmanaged/non-root service environment, unsupported systemd/cgroup capabilities, or shutting down. For example, an unsupported manager returns plain text Tinker requires systemd 249 or newer before issuing a ticket. Normal authentication/maintenance middleware can also reject requests before the handler.
Connect the console
GET /api/v1/tinker/ws?session={session_id}&ticket={ticket}
This is a WebSocket upgrade with exact Origin matching ticket creation. No Bearer header or panel JWT query parameter is used. Both query fields are required opaque values from the ticket response. Tickets are consumed atomically before process startup, including failed upgrade attempts. Account version/credentials/expiry, site deletion, queued/running deployments and runtime maintenance are checked again. A failed connection needs a new ticket.
Success: HTTP 101 Switching Protocols. Authentication/Origin failures return plain-text 401/403; conflicting lifecycle admission returns 409. Connection errors after upgrade use a WebSocket close frame.
Client messages are JSON text frames:
{"type":"input","data":"$value = 41;\r"}{"type":"input","data":"echo $value + 1;\r"}{"type":"resize","rows":35,"cols":120}After the terminal emulator has parsed server output, acknowledge the byte count with a JSON text frame:
{"type":"ack","bytes":4096}bytes must be a positive integer no greater than the outstanding output count (maximum 256 KiB). Only acknowledge after the emulator's write callback; this prevents native browser WebSocket buffers from growing while rendering is stalled. Invalid or excessive acknowledgements disconnect.
type is required and must be input, resize or ack. Input data is a string of terminal keystrokes; \u0003 is Ctrl-C and \u0004 is Ctrl-D. Resize rows must be 2–200 and cols 10–400. All client frames are limited to 16 KiB, with 1000 total messages and 128 KiB per second. Within that limit, input is limited to 200 messages and 64 KiB per second. Unknown message types, malformed JSON, invalid dimensions and binary client frames disconnect the session.
Server output uses binary frames containing terminal bytes (incremental UTF-8/ANSI). Use a terminal emulator, never HTML insertion. Output queue is bounded to 32 chunks of at most 4 KiB; slow consumers disconnect. The browser also disconnects above 256 KiB awaiting terminal parsing. The server sends at most 256 KiB of output without render acknowledgements, then disconnects. Writes have a five-second deadline. Server pings every twenty seconds; clients must pong within the sixty-second read timeout. Heartbeats/resizes do not reset the five-minute input-idle timeout. Absolute lifetime is fifteen minutes or JWT expiry, whichever comes first. Authentication revocation is checked every second.
Normal close code 1000 includes reasons such as Session ended, Disconnected after inactivity, Authentication expired or changed, or Disconnected or session limit reached. Startup failure uses 1011 with Tinker could not start. Network errors may end without a close frame. No reconnect/replay semantics exist: closing ends this process and the next connection starts fresh. Code may already have committed effects before interruption.
Disconnect
DELETE /api/v1/sites/{id}/tinker/sessions/{session_id}
Headers: Authorization: Bearer <JWT> and exact Origin. Both path fields must identify the authenticated account's session and site. No body or query parameters. Returns 204 empty when cancellation is requested; whole-process cleanup follows. Also usable to revoke an unconsumed ticket. Socket closure independently cancels active execution.
Plain-text errors: 400 invalid site ID; 401 invalid authentication; 403 invalid Origin; 404 absent session, wrong site or wrong owner. Console transcripts are not retained. Only actor, site, session ID and lifecycle metadata are logged; proxies should omit ticket query strings from access logs.
GitHub account connections
All endpoints below require Authorization: Bearer YOUR_JWT. JSON requests also require Content-Type: application/json. The account endpoints in the table take no query parameters. Account {id} path parameters must be positive integers. Tokens are encrypted at rest and never returned.
| Method and path | Request | Success |
|---|---|---|
GET /api/v1/github/accounts | No body | 200, array of account objects |
POST /api/v1/github/accounts | token (required, nonempty after trimming, at most 4096 UTF-8 bytes); name (optional label, trimmed, at most 100 UTF-8 bytes) | 201, new account object |
PUT /api/v1/github/accounts/{id} | token (required, same limits); ordinary replacement must authenticate the same numeric GitHub user ID, including after a username change. Optional name is accepted with the same label limit; the existing account label is retained. Optional legacy_recovery enables the explicit administrator recovery described below. | 200, updated account object |
POST /api/v1/github/accounts/{id}/check | No body | 200, refreshed account object, including unsuccessful validation/check results |
POST /api/v1/github/accounts/{id}/recovery-review | v0.4.51+: token required, same limits as replacement. Optional name is accepted with the same label limit and ignored. No recovery/password fields. | 200, read-only stored/proposed identity and linked-site review |
DELETE /api/v1/github/accounts/{id} | No body | 204, empty body |
Example replacement request:
PUT /api/v1/github/accounts/1
Authorization: Bearer YOUR_JWT
Content-Type: application/json
{"token":"YOUR_NEW_GITHUB_PAT"}From v0.4.50, for a connection whose github_user_id is zero and whose saved token returns GitHub 401, the same PUT can include legacy_recovery. This is an explicit administrator reassociation, not historical ownership verification. It requires the current authenticated user's panel password and session version; the numeric identity of an already verified connection cannot be overridden.
{
"token": "YOUR_NEW_GITHUB_PAT",
"legacy_recovery": {
"username": "example-owner",
"password": "YOUR_CURRENT_FLUXO_PASSWORD",
"confirm": true,
"github_user_id": 12345,
"sites": [{"site_id": 42, "repository": "example-owner/application"}]
}
}username is required, trimmed, at most 100 UTF-8 bytes, and must match the new token's authenticated GitHub username case-insensitively. password is required, at most 1024 UTF-8 bytes, and verified for the signed-in panel user. confirm must be true. sites contains at most 1024 unique positive site_id values and exact repository strings from the connection's current deployment_access.sites list; use [] when there are none. The complete request retains the 16 KiB body limit and rejects unknown fields. Recovery is accepted only on PUT, preserves account/site IDs and keys, clears the same caches, records an Activity event, and returns the ordinary account response after deployment checks. Password/token values are never included in that response.
Additional recovery errors are 400 for missing confirmation or invalid input, 401 Incorrect panel password or a stale/missing session, 409 for an already verified owner, confirmation-username mismatch, changed site list, changed panel authentication or an already connected new identity, 429 after repeated password failures, and 503 Saved-token verification is temporarily unavailable; retry before recovering this connection for saved-token network, rate-limit or permission failures. Rejected recovery preserves the original credential and links. If a password or session version changes before commit, recovery refuses.
From v0.4.51, the optional positive legacy_recovery.github_user_id binds approval to the numeric account shown by recovery-review. If the token authenticates a different ID, replacement returns 409 The new token's GitHub account changed; review the connection again. Existing v0.4.50 recovery requests remain accepted; the dashboard always sends the reviewed ID.
POST /api/v1/github/accounts/{id}/recovery-review uses the same Bearer JWT, JSON content type, positive account path ID and 16 KiB request limit. It validates the new token and saved token but does not save credentials, backfill the account ID, repair keys, update access reports or authorize recovery. Its response has Cache-Control: no-store:
{
"stored": {"name": "Work GitHub", "username": "example-old", "github_user_id": 0},
"proposed": {"username": "example-owner", "github_user_id": 12345},
"needs_recovery": true,
"sites": [{"site_id": 42, "domain": "app.example.com", "repository": "example-owner/application", "status": "unchecked", "message": ""}]
}stored is the saved local record; a zero ID remains unverified. proposed is authenticated by GitHub using the submitted token. sites is the current linked repository snapshot, not a new deployment-access check. needs_recovery is true only when GitHub rejects the saved token with 401. If the saved token still verifies the same owner, it is false and the client can use ordinary replacement. The final approval independently rechecks the identities, password and site list. Changing the token in the dashboard discards the review and confirmation.
Review errors include the existing 400 payload/token/ID errors, 404 Connection could not be loaded; reopen the dialog, 409 for an already verified local owner, an already connected proposed identity or a mismatched valid saved identity, and 503 for temporary saved-token validation failures. Read/database failures return 500; missing or invalid panel authentication returns 401 through middleware.
Account objects contain id (local connection ID), github_user_id (immutable numeric GitHub identity, zero until verified with the saved credential or explicitly established by administrator recovery), name, username, created_at, updated_at, token_expires_at (RFC 3339 timestamp or null when unavailable), token_status (unchecked, valid, invalid, or error), linked_sites (number of associated sites with repositories), token_checked_at (timestamp or null), and deployment_access:
{
"id": 1,
"github_user_id": 12345,
"name": "Work GitHub",
"username": "example-work",
"created_at": "2026-11-01T10:00:00Z",
"updated_at": "2026-11-18T12:00:00Z",
"token_expires_at": "2026-11-30T15:04:05Z",
"token_status": "valid",
"token_checked_at": "2026-11-18T12:00:00Z",
"linked_sites": 1,
"deployment_access": {
"checked_at": "2026-11-18T12:00:02Z",
"sites": [{
"site_id": 4,
"domain": "app.example.com",
"repository": "example-work/app",
"status": "verified",
"message": "SSH repository access verified"
}]
}
}deployment_access.sites lists site_id, domain, repository, status (unchecked, verified, error), an actionable message, and an optional reason. Error reasons are private_key_unavailable, ssh_access_failed, check_timeout, check_canceled, site_changed, registration_failed, or check_failed. Historical reports may omit reason; verified and unchecked results normally omit it. Reasons describe the observed check stage, not an inferred remote cause. checked_at is null until a current site/repository snapshot has been checked. Repository or membership changes invalidate the saved snapshot. A token accepted by GitHub can still produce 200 with a site result such as {"site_id":4,"domain":"app.example.com","repository":"example-work/app","status":"error","message":"GitHub denied access; check token permissions, organization policy and API rate limits"}. Saving the token succeeds independently of repository checks; inspect every site result before treating deployment access as verified. For example, a missing, unreadable or invalid private key returns {"site_id":4,"domain":"app.example.com","repository":"example-work/app","status":"error","message":"site private deploy key is missing or unreadable","reason":"private_key_unavailable"}. Reconnecting cannot restore that private key. A generic failed SSH probe uses reason: "ssh_access_failed"; it does not establish whether remote registration, repository permissions or connectivity caused the failure.
Connect and replacement requests validate the token against GitHub, capture its expiry header when available, and check linked repositories using each site's SSH identity as the fluxo OS user. They also reconcile GitHub registration of the existing public deploy key and persist its registration ID before the final SSH check. This recovers a previous remote success whose local save failed, even if SSH access already works. Retry token replacement after fixing a reported local save failure; /check alone does not repair that tracking. These requests do not rotate the server's private key, trigger a deployment, or manage webhooks.
Each SSH probe is limited to 15 seconds. Remote validation and site reconciliation have a two-minute operation budget; timed-out site checks are reported as errors with check_timeout. Client cancellation is reported separately as check_canceled, without claiming a deadline elapsed. Short, bounded final database writes and reads can finish after request cancellation to preserve and report a successful credential save. If a request is interrupted, reload the saved account state before retrying.
The /check action validates the saved token and independently checks SSH access without registering keys. SSH results can remain verified even when token validation fails; an expired API token does not itself prove that a deploy key is unusable. GitHub 401 becomes token_status: "invalid"; temporary network, API-limit and permission failures become "error" rather than being misreported as expiry. Unknown expiry is not proof of a nonexpiring token. Tokens can be revoked before their recorded expiry.
Disconnect atomically removes the credential/cache and unlinks sites, retaining their verified numeric GitHub user ID for reconnect recovery. A later connection with that ID restores the recorded associations across username changes. A different ID using a recycled login receives none of those sites. Older unassociated sites without this identity record are not automatically claimed. Existing applications and private keys remain untouched. Disconnect does not revoke existing GitHub deploy keys or webhooks; previously authorized deployments can continue. Disable Push to Deploy separately to pause that automation. Site-scoped repository/key/webhook management never substitutes another connected account's credential for an explicitly disconnected site.
Errors are plain text: 400 Invalid account ID, 400 Invalid account payload (malformed/unknown fields/oversized body), 400 Token is required (maximum 4096 characters); account label must be at most 100 characters, 400 Could not validate GitHub token: GitHub rejected the token; update or reconnect it, 404 Account not found, 409 This GitHub account is already connected; use Update token, 409 Replacement token must belong to the same GitHub account, or 409 Another GitHub connection operation is in progress; retry shortly. Missing/invalid panel authentication returns 401. Database or encryption failures return 500; a failure after storing a credential explicitly starts with Account saved, but… or Token saved, but…, so reload account state before retrying. A rejected replacement leaves the previous credential and links unchanged. For legacy connections, Fluxo uses the saved credential to establish ownership. If GitHub rejects the saved token, ordinary replacement and disconnect of a linked legacy account return 409 The saved credential could not verify this legacy GitHub account. Its site links have been preserved. The explicit password-confirmed recovery above is the supported replacement path in that case. Saved-token network or permission failures during replacement return 503 instead of authorizing recovery.
GET /api/v1/github/repos and GET /api/v1/github/branches accept a Bearer JWT, an optional local account_id, and refresh=1 to bypass cached results. Branch listing requires repo in owner/name format. Site settings supply the site's own account ID. Omitting the account selects the first connection. Explicit zero, invalid and missing account IDs return an empty array. Example results include [{"full_name":"example-work/app","private":true,"clone_url":"https://github.com/example-work/app.git","ssh_url":"[email protected]:example-work/app.git"}] for repositories and [{"name":"main"}] for branches. An omitted repository returns 400 Missing repo parameter. GitHub failures with no cached result return 500, for example github api error: status 403.
Site creation (POST /api/v1/sites) now requires an existing account when selecting a GitHub repository. github_account_id must be nonnegative; an omitted/zero ID with a repository resolves to the first connected account and stores that explicit association. Missing or concurrently disconnected accounts return 409 (Connect a GitHub account before selecting a repository or GitHub account disconnected while creating the site; refresh accounts and retry), rather than leaving a dangling site association. Negative account IDs return 400 Invalid GitHub account.
Server system management
All four endpoints require the existing administrator JWT (Authorization: Bearer <token>). JSON mutations use Content-Type: application/json, reject unknown fields/malformed types and perform no package installation. Status reads never schedule a reboot.
Read system status
GET /api/v1/server/system has no body or query parameters. It returns 200 with Cache-Control: no-store:
{
"boot_id": "a05b3ef6-4d28-4d14-947d-a1bc41d35601",
"running_kernel": "6.8.0-88-generic",
"updates": {
"state": "enabled", "editable": true,
"detail": "Covers configured Ubuntu security repositories. Third-party software may need separate updates.",
"automatic_reboot": "disabled", "last_result": "unknown"
},
"restart_required": {"state": "required", "packages": ["libc6"], "detail": "Reported by Ubuntu: libc6"},
"reboot": null
}running_kernel is the actually booted release read from the protected /proc/sys/kernel/osrelease, or null when missing, unsafe or unreadable. It is not the latest installed/candidate package. Status reads refresh it after reboot and have no mutation side effects.
updates.state is enabled, disabled, not_installed, unsupported, external or unknown. Only editable:true permits toggling. automatic_reboot is enabled, disabled or unknown; Fluxo never changes it. Optional last_attempt is systemd's actual timestamp string, omitted when unavailable. last_result is successful, failed or unknown, describing the last observed unit attempt, not comprehensive patch coverage. Restart state is required, not_required or unknown; packages are bounded reported reasons, not an inferred update list. reboot, when present, contains the latest request shape below, including a possible preparing, unconfirmed or failed phase. Unavailable protected state returns 503 {"code":"system_status_unavailable","message":"..."}. Clients must not clear a confirmed warning on request failure or unknown restart state.
Set automatic security updates
PUT /api/v1/server/system/security-updates accepts exactly:
{"enabled": true}A missing/null/non-boolean enabled or extra field returns 400. Success 200 returns the verified updates object. 409 {"code":"system_management_blocked","message":"..."} describes unsupported/external policy, active package/runtime/recovery work, restart pending, unsafe state or failed effective verification/rollback. The prior state must remain displayed until verified success; a failed rollback explicitly requires SSH review. Existing repositories, exclusions, timer schedules and administrator auto-reboot settings are not rewritten.
Request a restart
POST /api/v1/server/system/reboots accepts the current boot UUID and an explicit confirmation:
{"boot_id":"a05b3ef6-4d28-4d14-947d-a1bc41d35601","confirm":true}Missing/invalid boot ID, absent/false confirmation or extra fields return 400. Boot drift, duplicate requests and incompatible maintenance return 409 system_management_blocked before another restart is scheduled. On 202:
{
"id":"e485c9e2-c5af-46d9-9dbf-04c2abb3f223",
"boot_id":"a05b3ef6-4d28-4d14-947d-a1bc41d35601",
"phase":"accepted",
"requested_at":"2026-11-22T15:30:00Z",
"expected_services":["nginx.service","php8.4-fpm.service"],
"detail":"Restart accepted; waiting for shutdown."
}The helper delays shutdown for ten seconds after readiness, retaining maintenance/package exclusion. Acceptance is not completion. Failure to obtain confirmed scheduling in the bounded HTTP window returns 503 {"code":"restart_unconfirmed","message":"...","reboot":{...}}; it may still have been scheduled. Observe status first and never automatically retry the mutation. A pre-shutdown scheduling failure has phase:"failed" and an actionable detail. Once a shutdown request has been sent, an uncertain result is phase:"unconfirmed"; the helper retains maintenance exclusion until shutdown or explicit operator review. No arbitrary timeout releases those locks while a reboot might still be pending. Flow context may persist request ID, boot ID and timestamps in browser storage, never credentials.
Inspect expected services after return
GET /api/v1/server/system/reboots/{id}/services accepts the request UUID as its only path parameter. Invalid UUID returns 400; a missing request or unchanged boot returns 409 system_management_blocked. After a confirmed different boot, 200 returns:
[{"unit":"nginx.service","state":"running","detail":"systemd: active / running; result success"}]States are running, starting, stopped, failed or unknown. The bounded inventory contains only managed units that were enabled and running before the request; absent/intentionally stopped units are excluded. Clients allow a bounded startup grace period, show actual named failures/unknown states, and preserve useful diagnostics on polling failures. Authentication expiry (401) means sign-in is required, not that the server is offline. Fluxo reachability alone is not service readiness, and service state is not hosted-site health. No automatic service repair is performed.
Informational Activity and client error presentation
GET /api/v1/system/activity keeps the existing administrator authentication, optional site_id, bounded limit (1–100, default 50) and nonnegative offset, and its {items,total,limit,offset} response. Global/site feeds and pagination omit classified pure PHP discovery/repository-review completion entries, including older entries of those exact generated kinds. Existing rows and durable operation/event diagnostics are not deleted. Actual apply, repository changes, repair, rollback/recovery and their failure outcomes remain visible, as do security and ordinary create/edit/delete/deploy events. Node discovery already omits Activity; Nginx/Fluxo status checks do not emit it. Check failures remain in their runtime status/error/details endpoints.
HTTP errors retain their status, JSON/text bodies and structured code/details. Dashboard formatting does not change those API contracts; clients should inspect the returned status and payload for recovery decisions. See Errors.
