Skip to main content

Server/Instance Management Endpoints (Project-Based)

  • POST /api/projects/:projectSlug/servers - Create server (EC2 or GCP Compute VM) in a project. Provider from project’s cloud connection. GCP requires imageId (e.g. projects/debian-cloud/global/images/...), optional instanceType (default e2-micro). (requires authentication)
  • GET /api/projects/:projectSlug/servers - List all servers for a project (requires authentication)
  • GET /api/projects/:projectSlug/servers/:instanceId - Get server details (requires authentication)
  • PUT /api/:projectSlug/:environmentSlug/resources/:resourceId/sync - Sync/refresh instance data from cloud provider (use unified resources API)
Delete: Server (instance) deletion is performed only via DELETE /api/:projectSlug/:environmentSlug/resources/:resourceId. Use the instance’s database ID. See Resources API — Delete Resource by ID. Note: All project server endpoints now use project slugs instead of IDs. The instanceId parameter remains the AWS instance ID.

Project Management API Examples

Create Project:
Note:
  • name is required
  • slug is optional - if not provided, it will be auto-generated from the name
  • The slug must be globally unique (across all users). If the provided slug is already taken, a number will be appended to make it unique.
List Projects:
Get Project Details:
Set Default Project:
Update Project (including setting as default and custom slug):

Cloud Connection API Examples

List Connections for Project:

Environment Management API Examples

Create Environment:
List Environments:
Get Environment Details:
Set Default Environment:
Update Environment (including setting as default and custom slug):

Server Management API Examples

Create Server (in default master environment):
Create Server (in specific environment by slug):
List Servers (all environments):
List Servers (filtered by environment slug):
Get Server Details:
Delete Server: Use the unified resources API with the instance’s database ID:
Sync/Refresh Server Data from Cloud Provider: Note: Instance sync is now performed through the unified resources API. Use the unified sync endpoint instead of the type-specific endpoint. Unified Sync Endpoint: PUT /api/:projectSlug/:environmentSlug/resources/:resourceId/sync See Resources API — Sync Resource from Cloud Provider for details.
Example Response:
Note: The sync endpoint:
  • Fetches the latest instance details from the cloud provider (AWS, GCP, or Azure)
  • Updates the database with current state, IP addresses, and instance type
  • Handles terminated instances (updates state to ‘terminated’ if not found in the cloud provider)