Application instance:
api.applications.fetch(id) returns an Application. When the app has a website domain bound to it, it is returned as a WebsiteApplication — refine the type at runtime with app.isWebsite() before using .network (see Network).
Application properties
In v4,
app.custom is null when no custom domain is set (was undefined in v3).Getting the application status
app.getStatus() returns an ApplicationStatus instance with the live runtime state.
Summary status for every application
To avoid one request per app, callapi.applications.statusAll():
Getting the logs
app.getLogs() returns the most recent log output as a string.
Rate limited to 1 request per application every 5 seconds, plus a burst of 20 requests per 10 seconds per user.
Getting metrics
app.getMetrics() returns the last 24 hours of CPU, RAM and network samples (up to 288 points, one every 5 minutes).
Real-time event stream
app.realtime() opens a Server-Sent Events stream. See the dedicated Realtime page for a full example.
Lifecycle
All lifecycle methods resolve toboolean (true on success).
Deleting an application
Refreshing the application data
app.fetch() refetches the application from the API and returns a brand-new Application instance. Use it when you suspect the cached data is stale.

