Skip to main content

Unified Resources Endpoints

Resources are listed by project and environment (workspace/project-based API). There is no global list endpoint. Use the resource-by-ID endpoints for get, update, and delete instead of type-specific APIs (e.g. /servers/:id, /databases/:id).
  • GET /api/resources/summary - Get summary statistics of resources
  • GET /api/:projectSlug/:environmentSlug/resources - List all resources for a specific project and environment
  • GET /api/:projectSlug/:environmentSlug/resources/:resourceId - Get a resource by ID
  • PATCH /api/:projectSlug/:environmentSlug/resources/:resourceId - Update a resource (name, position)
  • PATCH /api/:projectSlug/:environmentSlug/resources/:resourceId/position - Update position only (body: { "x": number, "y": number })
  • PUT /api/:projectSlug/:environmentSlug/resources/:resourceId/sync - Sync resource data from cloud provider
  • DELETE /api/:projectSlug/:environmentSlug/resources/:resourceId - Delete a resource
  • GET /api/resource-types - List resource types (subtype, isActive, minPlanId) — public, no auth; validate before creating resources

Resource Types (validate before create)

Resource types are stored in a resource_types table with columns: subtype, is_active, min_plan_id. Before creating any resource, the API validates that the workspace’s plan meets the minimum for that type and that the type is active. GET /api/resource-types — List all resource types. Public — no authentication required. Query:
  • activeOnly: true | false — default true, only return active types
  • workspaceId: number — optional; if provided and the request includes a valid Bearer token, each type includes canCreate: boolean for that workspace
Example:
Example response:
With ?workspaceId=1 and a valid Bearer token, each item includes "canCreate": true|false. GET /api/resource-types/:subtype — Get a single resource type by subtype. Public — no authentication required.

List Resources

List all resources for a project and environment. Use this endpoint to list resources (instances, databases, cache servers, applications, etc.) within a project. Query Parameters:
  • type (optional): Filter by resource type (instances, databases, cache_servers, applications, terminals, firewalls, storage_buckets, bucket_explorers, db_monitors, static_websites, or all). Default: all
  • region (optional): Filter by region
  • status (optional): Filter by status (for instances and databases)
  • state (optional): Filter by state (for resource types that expose a state field)
Example Requests:
Example Response: For servers (resourceType instance), metadata is the resource table metadata as stored (e.g. instanceType, imageId, volumeType, storageSize, osType, osName, osVersion, vcpus, memoryGb, pricePerHour, publicIp, privateIp, launchTime, securityGroupId, state). Scalable servers (resourceType scalable_server) use the same metadata shape as servers (instanceType, publicIp, privateIp, imageId, launchTime, securityGroupId, state, volumeType, storageSize, osType, osName, osVersion, vcpus, memoryGb, pricePerHour) plus scalable-specific fields (minSize, maxSize, desiredCapacity, currentCapacity, instances, volumeSize, status, etc.).

Get Resource by ID

Get detailed information about a resource by its database ID. Use this instead of type-specific APIs like GET /servers/:id or GET /databases/:id. Path: GET /api/:projectSlug/:environmentSlug/resources/:resourceId Path Parameters:
  • projectSlug, environmentSlug: Project and environment – Required
  • resourceId: Database ID of the resource (numeric) – Required. Get IDs from the list endpoint.
Example:

Update Resource by ID

Update a resource’s name and/or position. Use PATCH .../resources/:resourceId/position to update canvas position only. Note: Name cannot be updated for storage_bucket or static_website (S3 bucket name is fixed at creation); use the type-specific PATCH endpoints for those resources. Path: PATCH /api/:projectSlug/:environmentSlug/resources/:resourceId Body: { "name"?: string, "position"?: { "x": number, "y": number } } — at least one required. Example:

Sync Resource from Cloud Provider

Sync/refresh resource data from the cloud provider (AWS, GCP, or Azure) and update the resource record in the database. This endpoint fetches the latest status, metadata, and configuration from the cloud provider and updates the resource accordingly. Path: PUT /api/:projectSlug/:environmentSlug/resources/:resourceId/sync Supported Resource Types:
  • database - Syncs AWS RDS, GCP Cloud SQL, or Azure Flexible Server
  • instance - Syncs AWS EC2 instances
  • scalable_server - Syncs AWS Auto Scaling Groups, GCP Managed Instance Groups, or Azure VM Scale Sets
  • cache_server - Syncs AWS ElastiCache Serverless, GCP Memorystore Redis, or Azure Cache for Redis
  • function - Syncs AWS Lambda, GCP Cloud Functions, or Azure Functions
Path Parameters:
  • projectSlug, environmentSlug: Project and environment – Required
  • resourceId: Database ID of the resource (numeric) – Required
Example:
Example Response (Database):
Example Response (Instance):
Example Response (Scalable Server):
Error Responses: 1. Resource Not Found in Cloud Provider:
2. Sync Not Supported:
3. Cloud Connection Not Active:
Notes:
  • The sync endpoint updates the resource’s status and metadata fields with the latest information from the cloud provider
  • For databases, it syncs endpoint, port, instance class, allocated storage, engine version, and other configuration details
  • For instances, it syncs public IP, private IP, instance type, and state
  • For scalable servers, it syncs min/max size, desired capacity, current capacity, and instance details
  • For cache servers, it syncs endpoint, port, engine version, and status
  • For functions, it syncs runtime, handler, memory size, timeout, endpoint/function URL, and status
  • If a resource is not found in the cloud provider, the status is updated to deleted

Delete Resource by ID

All resource deletion is performed only through this endpoint. Do not use type-specific delete APIs (e.g. DELETE /servers/:id, DELETE /databases/:id); those have been removed. Delete a resource by its database ID. The service performs cloud deletion where applicable (terminate instance, delete RDS, remove S3 bucket, delete DNS zone, etc.), removes associated resource connections, then soft-deletes the resource. Supported types include: instance, database, terminal, bucket_explorer, db_monitor, application, firewall, cache_server, scalable_server, storage_bucket, static_website, function, dns, subdomain, and others. Path: DELETE /api/:projectSlug/:environmentSlug/resources/:resourceId Query parameters:
  • forceDelete (optional): For scalable_server only. Set to true to force delete the Auto Scaling Group even if instances are still running. Default: false.
  • deleteFromCloud (optional): For storage_bucket and static_website only. Set to false to only remove the resource from the database (and its connections); the bucket is not deleted from the cloud. Default: true.
Example:
Example (scalable server, force delete):
Example (storage bucket or static website, remove from database only):

Resource Summary

Get summary statistics of all resources. Example Request:
Note: The /api/resources endpoint now returns project and environment as objects with id, slug, and name instead of just IDs. This provides more complete information and allows you to use slugs for navigation. Example Response: