Docs

HTTP API: databases, backups and replicas

A project's database: connection details, size, pause and resume, backups and restores, comparing two moments, read replicas and templates.

Updated Oct 18, 2026

The project's Postgres server: connection details, compute, backups and restores, read replicas and templates. Guides: Backups and recovery, Postgres in Sovaria.

Base URLhttps://<project-ref>.sovarias.in — your project URL from Connect.
KeysSend the project's key as apikey. Calls made for a signed-in user also send Authorization: Bearer <access token>.
ErrorsA status code and {"detail": …} — a sentence, or {code, message} for errors your code may branch on (HTTP API).

The project database

Called with a member's session of the organization; changes need a role that can change the project.

GET/api/v1/governance/tenants/{org_id}/databases

The organization's project databases.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.

Returns

statusstring
provisioning, ready, paused, failed…
health_statusstring
From the last health check.
compute_sizestring
nano, micro, small, medium, large, xl.
isolation_modestring
Whether the project has its own database server (dedicated_project) or shares one.
pitr_enabledboolean
Point-in-time recovery.

Responses

  • 200Success.
  • 401No valid session or key.
  • Records also carry placement details (container and host ids) used by the console.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "id": 77,
    "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
    "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
    "region": "ap-south-1",
    "compute_size": "micro",
    "host": "db-f0c3e9a2",
    "port": 5432,
    "database": "prj_f0c3e9a2",
    "username": "prj_f0c3e9a2_owner",
    "status": "ready",
    "health_status": "healthy",
    "max_storage_bytes": 8589934592,
    "created_at": "2026-10-01T08:00:00+00:00",
    "ready_at": "2026-10-01T08:00:41+00:00",
    "pool_mode": "transaction",
    "pool_size": 20,
    "pitr_enabled": true,
    "wal_archive_enabled": true,
    "isolation_mode": "dedicated_project"
  }
]

GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/connection

How to connect to the project's Postgres directly or through the pooler. The password is not included.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Returns

directobject
For migrations and long sessions.
pooledobject
For serverless and many short connections (PgBouncer; pool_mode transaction by default).
max_connectionsinteger
For the compute size.
connection_uri_templatestring
Replace ${PASSWORD} with the database password.

Responses

  • 200Success.
  • 404The project has no database.
  • 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/connection" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "id": 77,
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "region": "ap-south-1",
  "compute_size": "micro",
  "database": "prj_f0c3e9a2",
  "username": "prj_f0c3e9a2_owner",
  "status": "ready",
  "health_status": "healthy",
  "max_storage_bytes": 8589934592,
  "created_at": "2026-10-01T08:00:00+00:00",
  "ready_at": "2026-10-01T08:00:41+00:00",
  "pool_mode": "transaction",
  "pool_size": 20,
  "pitr_enabled": true,
  "wal_archive_enabled": true,
  "isolation_mode": "dedicated_project",
  "host": "db.b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90.sovaria.in",
  "port": 5432,
  "sslmode": "require",
  "external_access_note": "",
  "max_connections": 60,
  "direct": {
    "host": "db.b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90.sovaria.in",
    "port": 5432,
    "connection_uri_template": "postgresql://prj_f0c3e9a2_owner:${PASSWORD}@db.b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90.sovaria.in:5432/prj_f0c3e9a2?sslmode=require",
    "psql_command": "psql 'postgresql://prj_f0c3e9a2_owner:<password>@db.b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90.sovaria.in:5432/prj_f0c3e9a2?sslmode=require'"
  },
  "pooled": {
    "host": "db.b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90.sovaria.in",
    "port": 5432,
    "pool_mode": "transaction",
    "pool_size": 20,
    "connection_uri_template": "postgresql://prj_f0c3e9a2_owner:${PASSWORD}@db.b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90.sovaria.in:5432/prj_f0c3e9a2?sslmode=require",
    "psql_command": "psql 'postgresql://prj_f0c3e9a2_owner:<password>@db.b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90.sovaria.in:5432/prj_f0c3e9a2?sslmode=require'"
  }
}

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/pause

