REST API

The OwnStack control plane exposes a REST API that the CLI and dashboard both use. You can hit it directly for automation that doesn't fit either tool.

Base URL

Hosted: https://api.ownstack.org. Self-hosted: whatever you've configured for your control plane (the URL stored in your active CLI profile).

Authentication

Authorization: Bearer <token>

Use any of:

  • Your account token from ~/.ownstack/profiles/<name>.
  • An app token from ./.ownstack-config (scoped to one app).
  • A deploy token (CI; scoped to one app's git endpoint).

Discoverable endpoints

EndpointPurpose
GET /api/appsList apps.
POST /api/appsCreate an app.
GET /api/apps/:idApp detail.
PATCH /api/apps/:idUpdate app config (name, build_type, etc.).
DELETE /api/apps/:idDestroy app.
POST /api/apps/:id/deployTrigger a deploy.
GET /api/apps/:id/data/export?stack_id=NStream a Postgres/MySQL dump.
POST /api/apps/:id/repair_postgres_linkRun the postgres link repair flow.
GET /api/stacksList stacks.
POST /api/stacksCreate / provision a stack.

Example: dump a database from CI

curl -sSL -H "Authorization: Bearer $OWNSTACK_TOKEN" \
  -o backup-$(date +%Y%m%d).dump \
  "$OWNSTACK_API_URL/api/apps/$APP_ID/data/export?stack_id=$STACK_ID"

API stability

The API is not yet versioned. We add endpoints frequently and try to avoid breaking changes; check the changelog for the running list of changes. If you depend on the API for production automation, pin to specific endpoints and expect to update when major versions ship.