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.
Application Endpoints
GatewaysApp supports three types of applications:- Upload Type: Upload files/archives to S3
- Docker Type: Reference Docker images from registries
- Git Type: Reference code from Git repositories (GitHub, GitLab, Bitbucket)
Create Application
Upload Type Application
POST /api/:projectSlug/:environmentSlug/applications- Upload an application file (zip or regular file) to S3 in the user’s AWS account
- Content-Type:
multipart/form-data - Authentication: Bearer token required
- Body parameters:
applicationType(required): Must be"upload"files(required): The files to upload (zip file or any other file type, can be multiple files with the same field name)name(optional): Application name (if not provided, uses file names)positionX(optional): Canvas X position (number or numeric string)positionY(optional): Canvas Y position (number or numeric string)commands(optional): Commands to run the app, one per line (e.g.npm installthennpm start). Stored in metadata asrunCommandsarray.environmentVariables(optional): JSON string or object of key-value environment variables (e.g.{"NODE_ENV":"production","PORT":"3000"}). Stored in metadata asapplicationEnvironmentVariablesand injected into the systemd service file at deploy time.
- Automatically creates a zip file if the uploaded file is not already a zip
- Uploads to S3 in the customer’s AWS account using STS AssumeRole
- Stores application metadata in the database
- Calculates SHA256 checksum for integrity verification
- Files are stored in the customer’s S3 bucket, not in the SaaS account
Docker Type Application
POST /api/:projectSlug/:environmentSlug/applications- Create a Docker application
- Content-Type:
application/json - Authentication: Bearer token required
- Body parameters:
applicationType(required): Must be"docker"name(required): Application namedockerImage(required): Docker image ID (e.g.,"_/node"for Node.js,"nginx","postgres")port(optional): App port — port your app listens on inside the container (1–65535, default80). We map it to the same port on the host and Caddy/Nginx proxy to it.dockerEnvironmentVariables(optional): Object with environment variables (e.g.,{"NODE_ENV": "production", "PORT": "3000"})positionX(optional): Canvas X position (number)positionY(optional): Canvas Y position (number)
Git Type Application
POST /api/:projectSlug/:environmentSlug/applications- Create a Git application (GitHub, GitLab, or Bitbucket)
- Project must be in a workspace.
- Connect a Git provider account for that workspace:
GET /api/:workspaceSlug/git/:provider/authorize(then complete OAuth; callback closes the window). - List workspace connections:
GET /api/:workspaceSlug/git/connections(optional?provider=github|gitlab|bitbucket). - Fetch repositories:
GET /api/:workspaceSlug/git/:provider/repositories(optional queryconnectionIdif the workspace has multiple accounts for that provider). - Select a repository from the list.
- Content-Type:
application/json - Authentication: Bearer token required
- Body parameters:
applicationType(required): Must be"git"gitProvider(required): Git provider - must be"github","gitlab", or"bitbucket"name(required): Application namegitConnectionId(optional): ID of the workspace git connection to use. Required when the workspace has multiple accounts for the same provider; otherwise the first connection for that provider is used.repositoryId(required): Repository ID (from repository list)- OR
repositoryFullName(required): Repository full name in formatowner/repo(e.g.,"username/my-repo") - OR
repositoryUrl(required): Full repository URL (e.g.,https://github.com/username/repo,https://gitlab.com/username/repo,https://bitbucket.org/username/repo) branch(optional): Git branch name (defaults to"main"). Examples:"main","master","develop"path(optional): Path within repository (e.g.,"/src","/app")positionX(optional): Canvas X position (number)positionY(optional): Canvas Y position (number)commands(optional): Commands to run the app, one per line. Stored in metadata asrunCommandsarray.environmentVariables(optional): Object of key-value environment variables (e.g.{"NODE_ENV": "production", "PORT": "3000"}). Stored in metadata asapplicationEnvironmentVariablesand injected into the systemd service file at deploy time.
repositoryId, repositoryFullName, or repositoryUrl. The provider in repositoryUrl must match gitProvider. Use gitConnectionId when the workspace has multiple connected accounts for the same provider.
Example Request (GitHub):
- Git connections are per workspace. Connect accounts under the workspace:
GET /api/:workspaceSlug/git/:provider/authorize. - A workspace can have multiple GitHub, GitLab, or Bitbucket accounts; use
gitConnectionIdto choose which one when creating an app. - Use
repositoryIdfor the most reliable repository identification. - If
branchis not provided, it defaults to"main". - Git applications are created with status
"created"and can be updated later.
Git OAuth Flow (Workspace-scoped)
Git connections are owned by a workspace. Multiple accounts per provider per workspace are supported. Base path: /api/:workspaceSlug/git
Step 1: Get Authorization URL (use your workspace slug)
authorizationUrl and state. Open authorizationUrl in a browser; after OAuth the callback page closes the window (no redirect to frontend).
Step 2: List workspace connections (multiple per provider allowed; optional ?provider=github|gitlab|bitbucket to filter)
connectionId when workspace has multiple accounts for that provider)
connectionId)
/api/git/:provider/callback (e.g. http://localhost:3033/api/git/github/callback). No frontend redirect; the callback page closes the popup.
Environment Variables Required:
GitHub:
GITHUB_CLIENT_ID: Your GitHub OAuth App Client IDGITHUB_CLIENT_SECRET: Your GitHub OAuth App Client SecretGITHUB_REDIRECT_URI: OAuth callback URL (default:https://api.gateways.app/api/git/github/callback)
GITLAB_CLIENT_ID: Your GitLab OAuth Application Client IDGITLAB_CLIENT_SECRET: Your GitLab OAuth Application Client SecretGITLAB_REDIRECT_URI: OAuth callback URL (default:https://api.gateways.app/api/git/gitlab/callback)GITLAB_API_BASE: GitLab API base URL (default:https://gitlab.com/api/v4)
BITBUCKET_CLIENT_ID: Your Bitbucket OAuth Consumer KeyBITBUCKET_CLIENT_SECRET: Your Bitbucket OAuth Consumer SecretBITBUCKET_REDIRECT_URI: OAuth callback URL (default:https://api.gateways.app/api/git/bitbucket/callback)
FRONTEND_URL: Frontend URL for OAuth redirects (default:https://api.gateways.app)
List Applications
GET /api/:projectSlug/:environmentSlug/applications- List all applications for a project environment
Get Application Details
GET /api/:projectSlug/:environmentSlug/applications/:applicationId- Get details of a specific application
Update Application
PUT /api/:projectSlug/:environmentSlug/applications/:applicationId- Update an application resource
- For upload type: Content-Type:
multipart/form-data - For docker/git type: Content-Type:
application/json
name(optional): Application nameapplicationType(optional): Application type (upload,docker, orgithub). If not provided, keeps existing type.commands(optional): Commands to run the app, newline-separated string (one command per line). Stored in metadata asrunCommandsarray. Applies to all application types.runCommands(optional): Array of command strings (alternative tocommands). Stored in metadata asrunCommandsarray.environmentVariables(optional): Object of key-value environment variables for upload and git types (e.g.{"NODE_ENV": "production", "PORT": "3000"}). Stored in metadata asapplicationEnvironmentVariablesand injected into the systemd service file on next deploy. Not used for Docker type (usedockerEnvironmentVariablesinstead).
files(optional): New files to upload (replaces existing files if provided)
dockerImage(optional): Docker image IDport(optional): App port — port your app listens on inside the container (1–65535). Mapped to the same port on the host; Caddy/Nginx proxy to it.dockerEnvironmentVariables(optional): Object with environment variables
gitProvider(optional): Git provider -github,gitlab, orbitbucket(defaults to existing provider)gitConnectionId(optional): Workspace git connection ID to use (when workspace has multiple accounts for that provider)repositoryId(optional): Repository ID (from repository list)repositoryFullName(optional): Repository full name in formatowner/reporepositoryUrl(optional): Repository URL (must match provider ifgitProvideris specified)branch(optional): Git branch name (e.g.,main,master)path(optional): Path within repository (e.g.,/src,/app)
- Only provided fields will be updated; omitted fields remain unchanged
- For upload type, providing new files will replace the existing S3 file
- Changing
applicationTypewill update the metadata structure accordingly - All updates preserve the existing application ID and relationships
Delete Application
Application deletion is performed only via the unified resources API:DELETE /api/:projectSlug/:environmentSlug/resources/:resourceId
- Default bucket name format:
deplo-a-apps-{accountId}-{region} - Example:
deplo-a-apps-123456789012-us-east-1 - The bucket is automatically created in the customer’s AWS account when the first file is uploaded (requires
s3:CreateBucketpermission)
- Format:
applications/{projectId}/{environmentId}/{applicationId}/{fileName} - Example:
applications/1/1/123/app.zip
- Maximum file size: 500 MB
- Files are encrypted at rest in S3 using AES256
- SHA256 checksum is calculated for integrity verification
- Files are stored in the customer’s AWS account, not the SaaS account
- Access is controlled via STS AssumeRole with External ID