api.apps and takes the app id first. An appId can also be the composite <appId>-<workspaceId> of an app shared through a workspace.
api.account.me(): its applications array has every app the key can see.
Getting an application
Status
status(appId) returns the live state with formatted values:
{ raw: true } to get numbers instead (cpu in %, ram in MB, network.total and network.now as [in, out] byte pairs):
uptime is a timestamp (when the app started), not a duration. Use Date.now() - status.uptime for how long it has been up.Status of every application
statusAll() returns one summary per app the key can see, in a single request. cpu and ram are only present while the app runs.
Start, stop and restart
SquareCloudAPIError with status 409, a code and an empty message:
“Already started” and “already stopped” are errors too. If they mean success for you, handle them:
Logs
logs(appId) returns the latest console output as one string ("" when there is none).
Metrics
metrics(appId, { range }) returns usage points, newest first. The default, range: "24h", covers the last 24 hours, one point every 5 minutes (every 10 minutes for apps under 512 MB). range: "7d" returns one point an hour for the last 7 days, on Pro and Enterprise plans for apps of 512 MB or more. Other plans and smaller apps get the 24-hour answer without an error, so check the points you got rather than the range you asked for. An unknown range is 400 INVALID_PARAMETERS.
Domains and load balancers
domains() lists the default and custom hostnames of every app. loadBalancers() lists the domains shared by several apps, with your plan’s limit.
Deleting an application
Next steps
Commit and upload
Create an app from a zip or send files to one.
Application API reference
The REST endpoints behind these methods.
Manage apps from the CLI
The same actions from the terminal.

