Documentation Index
Fetch the complete documentation index at: https://docs.gateways.app/llms.txt
Use this file to discover all available pages before exploring further.
Cloud Connections API Endpoints (Workspace-Level)
Cloud connections are now workspace-specific. Each workspace can have multiple cloud provider connections (AWS, GCP, Azure, etc.).GET /api/cloud-connections/:workspaceSlug- List all cloud connections for a workspacePOST /api/cloud-connections/:workspaceSlug/connect-aws- Initiate AWS connection (generates CloudFormation URL)POST /api/cloud-connections/:workspaceSlug/connect-gcp- Initiate GCP connection (creates pending connection)POST /api/cloud-connections/:workspaceSlug/connect-azure- Initiate Azure connection (creates pending; run setup command in Azure Cloud Shell, then paste JSON/Base64 in complete)POST /api/cloud-connections/:workspaceSlug/:connectionId/complete- Complete a cloud connection (AWS: after CloudFormation stack; GCP: with service account key; Azure: with azureCredentials JSON/Base64 + accountName)PATCH /api/cloud-connections/:workspaceSlug/:connectionId- Update a cloud connection (e.g. account name)DELETE /api/cloud-connections/:workspaceSlug/:connectionId- Delete (soft delete) a cloud connection
List Cloud Connections
GET /api/cloud-connections/:workspaceSlug List all cloud connections for a workspace with optional filtering. Path Parameters:workspaceSlug- The slug of the workspace
status- Filter by connection status (pending,connected,failed,disconnected). By default, onlyconnectedconnections are returned. Usestatus=failedorstatus=disconnectedto see other statuses.provider- Filter by cloud provider name (aws,gcp,azure)provider_id- Filter by cloud provider IDinclude_inactive- Include inactive connections (true/false, default:false)
- User must be a member of the workspace
- User must have
canViewResourcespermission
status query parameter.
Response:
Connect AWS Account
POST /api/cloud-connections/:workspaceSlug/connect-aws Initiate an AWS connection by generating a CloudFormation stack URL. This endpoint creates a pending connection and returns a URL that must be opened in AWS Console to complete the connection. Path Parameters:workspaceSlug- The slug of the workspace
region(optional) - AWS region (default:us-east-1)
accountName is not required here. It will be requested when completing the connection via the /complete endpoint.
Permissions:
- User must be a member of the workspace
- User must have
canManageResourcespermission - Workspace must not exceed the plan’s
max_cloud_connectionslimit
Complete Cloud Connection
POST /api/cloud-connections/:workspaceSlug/:connectionId/complete Complete a pending cloud connection. For AWS: after the CloudFormation stack has been created. For GCP: by providing the service account key JSON. This endpoint updates the connection and marks it as connected. Path Parameters:workspaceSlug- The slug of the workspaceconnectionId- The ID of the connection to complete
accountId(required) - The AWS account ID (12 digits). The role ARN will be automatically generated asarn:aws:iam::{accountId}:role/GatewaysAppDeployRoleaccountName(required) - A friendly name to identify this AWS account connection (must be unique within the workspace)
accountNamemust be unique within the workspace. If a connection with the sameaccountNamealready exists, the request will fail with a duplicate account name error.- The
roleArnis automatically generated from theaccountIdusing the format:arn:aws:iam::{accountId}:role/GatewaysAppDeployRole - Before marking the connection as complete, the endpoint will test the AWS connection by attempting to assume the IAM role. If the test fails, the connection status will be set to
failedand an error will be returned.
- User must be a member of the workspace
- User must have
canManageResourcespermission - Connection must belong to the specified workspace
Connect GCP Account
POST /api/cloud-connections/:workspaceSlug/connect-gcp Initiate a GCP connection by creating a pending connection and generating a connection URL. Similar to AWS CloudFormation URL, this endpoint returns a URL that opens Google Cloud Shell with an automated setup script that creates a service account with all necessary IAM roles. Path Parameters:workspaceSlug- The slug of the workspace
region(optional) - GCP region (default:us-central1)
accountName is not required here. It will be requested when completing the connection via the /complete endpoint.
Permissions:
- User must be a member of the workspace
- User must have
canManageResourcespermission - Workspace must not exceed the plan’s
max_cloud_connectionslimit
connectionUrl opens Cloud Shell (terminal); users run setupCommand (curl -sSL gws.run/g | bash or GCP_WIF_SCRIPT_URL / GCP_SETUP_SCRIPT_URL).
Setup Script Features:
The setup script automatically:
- ✅ Creates a service account named
gateways-cloud-connection - ✅ Grants the following IAM roles:
roles/compute.admin- Compute Engine Admin (VMs, disks, networking)roles/storage.admin- Storage Admin (Cloud Storage)roles/cloudsql.admin- Cloud SQL Admin (databases)roles/iam.serviceAccountUser- Service Account Userroles/compute.networkAdmin- Network Admin (VPC, firewall, load balancers)roles/viewer- Project Viewerroles/dns.admin- DNS Adminroles/cloudfunctions.admin- Cloud Functions Adminroles/run.admin- Cloud Run Adminroles/secretmanager.admin- Secret Manager Adminroles/redis.admin- Memorystore for Redis Admin (cache servers)
- ✅ Enables required GCP APIs (Compute, Cloud SQL, Memorystore for Redis
redis.googleapis.com, etc.) - ✅ Generates and downloads the service account key JSON file
- ✅ Provides connection details including project ID and service account email
Complete Cloud Connection (GCP)
To complete a GCP connection, use the same/complete endpoint but provide GCP-specific fields:
POST /api/cloud-connections/:workspaceSlug/:connectionId/complete
Complete a pending GCP connection by providing the Workload Identity Federation (WIF) config. In Google Cloud Shell, run export GCP_OIDC_ISSUER_URL=<your-api>/api then curl -sSL gws.run/g | sh (or your self-hosted script if configured), and paste the JSON or Base64 output. No service account keys are used.
Path Parameters:
workspaceSlug- The slug of the workspaceconnectionId- The ID of the connection to complete
projectId(optional if in wifConfig) - The GCP project IDaccountName(required) - A friendly name to identify this GCP account connection (must be unique within the workspace)wifConfig(required) - JSON or Base64-encoded JSON withprojectNumber,poolId,providerId,serviceAccountEmail(and optionallyprojectId)
accountNamemust be unique within the workspace. If a connection with the sameaccountNamealready exists, the request will fail with a duplicate account name error.- The
wifConfigcan be provided as JSON object/string or Base64-encoded JSON (as generated by the setup script). - Before marking the connection as complete, the endpoint will test the GCP connection. If the test fails, the connection status will be set to
failedand an error will be returned.
- User must be a member of the workspace
- User must have
canManageResourcespermission - Connection must belong to the specified workspace
Connect Azure Account
POST /api/cloud-connections/:workspaceSlug/connect-azure Initiate an Azure connection by creating a pending connection. Returns Azure Cloud Shell URL and a short setup command like$env:T="<token>"; curl -sSL gws.run/a | sh (PowerShell) where T is a 24-character hex one-time token. The script POSTs credentials to https://api.gateways.app/api/cloud-connections/azure-setup-callback (override webhook in Cloud Shell with $env:W=... before the curl line if needed). After the user sets accountName via PATCH and runs the command, POST /api/cloud-connections/azure-setup-callback accepts the body (no JWT). Manual /complete with azureCredentials still works.
Path Parameters:
workspaceSlug- The slug of the workspace
region(optional) - Defaulteastus. Used as the default region for resources.
setupCommand in Cloud Shell after PATCHing accountName. Manual: Use the same POST .../complete endpoint with:
accountName(required)azureCredentials(required) - The JSON or Base64 block from the setup script:{ "tenantId", "subscriptionId", "clientId", "clientSecret" }. Alternatively passtenantId,subscriptionId,clientId,clientSecretindividually.
Update Cloud Connection
PATCH /api/cloud-connections/:workspaceSlug/:connectionId Update a cloud connection (e.g. display name / account name). Path Parameters:workspaceSlug- The slug of the workspaceconnectionId- The ID of the connection to update
accountName(optional, string) - Display name for the connection. Pass empty string or omit to clear.
- User must be a member of the workspace
- User must have
canManageResourcespermission - Connection must belong to the specified workspace
Delete Cloud Connection
DELETE /api/cloud-connections/:workspaceSlug/:connectionId Delete (soft delete) a cloud connection. The connection will be marked as inactive and disconnected. Path Parameters:workspaceSlug- The slug of the workspaceconnectionId- The ID of the connection to delete
- Every project in the workspace that is linked to this cloud connection (
connected_cloud_id=connectionId) must have zero active resources. If any such project still has active resources, the request fails with409 Conflictand a message listing the project(s) that must be cleared first.
- User must be a member of the workspace
- User must have
canManageResourcespermission - Connection must belong to the specified workspace
Cloud Provider Connection Endpoints (Project-Level)
Projects can be linked to a workspace’s cloud connection:PATCH /api/projects/:projectSlug/connect-cloud/:connectionId- Link a workspace cloud connection to a projectPATCH /api/projects/:projectSlug/disconnect-cloud- Unlink the cloud connection from a project. Allowed only when the project has zero active resources; otherwise returns409with a message to delete resources first.
/api/cloud-connections/:workspaceSlug endpoints. Then link the connection to your project using /api/projects/:projectSlug/connect-cloud/:connectionId.