DocumentationAPI ReferenceHosting Endpoints

Hosting Endpoints

Deploy and manage websites and applications with global CDN and automatic SSL

Hosting Platform Overview

Global static site hosting with automatic deployments from Git repositories. Support for popular frameworks and custom build commands.

Frameworks

ReactNext.jsVueAngular

Features

Auto SSLGlobal CDNGit Deploy

Performance

99.9% Uptime, Global Edge Network

Quick Actions

Deploy Site

Deploy a new site directly from your Git repository with automatic builds.

POST /hosting/sites
Custom Domain

Configure custom domains with automatic SSL certificate provisioning.

PUT /hosting/sites/:id
Trigger Deploy

Manually trigger deployments or set up automatic deployments on push.

POST /hosting/sites/:id/deploy

Supported Frameworks

R

React

Create React App, Vite, Custom builds

npm run build
N

Next.js

Static export, Server-side generation

npm run build && npm run export
V

Vue.js

Vue CLI, Vite, Nuxt.js static

npm run build
A

Angular

Angular CLI, Universal

ng build --prod

API Endpoints

GET/hosting/sites
List all hosted sites for the authenticated user

Response

{
  "success": true,
  "sites": [
    {
      "id": "site_123",
      "name": "my-website",
      "domain": "my-website.com",
      "status": "active",
      "ssl_enabled": true,
      "region": "global",
      "framework": "nextjs",
      "created_at": "2024-01-15T10:30:00Z",
      "last_deployment": "2024-12-02T14:20:00Z",
      "url": "https://my-website.com",
      "preview_url": "https://preview-abc123.vpnenterprise.app",
      "git_repo": "https://github.com/user/my-website",
      "branch": "main"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20
}
POST/hosting/sites
Deploy a new site from a Git repository

Request Body

{
  "name": "my-portfolio",
  "domain": "portfolio.example.com",
  "git_repo": "https://github.com/user/portfolio.git",
  "branch": "main",
  "framework": "react",
  "build_command": "npm run build",
  "output_directory": "dist",
  "environment_variables": {
    "NODE_ENV": "production",
    "API_URL": "https://api.example.com"
  }
}
GET/hosting/sites/:id
Get details of a specific hosted site

Response

{
  "success": true,
  "site": {
    "id": "site_123",
    "name": "my-website",
    "domain": "my-website.com",
    "status": "active",
    "ssl_enabled": true,
    "region": "global",
    "framework": "nextjs",
    "created_at": "2024-01-15T10:30:00Z",
    "last_deployment": "2024-12-02T14:20:00Z",
    "git_repo": "https://github.com/user/my-website",
    "branch": "main",
    "build_settings": {
      "build_command": "npm run build",
      "output_directory": "out",
      "node_version": "18"
    },
    "metrics": {
      "requests_24h": 12450,
      "bandwidth_24h": "156MB",
      "uptime": "99.9%"
    }
  }
}
PUT/hosting/sites/:id
Update site configuration

Request Body

{
  "domain": "new-domain.com",
  "branch": "production",
  "environment_variables": {
    "API_URL": "https://api.production.com"
  }
}
DELETE/hosting/sites/:id
Delete a hosted site

Response

{
  "success": true,
  "message": "Site deleted successfully",
  "id": "site_123",
  "domain": "my-website.com"
}
POST/hosting/sites/:id/deploy
Trigger a new deployment for a site

Request Body

{
  "branch": "main",
  "message": "Manual deployment trigger"
}
GET/hosting/sites/:id/deployments
List deployment history for a site

Response

{
  "success": true,
  "deployments": [
    {
      "id": "dep_456",
      "status": "success",
      "branch": "main",
      "commit": "abc123def456",
      "message": "Update homepage content",
      "started_at": "2024-12-02T14:20:00Z",
      "completed_at": "2024-12-02T14:23:00Z",
      "duration": "3m 15s"
    }
  ],
  "total": 25
}

Deployment Status

Success

Site deployed successfully and is live

Building

Build process is currently running

Queued

Deployment is queued and waiting to start

Failed

Build or deployment failed with errors

Environment Variables

Configure environment variables for your deployments. These are injected during the build process.

{ "environment_variables": { "NODE_ENV": "production", "API_URL": "https://api.mysite.com", "ANALYTICS_ID": "GA-XXXXXXXXX" } }

Security Note: Avoid storing sensitive data in environment variables for client-side builds, as they become part of the public bundle.

Next Steps

Ready to deploy your first site? Check out our other API endpoints and integrations.