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.
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
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:
# JSON format
curl https://your-server:9000/api/openapi.json
# YAML format
curl https://your-server:9000/api/openapi.yamlEndpoint 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.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/apps | List all applications |
| POST | /api/apps | Create a new application |
| GET | /api/apps/:id | Get app details |
| PUT | /api/apps/:id | Update app configuration |
| DELETE | /api/apps/:id | Delete an application |
| POST | /api/apps/:id/restart | Restart an application |
Deployments
Trigger deployments, view build logs, rollback, and manage deployment history.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/apps/:id/deploy | Trigger a new deployment |
| GET | /api/apps/:id/deployments | List deployment history |
| POST | /api/apps/:id/rollback | Rollback to a previous deployment |
Domains & SSL
Add custom domains, verify DNS, and manage SSL certificates.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/domains | List all domains |
| POST | /api/domains | Add a custom domain |
| POST | /api/domains/verify | Verify domain DNS |
| GET | /api/certificates | List SSL certificates |
Databases
Provision databases, manage backups, and get connection strings.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/databases | Create a new database |
| GET | /api/databases/:id | Get database details + connection string |
| POST | /api/databases/:id/backup | Trigger a manual backup |
| POST | /api/databases/:id/restore | Restore from a backup |
Other Endpoints
The API also covers these resource categories:
| Category | Endpoints | Description |
|---|---|---|
| Environment Variables | 8 endpoints | CRUD for env vars, bulk import, secret management |
| Storage & Mounts | 6 endpoints | Volume management, storage providers |
| Scaling | 4 endpoints | Manual scaling, auto-scaling rules |
| Monitoring | 12 endpoints | Metrics, alerts, uptime checks, health status |
| Cron Jobs | 5 endpoints | Schedule, list, update, delete, run cron jobs |
| Team & Auth | 15 endpoints | Login, 2FA, sessions, team members, API keys |
| SSH Keys | 4 endpoints | Add, list, delete SSH keys |
| Nodes | 8 endpoints | Multi-server management, node health |
| Services | 8 endpoints | Sub-service URLs, status, restart, stop, start, credentials |
| Backups | 11 endpoints | Trigger, list, restore, download backups, manage schedules |
| Certificates | 6 endpoints | SSL certificate management, CSR generation, SSL modes |
| Projects | 11 endpoints | Project CRUD, member management, audit logs |
| Redirects | 5 endpoints | URL redirect rules, create, update, toggle, delete |
| Preview Environments | 4 endpoints | PR preview deployments, settings, cleanup |
| Settings | 6 endpoints | Server configuration, domain, Cloudflare, ACME, DNS |
| Templates | 5 endpoints | Browse and deploy from 170+ templates |
| Webhooks | 6 endpoints | Git webhooks, deploy hooks, notification hooks |
Downloading the OpenAPI Spec
You can download the OpenAPI specification to use with documentation tools, testing frameworks, or code generators.
# 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.yamlThe 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.
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):
npx openapi-typescript https://your-server:9000/api/openapi.json \
-o ./src/lib/api/sh0-types.tsPython client (using openapi-python-client):
pip install openapi-python-client
openapi-python-client generate \
--url https://your-server:9000/api/openapi.jsonGo client (using oapi-codegen):
go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@latest
oapi-codegen -package sh0 sh0-openapi.json > sh0_client.go