Pause the project's database (stops compute; data is kept).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Responses

  • 200Success.
  • 403The plan doesn't allow pausing.
  • 400It can't be paused now (the message says why).
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/pause" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "id": 77,
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "region": "ap-south-1",
  "compute_size": "micro",
  "host": "db-f0c3e9a2",
  "port": 5432,
  "database": "prj_f0c3e9a2",
  "username": "prj_f0c3e9a2_owner",
  "status": "paused",
  "health_status": "healthy",
  "max_storage_bytes": 8589934592,
  "created_at": "2026-10-01T08:00:00+00:00",
  "ready_at": "2026-10-01T08:00:41+00:00",
  "pool_mode": "transaction",
  "pool_size": 20,
  "pitr_enabled": true,
  "wal_archive_enabled": true,
  "isolation_mode": "dedicated_project"
}

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/resume

Resume a paused database.

An archived Free-plan database is restored in the background (up to a minute; you're emailed when it's ready) and the answer is {status: "resuming"} — poll the database list.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/resume" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "id": 77,
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "region": "ap-south-1",
  "compute_size": "micro",
  "host": "db-f0c3e9a2",
  "port": 5432,
  "database": "prj_f0c3e9a2",
  "username": "prj_f0c3e9a2_owner",
  "status": "ready",
  "health_status": "healthy",
  "max_storage_bytes": 8589934592,
  "created_at": "2026-10-01T08:00:00+00:00",
  "ready_at": "2026-10-01T08:00:41+00:00",
  "pool_mode": "transaction",
  "pool_size": 20,
  "pitr_enabled": true,
  "wal_archive_enabled": true,
  "isolation_mode": "dedicated_project"
}

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/resize

Change the database's compute size.

Sizes: nano 0.5 CPU / 512 MB, micro 1 CPU / 1 GB, small 1 CPU / 2 GB, medium 2 CPU / 4 GB, large 2 CPU / 8 GB, xl 4 CPU / 16 GB. The database restarts briefly.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Body

compute_sizestringrequired
nano, micro, small, medium, large or xl (the plan decides which).
at least 1 characters

Responses

  • 200The database record with the new compute_size.
  • 403The size isn't in the plan.
  • 502The resize didn't complete (the message says why).
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/resize" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"compute_size": "small"}'

Backups and restores

GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/backups

The project's backups, newest first.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Query parameters

limitintegeroptionaldefault 20
How many (1–100).
1–100

Returns

kindstring
daily, manual, or pre_restore (the safety backup taken before a restore)
statusstring
completed (usable), failed, available, simulated.
expires_atstring
Kept for the plan's retention.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/backups?limit=20" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "id": 1042,
    "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
    "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
    "kind": "daily",
    "location_ref": "s3://sovaria-backups/…/1042.dump",
    "size_bytes": 48211968,
    "created_at": "2026-10-18T02:00:05+00:00",
    "expires_at": "2026-10-25T02:00:05+00:00",
    "status": "completed",
    "checksum": "sha256:7c1e…",
    "encryption": "aes-256-gcm"
  }
]

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/backups

Take a backup now.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Responses

  • 200Success.
  • 400No ready database, or the backup couldn't be taken.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/backups" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "id": 1052,
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "kind": "manual",
  "location_ref": "s3://sovaria-backups/…/1042.dump",
  "size_bytes": 48211968,
  "created_at": "2026-10-18T11:00:00+00:00",
  "expires_at": "2026-10-25T11:00:00+00:00",
  "status": "completed",
  "checksum": "sha256:7c1e…",
  "encryption": "aes-256-gcm"
}

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/compare

What differs between two moments — a backup and now, or two backups: schema objects and row counts per table.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Body

fromstringrequired
A backup id, or now.
tostringoptionaldefault now
include_platformbooleanoptionaldefault false
Include Sovaria's own schemas (auth, storage…).

Responses

  • 200Success.
  • 400BAD_MOMENT — use a backup id or now.
  • 404BACKUP_NOT_FOUND.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/compare" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"from": "1042", "to": "now"}'
