REST API for automation: organizations and projects, authenticated with a personal access token.
The Management API lets you manage the HostBase platform from scripts, CI/CD or your own tools. Don't confuse it with a project's data API (/rest/v1) — this API manages the projects themselves.
Authentication
Create a personal access token in Account → Access tokens and send it in a header:
Authorization: Bearer hb_pat_xxxxxxxxxxxxxxxxxxxx
Base URL: https://host.ulewicz.space/api/v1. Responses are JSON.
Organizations and projects
| Method and path | Description |
GET /api/v1/organizations | Your organizations (id, name, slug, plan, role). |
GET /api/v1/projects | Projects across all your organizations. |
POST /api/v1/projects | Create a project: name, organization_slug, region (pl-waw-1 or eu-north-1), compute_size (nano…xl). |
GET /api/v1/projects/{ref} | Project details, including status and the anon key. |
DELETE /api/v1/projects/{ref} | Delete the project, its database, files and backups — irreversible. Owner or admin only. |
POST /api/v1/projects/{ref}/pause, /resume | Pause or resume the project. |
GET /api/v1/projects/{ref}/api-keys | The anon and service_role keys. |
curl -X POST https://host.ulewicz.space/api/v1/projects \
-H "Authorization: Bearer $HOSTBASE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"shop-prod","organization_slug":"acme","region":"pl-waw-1","compute_size":"small"}'
{
"ref": "abcdefghijklmnopqrst",
"name": "shop-prod",
"status": "provisioning",
"region": "pl-waw-1",
"api_url": "https://abcdefghijklmnopqrst.host.ulewicz.space"
}
Database
| Method and path | Description |
POST /api/v1/projects/{ref}/database/query | Run SQL (owner, admin or developer); the project must be active. |
GET / POST /api/v1/projects/{ref}/database/migrations | Migration history / apply a migration { name, sql, version? } (409 if the version exists). |
GET /api/v1/projects/{ref}/types/typescript?schemas=public | Generated TypeScript types (text/plain). |
GET / POST /api/v1/projects/{ref}/backups, GET …/backups/{id}/download | Backups and pg_dump download. |
curl -X POST https://host.ulewicz.space/api/v1/projects/abcdefghijklmnopqrst/database/query \
-H "Authorization: Bearer $HOSTBASE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query":"select now() as time, version()"}'
Point-in-time recovery and branches
| Method and path | Description |
GET / PUT /api/v1/projects/{ref}/pitr | PITR status and restore window / {"enabled": true, "retention_days": 7}. |
POST /api/v1/projects/{ref}/pitr/restore | {"target_time": "2026-10-15T12:34:56Z"}. |
GET / POST /api/v1/projects/{ref}/branches | List / create a branch {"name", "mode": "schema" | "data"}. |
DELETE /api/v1/projects/{ref}/branches/{branch} | Delete a branch. |
GET / POST /api/v1/projects/{ref}/branches/{branch}/merge | Dry-run merge plan / merge (one transaction). |
Edge Functions and secrets
| Method and path | Description |
GET / POST /api/v1/projects/{ref}/functions | List / create a function. |
GET / PUT / DELETE /api/v1/projects/{ref}/functions/{name} | Source and config / deploy (returns version) / delete. |
GET / POST /api/v1/projects/{ref}/functions/{name}/versions | Deploy history / rollback {"rollback_to": 3}. |
GET /api/v1/projects/{ref}/functions/{name}/logs | Runtime logs. |
GET / PUT / DELETE /api/v1/projects/{ref}/secrets | Secret names / set {"secrets": {"NAME": "value"}} / delete ?name=NAME. |
Network, domains and regions
| Method and path | Description |
GET / PUT /api/v1/projects/{ref}/network | IP allowlist for Postgres and the pooler. |
GET / POST /api/v1/projects/{ref}/domains, DELETE …/domains/{hostname} | Custom domains. |
GET / POST /api/v1/projects/{ref}/move | Move the project to another region {"region": "eu-north-1"}. |
Error codes
| Code | Meaning |
| 400 | Invalid input or SQL error |
| 401 | Missing or invalid token |
| 402 | Plan limit exceeded |
| 403 | Insufficient permissions |
| 404 | Resource doesn't exist or you don't have access |
| 409 | Project in the wrong state (e.g. inactive) or resource already exists |
| 413 | Function code exceeds 1 MB |
| 422 | Region unavailable |
| 503 | Database server temporarily unavailable or out of capacity |