Skip to main content

Runtimes & Runtime Servers API

Runtimes represent language/runtime types (Node.js, Python, Go, Java, etc.) with versions and OS-specific install/remove scripts. Runtime resources can be created on the canvas and connected to instances; connecting a runtime to a server installs that runtime on the instance via SSH. Runtime servers are HTTP/server options per runtime type (e.g. Node → Express/Nginx/Caddy, Python → Gunicorn/Nginx). All endpoints require authentication. Runtime catalog endpoints are global; runtime resource endpoints are scoped by project and environment.

Runtimes catalog (global)

List runtimes

  • GET /api/runtimes
Returns active runtimes from the runtimes table (used for create-resource dropdown and runtime selection). Query parameters: Example:
Example response:

Runtime servers (per runtime type)

List runtime servers

  • GET /api/runtimes/servers
Returns HTTP/server options for a given runtime type (e.g. node → Express, Fastify, Nginx, Caddy). Used to choose which server stack to use with a runtime. Each server has OS-specific install/remove scripts (same structure as runtimes). Query parameters: Example:
Example response:
Common runtime → server mappings:

Runtime resources (project/environment-scoped)

Runtime resources are canvas cards that reference a runtime (name + version). They can be connected to instances; on connect, the backend installs the runtime on the instance via SSH using OS-specific install scripts. See Resource Connections for runtime → instance connection behavior.

Create runtime resource

  • POST /api/:projectSlug/:environmentSlug/runtimes
Creates a runtime resource (canvas card) for the given project and environment. Path parameters: Body: Example:
Example response (201 Created):

Get runtime resource

  • GET /api/:projectSlug/:environmentSlug/runtimes/:id
Returns a single runtime resource by its database ID. Path parameters: Example:
Example response:

Delete runtime resource

  • DELETE /api/:projectSlug/:environmentSlug/runtimes/:id
Deletes the runtime resource (soft delete). If the runtime was connected to instances, disconnect those connections first; disconnecting a runtime → instance connection runs the runtime’s remove script on the instance. Path parameters: Same as Get runtime resource. Example:
Example response:

Relationship to other APIs

  • Unified resources: Runtime resources appear in GET /api/:projectSlug/:environmentSlug/resources with resourceType (or type) runtime. Positions can be updated via Resource Positions.
  • Resource connections: Runtime → instance connections are allowed (see Resource Connections and allowed_connections table). On connect, the backend installs the runtime on the instance via SSH; on disconnect, it runs the runtime’s remove script.
  • Seeding: Runtimes are seeded with npm run seed:runtimes; runtime servers with npm run seed:runtime-servers (see backend scripts/).