Response
{
  "from": {
    "moment": "1042",
    "at": "2026-10-18T02:00:05+00:00"
  },
  "to": {
    "moment": "now",
    "at": "2026-10-18T11:05:00+00:00"
  },
  "objects": [
    {
      "type": "column",
      "schema": "public",
      "name": "orders.status",
      "change": "added",
      "after": "status text NOT NULL DEFAULT 'pending'",
      "platform": false
    }
  ],
  "tables": [
    {
      "table": "public.orders",
      "rows_before": 1204,
      "rows_after": 1311,
      "change": "changed"
    }
  ],
  "summary": {
    "objects_added": 1,
    "objects_removed": 0,
    "objects_changed": 0,
    "tables_with_row_changes": 1
  }
}

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/backups/{backup_id}/restore

Replace the project's database with a backup. A safety backup is taken first, and the restore can be undone for 7 days.

Answers 202 at once with the restore job; poll GET …/restores. Needs a dedicated database (Pro and higher) and uses one rollback from the monthly allowance (chrono.rollbacks_month). Data written after the backup is set aside with the replaced database, not kept in production (Backups and recovery).

Who
An organization owner or admin (or the service key).

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.
backup_idintegerrequired
The backup.

Body

confirmbooleanoptionaldefault false
Must be true.

Responses

  • 202Accepted — the work continues in the background.
  • 400CONFIRM_REQUIRED.
  • 403Not an owner/admin, or PLAN_QUOTA_EXHAUSTED.
  • 404NO_DATABASE / BACKUP_NOT_FOUND.
  • 409BACKUP_NOT_USABLE, RESTORE_RUNNING, DATABASE_NOT_READY, or the database is shared (needs a dedicated one).
  • 500SAFETY_BACKUP_FAILED — nothing was restored.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/backups/1042/restore" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"confirm": true}'
Response
{
  "id": 9,
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "backup_id": 1042,
  "backup_at": "2026-10-18T02:00:05+00:00",
  "safety_backup_id": 1051,
  "status": "running",
  "error": null,
  "actor": "6e19c0a2-…",
  "created_at": "2026-10-18T11:02:00+00:00",
  "finished_at": null,
  "undone_at": null,
  "dropped_at": null,
  "undo_until": null
}

GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/restores

Restores of the project's database, newest first.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Returns

restores[].statusstring
running, done, failed (see error) or undone.
restores[].undo_untilstring | null
Until when it can be undone.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/restores" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "restores": [
    {
      "id": 9,
      "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
      "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
      "backup_id": 1042,
      "backup_at": "2026-10-18T02:00:05+00:00",
      "safety_backup_id": 1051,
      "status": "done",
      "error": null,
      "actor": "6e19c0a2-…",
      "created_at": "2026-10-18T11:02:00+00:00",
      "finished_at": "2026-10-18T11:03:40+00:00",
      "undone_at": null,
      "dropped_at": null,
      "undo_until": "2026-10-25T11:03:40+00:00"
    }
  ],
  "keep_days": 7
}

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/restores/{restore_id}/undo

Put the database back as it was right before a restore.

Who
An organization owner or admin (or the service key).

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.
restore_idintegerrequired
The restore.

Responses

  • 200Success.
  • 409It didn't finish, was undone already, or the 7 days have passed.
  • 404NOT_FOUND.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/restores/9/undo" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "id": 9,
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "backup_id": 1042,
  "backup_at": "2026-10-18T02:00:05+00:00",
  "safety_backup_id": 1051,
  "status": "undone",
  "error": null,
  "actor": "6e19c0a2-…",
  "created_at": "2026-10-18T11:02:00+00:00",
  "finished_at": "2026-10-18T11:03:40+00:00",
  "undone_at": "2026-10-18T12:00:00+00:00",
  "dropped_at": null,
  "undo_until": null
}

Read replicas

GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/replicas

The project's read replicas, with replication lag.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Returns

