Docs/Getting started/Quickstart

Quickstart

Create an account, an organization and your first database — using the dashboard and the API side by side.

Show code in
About 5 minutesBase URL: https://api.astrabase.app/api/v1
1

Create an account

Register on the dashboard with email and password or a social login, or call the API. Then log in to get an access token for every following call.

bash
curl -X POST $API/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"…"}'

# → then log in
curl -X POST $API/auth/login -d '{…}'
2

Create an organization

Every project and database lives inside an organization. New organizations start on the Free plan — 1 database, 512 MB storage.

bash
curl -X POST $API/organizations \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"Acme Inc.","slug":"acme"}'
3

Create a project

A project groups the databases of one application — for example production and staging.

bash
curl -X POST $API/organizations/$ORG_ID/projects \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"Shop","slug":"shop"}'
4

Create a database

Pass a region_code and an isolation_level. The API answers 202 Accepted with a job_id right away.

Provisioning is asynchronous. Poll the job, use waitForJob / wait_for_job, or subscribe to the database.created webhook.
bash
curl -X POST $API/organizations/$ORG_ID/projects/$PROJECT_ID/databases \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"production","region_code":"eu-west","isolation_level":"shared"}'

# poll until status = succeeded
curl $API/jobs/$JOB_ID -H "Authorization: Bearer $TOKEN"
Response202 Accepted
{
  "job_id": "[job_id]",
  "database": { "id": "[id]", "status": "provisioning" }
}
5

Connect

Once the database is running, fetch its connection details. It is a standard Postgres connection string — use psql, Prisma, SQLAlchemy or any driver.

bash
curl $API/organizations/$ORG_ID/projects/$PROJECT_ID/databases/$DB_ID/connection \
  -H "Authorization: Bearer $TOKEN"

# → "connection_string": "postgres://…"

Next steps