Skip to main content
Every method on this page lives on api.apps and takes the app id first. An appId can also be the composite <appId>-<workspaceId> of an app shared through a workspace.
To list your apps, use 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:
Pass { 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

The server holds these calls open until the container acts, so they wait at least 120 s before timing out. When the platform refuses the action, the call throws a 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).
For a live stream of logs, use Realtime.

Metrics

metrics(appId) returns the last 24 hours, one point every 5 minutes, newest first.

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.
To set a custom domain, see Network.

Deleting an application

Deletion is permanent. Create a snapshot first if you may need the files again.

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.