replicas[].statusstring
provisioning until its base copy is done, then ready (or failed with error).
replicas[].lag_bytes, lag_secondsnumber
How far behind the primary it is.
limits.replicasinteger
Allowed by the plan (db.read_replicas).

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/replicas" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "replicas": [
    {
      "id": "rep_5d1c…",
      "status": "ready",
      "host": "db-f0c3e9a2-r1",
      "port": 5432,
      "database": "prj_f0c3e9a2",
      "read_only": true,
      "connection_string": "postgresql://prj_f0c3e9a2_owner:${PASSWORD}@db-f0c3e9a2-r1:5432/prj_f0c3e9a2",
      "error": "",
      "created_at": "2026-10-12T10:00:00+00:00",
      "ready_at": "2026-10-12T10:03:12+00:00",
      "streaming": true,
      "lag_bytes": 0,
      "lag_seconds": 0.4
    }
  ],
  "limits": {
    "replicas": 2
  }
}

POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/replicas

Add a read replica (a streaming copy for read-only queries).

Answers 202 with status: provisioning; it's usable once ready. Connect with the project's own role and password. Needs a dedicated database.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.

Body

regionstring | nulloptional
Ignored for now: replicas run next to the primary.

Responses

  • 202Accepted — the work continues in the background.
  • 403PLAN_LIMIT_REACHED — more replicas than the plan allows.
  • 409The database is shared or not ready.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/replicas" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'
Response
{
  "id": "rep_5d1c…",
  "status": "provisioning",
  "host": "db-f0c3e9a2-r1",
  "port": 5432,
  "database": "prj_f0c3e9a2",
  "read_only": true,
  "connection_string": "postgresql://prj_f0c3e9a2_owner:${PASSWORD}@db-f0c3e9a2-r1:5432/prj_f0c3e9a2",
  "error": "",
  "created_at": "2026-10-12T10:00:00+00:00",
  "ready_at": null,
  "streaming": null,
  "lag_bytes": null,
  "lag_seconds": null
}

DELETE/api/v1/governance/tenants/{org_id}/databases/{project_id}/replicas/{replica_id}

Remove a read replica.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.
replica_idstringrequired
The replica.

Responses

  • 200Success.
  • 404No such replica.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/replicas/rep_5d1c…" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "deleted",
  "replica": {
    "id": "rep_5d1c…",
    "status": "ready",
    "host": "db-f0c3e9a2-r1",
    "port": 5432,
    "database": "prj_f0c3e9a2",
    "read_only": true,
    "connection_string": "postgresql://prj_f0c3e9a2_owner:${PASSWORD}@db-f0c3e9a2-r1:5432/prj_f0c3e9a2",
    "error": "",
    "created_at": "2026-10-12T10:00:00+00:00",
    "ready_at": "2026-10-12T10:03:12+00:00",
    "streaming": true,
    "lag_bytes": 0,
    "lag_seconds": 0.4
  }
}

App templates

POST/api/v1/governance/tenants/{org_id}/projects/{project_id}/templates/{name}/apply

Add an app template to the project: its tables, row security, rules and functions.

Templates: saas (organizations, members, invitations), marketplace, chat. Each step runs through the public API with your token. Run with dry_run: true first: it reports conflicts (tables that already exist) and what each step would do.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

org_idstringrequired
The organization.
project_idstringrequired
The project.
namestringrequired
saas, marketplace or chat.

Body

dry_runbooleanoptionaldefault false
Only check.

Responses

  • 200Success.
  • 401Sign in to apply a template.
  • 404TEMPLATE_NOT_FOUND.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/projects/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/templates/saas/apply" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"dry_run": true}'
Response
{
  "template": "saas",
  "dry_run": true,
  "ok": true,
  "conflicts": [],
  "steps": [
    {
      "type": "migration",
      "what": "template saas: organizations, members, invitations, projects",
      "status": "would apply"
    },
    {
      "type": "function_rules",
      "what": "accept_invitation()",
      "status": "would apply"
    }
  ]
}
Something unclear or missing on this page?Tell us