API reference
Every site has history. The same actions as over SSH and MCP. Within /v1, changes are only additive. The base address is https://satama.dev, and the full contract, in OpenAPI 3.1.0, is at https://satama.dev/v1/openapi.json. This page lists its 57 routes.
Using it
- Sign with a token. Send
Authorization: Bearer sat_..., a token made over SSH withtoken add <name>. a personal API token (sat_...), created over SSH with: token add <name>. - Errors are problems (
application/problem+json) with a stablecodeand adetailwritten for people. - Long actions are operations. A route that answers 202 returns an
Operation; follow it withGET /v1/operations/{id}?wait=30. Send anIdempotency-Keyheader to retry a create safely. - Changes stay additive within
/v1: fields and routes are added, never taken away.
curl -H "Authorization: Bearer $TOKEN" https://satama.dev/v1/me
Fields marked * are required. Every SSH command and its route are side by side in Commands.
You and operations
/v1/meWho this token acts as, and the org's health checks that are failing or aren't being run
Returns: Me
/v1/me/ssh-keysThe SSH keys of the person this token acts for (add and remove them over SSH)
Returns: [SSHKeyView]
/v1/me/ssh-keys/{key}Remove one of your SSH keys: refused for API tokens and apps, so this answers 403; remove keys over SSH (ssh-key rm)
Returns: SSHKeyView
/v1/operations/{id}An operation; ?wait=N waits up to N seconds (at most 30) for it to finish
Query: wait
Returns: Operation
/v1/operations/{id}/secretTake an operation's one-time secret (shown once, to whoever started it)
Returns: Secret
Your org: people, tokens and apps
/v1/orgs/{org}/auditThe audit log: who did what, when, and what happened (query: server, machine, who, since, limit). Owners and admins see everything; a member their own entries, and what was done in the projects they reach, without others' commands, addresses, tokens and apps
Query: server, project, machine, who, since, limit
Returns: [AuditView]
/v1/orgs/{org}/invitesThe invites that are waiting (never their codes)
Returns: [InviteView]
/v1/orgs/{org}/invites/{invite}Withdraw an invite by its id: its code stops working (owners and admins)
Returns: InviteView
/v1/orgs/{org}/mcpThe apps that can act in the org over MCP (a person approves one over SSH: mcp approve <code>)
Returns: [AppView]
/v1/orgs/{org}/mcp/{app}End an app's access at once, by its number (admins any app; members the ones they approved)
Returns: AppView
/v1/orgs/{org}/membersWho is in the org, with their roles and the projects they're held to, and the invites that are waiting (for a member held to projects, who can get into those). Inviting, changing roles and projects and removing people are done over SSH (member add, member projects, member role, member rm, org leave): a token can't change who is in an org
Returns: MembersView
/v1/orgs/{org}/operationsThe org's latest operations, newest first (?limit=N, at most 200; a member sees their own)
Query: limit
Returns: [Operation]
/v1/orgs/{org}/tokensList API tokens (create them over SSH); for a member held to projects, their own
Returns: [TokenView]
/v1/orgs/{org}/tokens/{name}Revoke an API token
Returns: Revoked
Servers
/v1/orgs/{org}/serversList servers (for a member held to projects, those their projects are on, by name and status)
Returns: [ServerView]
/v1/orgs/{org}/serversAdd a server of a size, on a node satama runs (an operation); the org's allowance says how many, of which sizes
Body (AddServerRequest): location string, name* string, size* string
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}Delete a server with every site and save on it, for good (an operation)
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/backupsWhat is off-site for a server's machines: the newest backed-up save, how many backups and their size
Returns: [MachineBackups]
/v1/orgs/{org}/servers/{server}/resizeGive a server another size (an operation)
Body (ResizeServerRequest): size* string
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/statsWhat a server (or ?machine=<name>, with ?project=<name>) used over time: ?since=2h, 24h (the default), 7d, up to 30d
Query: machine, project, since
Returns: Stats
/v1/orgs/{org}/servers/{server}/templatesThe templates for new machines, and their state on this server
Returns: [TemplateView]
/v1/orgs/{org}/servers/{server}/usageWhat a server and its machines are using right now (?project=<name> for one project)
Query: project
Returns: Usage
Projects
/v1/orgs/{org}/servers/{server}/projectsA server's client projects, their machines, and how many it may have (for a member held to projects, theirs alone)
Returns: ProjectList
/v1/orgs/{org}/servers/{server}/projectsMake an empty project on a server (owners and admins); otherwise the first machine in a project makes it
Body (AddProjectRequest): name* string
Headers: Idempotency-Key
Returns: ProjectView
/v1/orgs/{org}/servers/{server}/projects/{project}Remove an empty project from a server, with its network (off its last server, the people held to it lose it)
Returns: ProjectView
Machines
/v1/orgs/{org}/servers/{server}/machinesList a server's machines (?project=<name> for one project)
Query: project
Returns: [Machine]
/v1/orgs/{org}/servers/{server}/machinesCreate a machine (an operation)
Body (CreateMachineRequest): autosave boolean, branch string, build string, build_memory string, cpu string, dir string, disk string, memory string, name* string, os string, port integer, processes string, project string, public boolean, repo string, site boolean, template string
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}Get a machine
Query: project
Returns: Machine
/v1/orgs/{org}/servers/{server}/machines/{machine}Delete a machine, its site and all its saves, for good (an operation)
Query: project
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/copyCopy a machine as it is now, while it keeps running (an operation); a WordPress site moves to its new address
Query: project
Body (CopyRequest): name* string, project string
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/execRun a command in a machine as root, through its shell, and return its output (at most 50 seconds and 1 MiB per stream)
Query: project
Body (ExecRequest): command* string
Returns: CommandResult
/v1/orgs/{org}/servers/{server}/machines/{machine}/limitsGive a machine its own memory, CPU, disk or process limit within its server's, change one, or take it away ("none"); unset fields stay as they are (owners and admins)
Query: project
Body (LimitsRequest): cpu string, disk string, memory string, processes string
Headers: Idempotency-Key
Returns: Machine
/v1/orgs/{org}/servers/{server}/machines/{machine}/logsWhat an app (made with repo) printed: its last lines, oldest first, and a cursor where they end; with after=<that cursor>, only the lines that came since (query: limit, 1 to 1000, default 100; after)
Query: project, limit, after
Returns: AppLogs
/v1/orgs/{org}/servers/{server}/machines/{machine}/renameRename a machine (an operation; a running machine restarts, and its web address stays)
Query: project
Body (RenameRequest): keep_hostname boolean, name* string
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/restartRestart a machine, by force after 30 seconds (an operation; a stopped machine is started)
Query: project
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/startStart a machine (an operation; a running machine stays as it is)
Query: project
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/stopStop a machine, by force after 30 seconds (an operation; a stopped machine stays as it is)
Query: project
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/updateBuild an app's new version from the newest commit of its branch and put it in the app's place (an operation; rebuild: true builds the same commit again)
Query: project
Body (UpdateRequest): build_memory string, rebuild boolean
Headers: Idempotency-Key
Returns: 202, Operation
Saves, changes and restores
/v1/orgs/{org}/servers/{server}/machines/{machine}/autosaveTurn a machine's automatic saves on or off. Off stops its hourly saves and, because they're made from those, its off-site backups; saves made by hand keep working, and the saves and backups it has stay and run out as they would have (owners and admins)
Query: project
Body (AutosaveRequest): on* boolean
Headers: Idempotency-Key
Returns: Machine
/v1/orgs/{org}/servers/{server}/machines/{machine}/changesWhat changed in a machine's files since a save (query: since, until, all=1); the machine must be running
Query: project, since, until, all
Returns: Changes
/v1/orgs/{org}/servers/{server}/machines/{machine}/changes/fileOne file line by line, since a save (query: path, since, until); the machine must be running
Query: project, path, since, until
Returns: FileDiff
/v1/orgs/{org}/servers/{server}/machines/{machine}/restoreRestore a machine to a save (an operation)
Query: project
Body (RestoreRequest): no_check boolean, save* string
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/savesA machine's history (saves, including from before restores)
Query: project
Returns: [Save]
/v1/orgs/{org}/servers/{server}/machines/{machine}/savesSave a machine now
Query: project
Body (SaveRequest): name string, replace_oldest boolean
Headers: Idempotency-Key
Returns: Save
/v1/orgs/{org}/servers/{server}/machines/{machine}/saves/{save}Delete a save, for good (the newest of that name in the machine's history)
Query: project
Returns: Save
/v1/orgs/{org}/servers/{server}/machines/{machine}/undoUndo a machine's latest restore or update (an operation; undoing again redoes it)
Query: project
Headers: Idempotency-Key
Returns: 202, Operation
Sites and sharing
/v1/orgs/{org}/servers/{server}/machines/{machine}/accessWho gets a machine's site: private (only browsers let in with a share link) or public, and its links without their secrets
Query: project
Returns: SiteAccess
/v1/orgs/{org}/servers/{server}/machines/{machine}/accessMake a machine's site public ({"public": true}) or private ({"public": false}); a new site and every copy start private
Query: project
Body (AccessRequest): public* boolean
Headers: Idempotency-Key
Returns: SiteAccess
/v1/orgs/{org}/servers/{server}/machines/{machine}/access/linksA share link into a machine's private site, for you or anyone you give it to, no account needed: reusable until it expires or is removed, and the browsers that used it get in until then. The link is a secret, returned once; tools can send its key (its last path segment) in a Satama-Key header
Query: project
Body (ShareLinkRequest): days integer, note string
Returns: SiteLink
/v1/orgs/{org}/servers/{server}/machines/{machine}/access/links/{link}Remove one of a site's links by its id: it stops working, and so does every browser that got in with it
Query: project
Returns: Removed
/v1/orgs/{org}/servers/{server}/machines/{machine}/requestsA site's latest requests, newest first (query: since=1h, after=<RFC 3339 time>, status=5xx or 404, limit); visitors' addresses stay on the server
Query: project, since, after, status, limit
Returns: [RequestEntry]
/v1/orgs/{org}/servers/{server}/machines/{machine}/siteGive a machine a web address ({"on": true}) or take it away ({"on": false}); a WordPress site keeps its address (an operation)
Query: project
Body (SiteRequest): on* boolean, port integer
Headers: Idempotency-Key
Returns: 202, Operation
/v1/orgs/{org}/servers/{server}/machines/{machine}/site/portSay which port of the machine its site's requests go to ({"port": 3000}): 80 unless set, for a web server; an app listening elsewhere needs its port named. Nothing in the machine is changed
Query: project
Body (PortRequest): port* integer
Headers: Idempotency-Key
Returns: SiteAccess
Health checks
/v1/orgs/{org}/servers/{server}/machines/{machine}/checkA machine's health check and its last run, without running it (404 when it has none)
Query: project
Returns: MachineCheck
/v1/orgs/{org}/servers/{server}/machines/{machine}/checkGive a machine a health check, or replace its check. One of: an HTTP request made from outside it, on its network, passing when it answers 200 to 399 ({"http": "/health"}, on its site's port or 80 unless "port" is given); a connection to a port ({"port": 6379}); or a command run in it as root with sh -c, passing when it exits 0, like Docker's HEALTHCHECK ({"command": "mysqladmin ping"}). With interval_seconds 30, timeout_seconds 10, retries 3 and start_period_seconds 0 unless given (a timeout with http or port is at most 10). It's run once first and kept only if it passes. Programs in the machine can see the command while it runs, so a password belongs in a file it reads
Query: project
Body (CheckRequest): command string, http string, interval_seconds integer, port integer, retries integer, start_period_seconds integer, timeout_seconds integer
Headers: Idempotency-Key
Returns: MachineCheck
/v1/orgs/{org}/servers/{server}/machines/{machine}/checkTake a machine's health check away
Query: project
Returns: Removed
/v1/orgs/{org}/servers/{server}/machines/{machine}/check/runRun a machine's health check now; the answer says whether it passed and, if not, why
Query: project
Headers: Idempotency-Key
Returns: MachineCheck