Projects & databases
Projects group related databases — most teams create one project per application or per environment. Databases are individual Postgres instances.
Creating a database
curl -X POST https://api.astrabase.app/api/v1/organizations/$ORG_ID/projects/$PROJECT_ID/databases \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "production",
"region_code": "eu-west",
"isolation_level": "shared",
"cpu_limit": 1,
"ram_limit_mb": 1024,
"storage_limit_mb": 512
}'
This returns 202 Accepted with a job_id — provisioning is asynchronous.
List available regions with GET /regions.
Isolation levels
shared— runs on a shared Postgres cluster. Faster to provision, lower cost, the default.dedicated— an isolated Postgres instance of its own.
Connecting
curl https://api.astrabase.app/api/v1/organizations/$ORG_ID/projects/$PROJECT_ID/databases/$DATABASE_ID/connection \
-H "Authorization: Bearer $TOKEN"
Returns host, port, database name, credentials, SSL mode, and a ready-to-use
connection_string.
Roles & credentials
Each database can have multiple Postgres roles beyond the default one, each with a scope:
app— normal read/write access.readonly—SELECTonly.admin— full privileges, including DDL.
curl -X POST https://api.astrabase.app/api/v1/organizations/$ORG_ID/projects/$PROJECT_ID/databases/$DATABASE_ID/roles \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "analytics_ro", "scope": "readonly"}'
The password is returned once, at creation — it isn't stored anywhere
retrievable, so save it immediately. Rotate a role's password with
POST /roles/{role_id}/rotate.
Extensions
List, install, and remove Postgres extensions per database:
curl https://api.astrabase.app/api/v1/organizations/$ORG_ID/projects/$PROJECT_ID/databases/$DATABASE_ID/extensions -H "Authorization: Bearer $TOKEN"
Resizing, suspending, deleting
# Resize (cpu/ram/storage)
curl -X POST .../databases/$DATABASE_ID/resize -d '{"cpu_limit": 2, "ram_limit_mb": 2048, "storage_limit_mb": 20480}'
# Suspend / resume
curl -X POST .../databases/$DATABASE_ID/suspend
curl -X POST .../databases/$DATABASE_ID/resume
# Delete
curl -X DELETE .../databases/$DATABASE_ID
All state-changing operations (create, resize, delete, backup, restore) go
through the same job system — check status at GET /jobs/{job_id}, or use an
SDK's waitForJob/wait_for_job helper to block until it settles.