Skip to main content
Station exposes an HTTP API on the same address as its web UI, normally http://<station-host>:6555. Scripts can manage settings, Station tokens, and stored snapshots without opening a browser. The UI reads the same backend state, so API changes also appear there. Use the Scout API to create backup jobs, trigger backups, or restore files on a machine. Station stores encrypted snapshots and never receives the Scout key.

Authenticate

You sign in to manage Station. An admin session lets you mint a Station token. Scout uses that token to upload and recover snapshots. Station separates management authentication from Scout upload authentication: Station recognizes an admin by looking up the session cookie (or the automation token’s owner) and checking the account’s is_admin flag in its database. Automation requests must also pass their token’s scope checks. Call GET /api/session/me with your cookie to check authenticated and user.is_admin. A Station token does not grant management access to /api/..., and an operator session does not authenticate /backup/.... Session in the tables means a signed-in account; Admin also requires admin access. Accounts are intended for one operator, and Scout has its own separate session. The examples use a POSIX shell and curl; the settings example also uses jq. Replace password placeholders with your own values. Use your HTTPS address for remote access; see Session cookies over HTTPS. Sign in and save the cookie for subsequent calls:
The response contains status and user. If user.must_change_password is true, change the password before calling other management endpoints. This is required on the first admin sign-in, even with a custom INITIAL_ADMIN_PASSWORD:
Sessions expire seven days after sign-in. Keep the cookie jar private, reuse it between calls, and sign in again when it expires. Signing out deletes the current session. Changing your password signs out other browsers while keeping the calling session. Sign Out All Browsers ends all your browser sessions in this app. Automation tokens are revoked separately.

Automation tokens

For scripts or an external MCP adapter, open Admin → Users & Access → Automation Tokens. Choose a name, expiry, and permissions; copy the returned token once. The token belongs to the existing operator account. It is valid only in the app that issued it, and it stops working if revoked, expired, or its owner no longer has admin access or must change their password. Select multiple scopes when needed. read excludes settings and secret-bearing key, hook, certificate, and notification endpoints. manage is broad: it includes settings, hooks, keys where available, deletion, and Station token management where available. There is no per-job or per-instance ownership model. Creating, listing, and revoking automation tokens requires an admin session cookie:
Use the returned secret as a bearer token:
GET /api/session/me also accepts an automation token and returns its metadata under automation_token. The endpoint tables below describe session access; automation tokens additionally require the applicable scope. An invalid bearer token returns 401 even if a valid cookie is also present. Browser writes from another origin are rejected with 403. Serve the UI through the same origin as its API, and preserve the request host through a reverse proxy. Ordinary curl requests without browser origin headers continue to work.

Overview, settings, and maintenance

List snapshots

To request only one overview section, pass section=settings, section=storage, or section=snapshots. Without a section, the response includes all three:
The scouts array contains scout_id, each Scout’s instances, and each instance’s scout_instance_id and jobs. Each job has job_name and snapshots; each snapshot’s filename is in name, alongside size_bytes, mtime, and optional unusual information. Use those filenames for downloads, deletion, and restore requests. URL-encode each path component when constructing a request URL.

Change settings

POST /api/settings takes the settings object itself, without a surrounding settings property. It replaces the submitted settings; omitted fields fall back to defaults and environment overrides. Read current settings, change the desired fields, then submit the full object:
Station has no GET /api/settings; read settings from the overview. See Station configuration for fields and environment precedence. retention_keep_last is the number of snapshots kept per job and Scout instance; the per-archive upload size limit is separate. Read current values again before a later update rather than replaying an old settings file.

Station tokens

These are the tokens Scouts use for /backup/.... The older route and JSON names remain for compatibility: minting returns the Station token in credential, and Scout saves it as scout_credential. Mint a token for one Scout installation:
ttl_days defaults to 365 and accepts 1 to 3650. A normal token allows one instance. For a shared token, set shared: true and max_registrations from 2 to 10000. The endpoint also accepts a ttl_days query parameter; a nonzero JSON ttl_days takes precedence. Keep the returned token private; Station doesn’t provide an endpoint to retrieve it later. A normal token binds on the first Scout upload, and recovery requires an existing binding. List issued tokens with GET /api/credentials, then revoke by token_hash before or after a Scout uses one. The instance-based revoke route remains available. Revoking a shared token stops every instance using it. See Station tokens for binding and replacement rules.

