Docs

Stashbase gives every project a dedicated Postgres schema accessible via a JSON REST API. This stub walks through the four things you most often need. The full reference lives at api.stashbase.io/docs.

1. Quickstart

  1. Create an account at app.stashbase.io.
  2. Click New project. You'll get an anon key and a service_role key — copy both; they're shown once.
  3. Your project's REST endpoint is https://api.stashbase.io/rest/v1 with an Accept-Profile header set to your tenant id.

2. Authentication

Users sign up against GoTrue and receive a JWT signed with your project's secret. Pass the JWT as a Bearer token.

curl https://api.stashbase.io/auth/v1/signup \
  -H 'content-type: application/json' \
  -d '{"email":"ada@example.com","password":"hunter2"}'

After email verification, exchange for an access token:

curl 'https://api.stashbase.io/auth/v1/token?grant_type=password' \
  -H 'content-type: application/json' \
  -d '{"email":"ada@example.com","password":"hunter2"}'

3. REST CRUD

Every table in your schema is an endpoint. Use Accept-Profile: <your tenant id> to pin the request.

curl https://api.stashbase.io/rest/v1/profiles \
  -H "apikey: YOUR_ANON_KEY" \
  -H "Authorization: Bearer YOUR_USER_JWT" \
  -H "Accept-Profile: tenant_xxx"

Insert with a service-role key, or with a user JWT when row-level security allows:

curl -X POST https://api.stashbase.io/rest/v1/profiles \
  -H "apikey: YOUR_ANON_KEY" \
  -H "Authorization: Bearer YOUR_USER_JWT" \
  -H "Content-Profile: tenant_xxx" \
  -H "Content-Type: application/json" \
  -d '{"user_id":"<uuid>","display_name":"Ada"}'

4. Migrate from Supabase

Paste a postgres:// connection string on the project's Import tab (or POST it to the control plane):

curl -X POST https://api.stashbase.io/v1/projects/<id>/migrate/supabase \
  -H "Authorization: Bearer YOUR_DASHBOARD_JWT" \
  -H "Content-Type: application/json" \
  -d '{"source":"postgres://user:pw@db.supabase.co:5432/postgres"}'

You can also upload a .sql file (up to 100 MB) — it's replayed into your tenant schema.

Full API reference

The complete endpoint listing, response shapes, and error codes live at api.stashbase.io/docs.