Skip to content

Public API

The Public API lets you manage projects, web services and deployments programmatically — from CI pipelines, CLIs or any HTTP client. It is the only externally supported HTTP surface of the platform.

The base URL is https://api.runsite.app.

Every request must include an API key in the Authorization header:

Terminal window
Authorization: Bearer ak_live_a1b2c3d4...

Create and manage keys from the dashboard — see API Keys. Requests without a valid, active key get 401 Unauthorized.


GET /api/projects

Returns all projects owned by the authenticated user.

POST /api/projects
Content-Type: application/json
{
"name": "my-app",
"description": "My application"
}
GET /api/projects/{project_id}

GET /api/web-services
POST /api/web-services
Content-Type: application/json
{
"name": "backend-api",
"project_id": "uuid",
"git_repository_url": "https://github.com/user/repo",
"port": 3000,
"build_command": "npm run build",
"min_instances": 1,
"max_instances": 3
}
GET /api/web-services/{web_service_id}
POST /api/web-services/{web_service_id}/deploy
POST /api/web-services/{web_service_id}/restart
POST /api/web-services/{web_service_id}/stop

/deploy triggers a fresh deployment of the current configured branch. /restart re-rolls existing instances without rebuilding. /stop releases compute (env vars and disks are preserved).

GET /api/web-services/{web_service_id}/logs?tail=100&since=1710000000
ParameterTypeDefaultDescription
tailint100Number of log lines (1–10000)
sinceintUnix timestamp to filter logs from

GET /api/web-services/{web_service_id}/deployments?limit=10&offset=0
ParameterTypeDefaultDescription
limitint10Results per page (1–100)
offsetint0Pagination offset
POST /api/web-services/{web_service_id}/deployments
Content-Type: application/json
{
"branch": "main"
}

The branch field is optional — defaults to the service’s configured branch.

GET /api/web-services/{web_service_id}/deployments/{deployment_id}
POST /api/web-services/{web_service_id}/deployments/{deployment_id}/rollback

GET /api/web-services/{web_service_id}/env

Values of secret variables are masked in the response.

POST /api/web-services/{web_service_id}/env
Content-Type: application/json
{
"key": "DATABASE_URL",
"value": "postgres://...",
"is_secret": true
}
PUT /api/web-services/{web_service_id}/env/bulk
Content-Type: application/json
{
"variables": [
{"key": "NODE_ENV", "value": "production"},
{"key": "PORT", "value": "3000", "is_secret": false}
]
}
DELETE /api/web-services/{web_service_id}/env/{var_id}

Project secrets are scoped per environment (production, staging, development) and can be reused across services in the project.

GET /api/projects/{project_id}/secrets

Returns secrets grouped by key.

POST /api/projects/{project_id}/secrets
Content-Type: application/json
{
"key": "STRIPE_SECRET_KEY",
"value": "sk_live_...",
"scope": "production",
"is_secret": true
}
ScopeDescription
productionUsed in production deployments
stagingUsed in staging environments
developmentUsed in development environments
PUT /api/projects/{project_id}/secrets/bulk
Content-Type: application/json
{
"secrets": [
{"key": "API_SECRET", "value": "value1", "scope": "production"},
{"key": "API_SECRET", "value": "value2", "scope": "staging"}
]
}
DELETE /api/projects/{project_id}/secrets/{secret_id}

All errors follow a consistent format:

{
"detail": "Error message describing what went wrong"
}
StatusDescription
400Bad request — invalid input
401Unauthorized — invalid or missing credentials
403Forbidden — insufficient scope
404Resource not found
429Rate limit exceeded

Browse and call the API live in the API Explorer.