AI & tools

Management API

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 pathDescription
GET /api/v1/organizationsYour organizations (id, name, slug, plan, role).
GET /api/v1/projectsProjects across all your organizations.
POST /api/v1/projectsCreate 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, /resumePause or resume the project.
GET /api/v1/projects/{ref}/api-keysThe 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 pathDescription
POST /api/v1/projects/{ref}/database/queryRun SQL (owner, admin or developer); the project must be active.
GET / POST /api/v1/projects/{ref}/database/migrationsMigration history / apply a migration { name, sql, version? } (409 if the version exists).
GET /api/v1/projects/{ref}/types/typescript?schemas=publicGenerated TypeScript types (text/plain).
GET / POST /api/v1/projects/{ref}/backups, GET …/backups/{id}/downloadBackups 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 pathDescription
GET / PUT /api/v1/projects/{ref}/pitrPITR 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}/branchesList / 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}/mergeDry-run merge plan / merge (one transaction).

Edge Functions and secrets

Method and pathDescription
GET / POST /api/v1/projects/{ref}/functionsList / 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}/versionsDeploy history / rollback {"rollback_to": 3}.
GET /api/v1/projects/{ref}/functions/{name}/logsRuntime logs.
GET / PUT / DELETE /api/v1/projects/{ref}/secretsSecret names / set {"secrets": {"NAME": "value"}} / delete ?name=NAME.

Network, domains and regions

Method and pathDescription
GET / PUT /api/v1/projects/{ref}/networkIP allowlist for Postgres and the pooler.
GET / POST /api/v1/projects/{ref}/domains, DELETE …/domains/{hostname}Custom domains.
GET / POST /api/v1/projects/{ref}/moveMove the project to another region {"region": "eu-north-1"}.

Error codes

CodeMeaning
400Invalid input or SQL error
401Missing or invalid token
402Plan limit exceeded
403Insufficient permissions
404Resource doesn't exist or you don't have access
409Project in the wrong state (e.g. inactive) or resource already exists
413Function code exceeds 1 MB
422Region unavailable
503Database server temporarily unavailable or out of capacity