REST API

API Reference

The HostStack REST API gives you programmatic access to every feature of the platform. Use it directly or via our TypeScript SDK.

Authentication

Authenticate API requests with a Bearer token. Generate keys in Settings > API Keys.

Authorization: Bearer hs_live_your_api_key

Base URL & Errors

All endpoints use JSON. Errors return { "error": "message" } with the appropriate HTTP status code.

https://hoststack.dev/api
Rate Limit

API requests are limited to 100 requests/minute per API key. Rate-limited responses return HTTP 429 with a Retry-After header.

Endpoints

Auth

Public
POST
/api/auth/register
POST
/api/auth/login
POST
/api/auth/logout
POST
/api/auth/forgot-password
POST
/api/auth/reset-password

Projects

Bearer
GET
/api/projects/:teamId
GET
/api/projects/:teamId/:projectId
POST
/api/projects/:teamId
PATCH
/api/projects/:teamId/:projectId
DELETE
/api/projects/:teamId/:projectId

Services

Bearer
GET
/api/services/:teamId
GET
/api/services/:teamId/:serviceId
POST
/api/services/:teamId
PATCH
/api/services/:teamId/:serviceId
DELETE
/api/services/:teamId/:serviceId
POST
/api/services/:teamId/:serviceId/suspend
POST
/api/services/:teamId/:serviceId/resume

Deploys

Bearer
GET
/api/services/:teamId/:serviceId/deploys
POST
/api/services/:teamId/:serviceId/deploys
POST
/api/deploys/:teamId/:deployId/cancel
POST
/api/deploys/:teamId/:deployId/rollback

Databases

Bearer
GET
/api/databases/:teamId
GET
/api/databases/:teamId/:databaseId
POST
/api/databases/:teamId
DELETE
/api/databases/:teamId/:databaseId
GET
/api/databases/:teamId/:databaseId/credentials

Domains

Bearer
GET
/api/domains/:teamId
POST
/api/domains/:teamId
PATCH
/api/domains/:teamId/:domainId
DELETE
/api/domains/:teamId/:domainId
POST
/api/domains/:teamId/:domainId/verify

Billing

Session
GET
/api/billing/:teamId/subscription
GET
/api/billing/:teamId/usage
POST
/api/billing/:teamId/checkout
POST
/api/billing/:teamId/portal

Example request

bash
curl -X POST https://hoststack.dev/api/services/:teamId/:serviceId/deploys \
  -H "Authorization: Bearer hs_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"clearCache": false}'
Response (201 Created)
{
  "deploy": {
    "id": 42,
    "publicId": "dpl_abc123",
    "status": "building",
    "trigger": "api",
    "createdAt": "2026-04-07T12:00:00.000Z"
  }
}

Prefer a typed client? Use the TypeScript SDK for full autocompletion and error handling.