Snapshots and instances

Snapshot downloads are binary application/octet-stream responses containing the stored archive. An encrypted snapshot stays encrypted even though its filename ends in .tar.zst. Browser decryption, file browsing, and individual-file downloads run in the frontend; Station has no API that returns decrypted files from an encrypted snapshot. Use the Scout key on your client or restore through Scout. For example, after replacing the example IDs and filename with values from the overview:
The instance-delete endpoint accepts cleanup_missing=true to remove stale records when the instance’s files are missing. Without it, that case returns 409 with a detail object containing message and cleanup_available. Deleting an instance does not revoke its token. See Delete a Scout instance.

Restore requests

Omit the body or send {} to target the original instance. To choose another registered instance, supply both target_scout_id and target_instance_id:
Station returns 201 with request and notified. The request includes its id, source and target IDs, job_name, filename, status: "pending", and created_at. notified only reports whether Station delivered a notification hint to Scout; the saved request can still be retrieved when it is false. The source registration must include a Scout key fingerprint, and an explicitly selected target must have a bound Station token. The request does not send a Scout key or write any files. Retrieve and accept it through the target’s Scout API, or use Scout’s UI. For another Scout instance, provide the original snapshot’s key to the receiving Scout. Requests expire after one hour. See Restore requests from Station.

Notifications, hooks, and certificates

JSON writes to these settings endpoints replace the listed fields within their section. Include every value you want to keep. File uploads use multipart form data instead of JSON. For example:
See Notifications, Hooks, and Trusted certificates for supported values and file requirements.

Accounts

Scout upload and recovery protocol

The following routes use a Station token, not an operator session. Scout normally calls them for you. For automation that backs up a folder, create the job and request a run through the Scout API. Use this protocol directly when implementing a compatible client.

Upload a snapshot

Every backup is a full, self-contained archive. A compatible client compresses and encrypts the archive before uploading; these routes do not create archives from source folders. Send Authorization: Bearer <station-token> on each request. Chunk and finalize requests must use the token that owns that upload session. Initiation reserves an instance atomically, including the shared registration limit. Existing sessions from older releases are checked against their instance binding. Initiation takes: Resume from the returned next_offset. Send chunks up to the recommended size and use the new next_offset after each successful chunk. If initiation reports a stored duplicate, the client can use stored_as without uploading it again. Finalize after sending all bytes. An offset conflict returns 409 with detail.status: "offset_mismatch" and detail.next_offset. A checksum failure at finalization returns 409 with detail.status: "checksum_mismatch" and a reset offset. Read the returned details before retrying. Station’s per-archive upload limit is independent of count-based retention.

Download for recovery

All downloads return stored archive bytes. These responses also include X-Relay-Snapshot-Filename with the selected filename. For example, with STATION_TOKEN, SCOUT_ID, and SCOUT_INSTANCE_ID set to your own values:
Forced backups can share a fingerprint. Use an exact filename or restore request when you need a particular older snapshot.

Errors and automation

Send JSON bodies with Content-Type: application/json, except for multipart file uploads and raw upload chunks. API errors generally return a detail property containing a string or an object with further information:
Don’t repeatedly log in for every API call. Check HTTP status and response fields, and avoid blindly retrying destructive actions or creating multiple restore requests.

How API changes appear in the UI

Station’s dashboard refreshes its overview every 15 seconds, showing the same settings, instances, and snapshots used by scripts. Changes are visible on the next successful refresh; they aren’t pushed instantly. An open editor keeps its draft, and other panels may need reopening to fetch new values. Refresh after external changes before editing settings so an older draft doesn’t overwrite them. Scout keys supplied to Station’s UI stay in the browser session. Managing snapshots through the API doesn’t populate those browser keys or perform browser-side decryption.

MCP and running without a browser

An external MCP adapter can call these HTTP endpoints using an automation token and expose actions such as listing snapshots or requesting a restore. Use the API so the same validation and snapshot state are used by both the adapter and the UI. Station currently has no built-in MCP server or setting to disable the frontend. You can automate it without using the UI; the published app still serves the UI alongside the API.