Docs/ API Reference/ Full Reference

Full API Reference

The complete sh0 API with 180+ endpoints, an interactive explorer, and a downloadable OpenAPI specification for code generation.

Interactive API Explorer

The easiest way to explore the sh0 API is through the interactive API explorer, available at:

  • Dashboard: Navigate to API Docs in the sidebar of your sh0 dashboard.
  • Website: Visit /api on the sh0 website.
Interactive API explorer showing endpoint list with request/response previews

The explorer lets you:

  • Browse all endpoints organized by category
  • View request parameters, headers, and body schemas
  • See example responses for each endpoint
  • Try endpoints directly from the browser (when connected to a sh0 instance)
  • Copy curl commands for any endpoint
Tip
The API explorer is automatically generated from the OpenAPI spec using utoipa. It is always in sync with the actual API endpoints in your sh0 version.

OpenAPI Specification

sh0 exposes a full OpenAPI 3.1 specification that describes every endpoint, parameter, request body, and response type. The spec is auto-generated from the Rust source code using utoipa, ensuring it is always accurate and up to date.

The spec is available at:

Terminal
# JSON format
curl https://your-server:9000/api/openapi.json

# YAML format
curl https://your-server:9000/api/openapi.yaml
OpenAPI spec rendered in a documentation viewer

Endpoint Groups

The API is organized into logical groups. Here is a summary of the major endpoint categories:

Apps

Manage application lifecycle -- create, configure, start, stop, restart, and delete apps.

MethodEndpointDescription
GET/api/appsList all applications
POST/api/appsCreate a new application
GET/api/apps/:idGet app details
PUT/api/apps/:idUpdate app configuration
DELETE/api/apps/:idDelete an application
POST/api/apps/:id/restartRestart an application

Deployments

Trigger deployments, view build logs, rollback, and manage deployment history.

MethodEndpointDescription
POST/api/apps/:id/deployTrigger a new deployment
GET/api/apps/:id/deploymentsList deployment history
POST/api/apps/:id/rollbackRollback to a previous deployment

Domains & SSL

Add custom domains, verify DNS, and manage SSL certificates.

MethodEndpointDescription
GET/api/domainsList all domains
POST/api/domainsAdd a custom domain
POST/api/domains/verifyVerify domain DNS
GET/api/certificatesList SSL certificates

Databases

Provision databases, manage backups, and get connection strings.

MethodEndpointDescription
POST/api/databasesCreate a new database
GET/api/databases/:idGet database details + connection string
POST/api/databases/:id/backupTrigger a manual backup
POST/api/databases/:id/restoreRestore from a backup

Other Endpoints

The API also covers these resource categories:

CategoryEndpointsDescription
Environment Variables8 endpointsCRUD for env vars, bulk import, secret management
Storage & Mounts6 endpointsVolume management, storage providers
Scaling4 endpointsManual scaling, auto-scaling rules
Monitoring12 endpointsMetrics, alerts, uptime checks, health status
Cron Jobs5 endpointsSchedule, list, update, delete, run cron jobs
Team & Auth15 endpointsLogin, 2FA, sessions, team members, API keys
SSH Keys4 endpointsAdd, list, delete SSH keys
Nodes8 endpointsMulti-server management, node health
Services8 endpointsSub-service URLs, status, restart, stop, start, credentials
Backups11 endpointsTrigger, list, restore, download backups, manage schedules
Certificates6 endpointsSSL certificate management, CSR generation, SSL modes
Projects11 endpointsProject CRUD, member management, audit logs
Redirects5 endpointsURL redirect rules, create, update, toggle, delete
Preview Environments4 endpointsPR preview deployments, settings, cleanup
Settings6 endpointsServer configuration, domain, Cloudflare, ACME, DNS
Templates5 endpointsBrowse and deploy from 170+ templates
Webhooks6 endpointsGit webhooks, deploy hooks, notification hooks
API endpoint groups overview in the explorer

Downloading the OpenAPI Spec

You can download the OpenAPI specification to use with documentation tools, testing frameworks, or code generators.

Terminal
# Download as JSON
curl -o sh0-openapi.json https://your-server:9000/api/openapi.json

# Download as YAML
curl -o sh0-openapi.yaml https://your-server:9000/api/openapi.yaml

The spec file can be imported into tools like:

  • Postman: Import the spec to create a collection with all endpoints pre-configured.
  • Insomnia: Import for an interactive API workspace.
  • Swagger UI: Host your own interactive API docs.
  • Redocly: Generate beautiful API documentation.
OpenAPI spec imported into Postman

Using with Code Generators

The OpenAPI spec can be used with code generators to create typed API clients in any language:

TypeScript client (using openapi-typescript):

Terminal
npx openapi-typescript https://your-server:9000/api/openapi.json \
  -o ./src/lib/api/sh0-types.ts

Python client (using openapi-python-client):

Terminal
pip install openapi-python-client
openapi-python-client generate \
  --url https://your-server:9000/api/openapi.json

Go client (using oapi-codegen):

Terminal
go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@latest
oapi-codegen -package sh0 sh0-openapi.json > sh0_client.go
Tip
Generated clients give you full type safety and autocompletion in your IDE. They are especially useful when building CI/CD pipelines or custom automation tools that interact with your sh0 instance.
TypeScript autocompletion from generated API types in VS Code