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.
The project's Postgres server: connection details, compute, backups and restores, read replicas and templates. Guides: Backups and recovery, Postgres in Sovaria.
| Base URL | https://<project-ref>.sovarias.in — your project URL from Connect. |
| Keys | Send the project's key as apikey. Calls made for a signed-in user also send Authorization: Bearer <access token>. |
| Errors | A 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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
Returns
statusstringprovisioning,ready,paused,failed…health_statusstring- From the last health check.
compute_sizestringnano,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) asAuthorization: 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_modetransactionby 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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Body
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 403The plan doesn't allow pausing.
- 400It can't be paused now (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/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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Body
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 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/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"
}GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/sleep
Whether the project's database, and each environment's, is asleep.
Databases nobody connects to sleep: staging, branch and preview databases after 3 idle days, Free projects after 14; paid production databases never sleep. state is awake, asleep or waking. A sleeping database wakes on the next request or connection (a few seconds), or with the wake call below.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: 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 "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/sleep" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"Response
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"state": "awake",
"can_sleep": true,
"environments": {
"7a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c4d": {
"state": "asleep",
"can_sleep": true,
"slept_at": "2026-10-25T03:10:00+00:00",
"notice": "This database is asleep; it wakes on the next request, which takes a few seconds."
}
},
"policy": {
"enabled": true,
"nonprod_days": 3,
"free_days": 14
}
}POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/wake
Wake a sleeping database now.
Answers once the database accepts connections (a few seconds) with state: "awake"; if it takes longer than the wait, state: "waking" — check again shortly. An awake database answers awake at once.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project, or one of its environments (its env id) to wake that environment's database.
Body
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 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/wake" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"Response
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"state": "awake"
}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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Body
compute_sizestringrequirednano,micro,small,medium,largeorxl(the plan decides which).- at least 1 characters
reasonstring | nulloptional- 0–500 characters
Responses
- 200The database record with the new
compute_size. - 403The size isn't in the plan, or the account has no money behind a size billed by the hour (
PLAN_LIMIT_REACHEDwithreasonandfix). - 502The resize didn't complete (the message says why).
- 503
QUOTA_SERVICE_UNAVAILABLE: billing couldn't be checked right now, so nothing was changed. Try again afterRetry-Afterseconds. - 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"}'#Environments
Staging environments and API versions, each with its own database (empty, structure only, or a masked sample or all of production's data).
GET/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments
Production plus the project's environments (staging ones and API versions), with database status and URL.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Returns
environments[].database_modestring- What its database started with:
schema,empty,sampleorall. environments[].copy_statestring- The row copy of a sample/all environment:
none,copying,doneorfailed. limitinteger- Environments the plan allows besides production (
env.staging_environments).
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/projects/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/environments" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"Response
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"production": {
"status": "ready"
},
"environments": [
{
"env_id": "9a1e7c3b-2d4f-4b8a-9c1e-5f6a7b8c9d0e",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"name": "staging",
"kind": "staging",
"label": null,
"created_by": "6e19c0a2-…",
"created_at": 1761300000.0,
"database_mode": "sample",
"copy_state": "copying",
"status": "ready",
"api_url": "https://3fa1c2d9b8e7.sovarias.in"
}
],
"limit": 2
}POST/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments
Create an environment with its own database in the project's container, optionally with a copy of production's data.
database chooses what it starts with: schema (default — production's structure and migration history, no rows), empty, sample (plus up to sample_rows newest rows per table and every row they refer to; plan env.branch_data ≥ sample, Pro and higher) or all (every row, refused above env.branch_data_max_gb; Ultra and higher). Personal-looking columns are masked with deterministic fakes unless mask is false; app users (the auth schema) are never copied. Rows are copied as a job after the answer: copy_state is copying; poll GET …/environments/{env_id}/copy. Environments, staging and deploying to production
- Who
- A builder of the project; copying rows (
sample/all) needs an organization owner or admin.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Body
env_idstringrequired- A new id (UUID) for the environment.
- 36–36 characters
namestringoptionaldefaultstaging- Lowercase, 2–31 characters, e.g.
staging. - 2–31 characters
kindstringoptionaldefaultstagingstaging(default) orversion(an API version).- 0–16 characters
labelstring | nulloptional- Version label, e.g.
v2. - 0–16 characters
from_env_idstring | nulloptional- Start from this environment instead of production (plan
env.branch_from_environment). - 36–36 characters
databasestringoptionaldefaultschemaschema(default),empty,sampleorall.- 0–8 characters
sample_rowsinteger | nulloptional- Rows per table for
sample(capped byenv.branch_sample_rows). - 1.0–1000000.0
include_tablesarray<string>optional- Copy rows of these tables only (
schema.tableortable). - 0–500 items
exclude_tablesarray<string>optional- Don't copy rows of these tables.
- 0–500 items
maskbooleanoptionaldefaulttrue- Mask personal-looking columns (default
true;falseneeds owner/admin and is audited). mask_addarray<string>optional- More columns to mask,
schema.table.column. - 0–500 items
mask_skiparray<string>optional- Columns to copy as they are,
schema.table.column(owner/admin). - 0–500 items
protectedbooleanoptionaldefaultfalseexpires_in_daysinteger | nulloptional- 1.0–365.0
Responses
- 201Created.
- 400Bad name or
BAD_DATABASE_OPTION. - 403
PLAN_FEATURE_UNAVAILABLE(data copy not in the plan),PLAN_LIMIT_REACHED(environments), or a data copy by someone who isn't an owner/admin. - 404The project or
from_env_idisn't in this organization. - 409Label taken.
- 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/projects/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/environments" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"env_id": "9a1e7c3b-2d4f-4b8a-9c1e-5f6a7b8c9d0e", "name": "staging", "database": "sample", "sample_rows": 500, "exclude_tables": ["audit_log"]}'Response
{
"env_id": "9a1e7c3b-2d4f-4b8a-9c1e-5f6a7b8c9d0e",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"name": "staging",
"kind": "staging",
"label": null,
"created_by": "6e19c0a2-…",
"created_at": 1761300000.0,
"database_mode": "sample",
"copy_state": "copying",
"status": "ready",
"api_url": "https://3fa1c2d9b8e7.sovarias.in",
"database": "sample"
}GET/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments/{env_id}/copy
What an environment's database started with and how its row copy is going.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
env_idstringrequired- The environment.
Returns
statestringnone,copying,doneorfailed(thenerrorsays why; the tables were left empty).detail.maskedstring[]- Every column that was replaced with fakes.
Responses
- 200Success.
- 404Environment not found.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/projects/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/environments/9a1e7c3b-2d4f-4b8a-9c1e-5f6a7b8c9d0e/copy" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"Response
{
"env_id": "9a1e7c3b-2d4f-4b8a-9c1e-5f6a7b8c9d0e",
"database": "sample",
"state": "done",
"error": null,
"detail": {
"mode": "sample",
"tables": {
"public.orders": 500,
"public.users": 212
},
"rows": 712,
"masked": [
"public.users.email",
"public.users.phone",
"public.users.full_name"
],
"bytes": 9437184
},
"started_at": 1761300001.2,
"finished_at": 1761300009.8
}DELETE/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments/{env_id}
Delete an environment and its database (a snapshot is kept first).
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
env_idstringrequired- The environment.
Responses
- 200Success.
- 404Environment not found.
- 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/projects/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/environments/9a1e7c3b-2d4f-4b8a-9c1e-5f6a7b8c9d0e" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"Response
{
"status": "deleted",
"env_id": "9a1e7c3b-2d4f-4b8a-9c1e-5f6a7b8c9d0e"
}#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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Query parameters
limitintegeroptionaldefault20- How many (1–100).
- 1–100
Returns
kindstringdaily,manual, orpre_restore(the safety backup taken before a restore)statusstringcompleted(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) asAuthorization: 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) asAuthorization: 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. tostringoptionaldefaultnowinclude_platformbooleanoptionaldefaultfalse- Include Sovaria's own schemas (auth, storage…).
Responses
- 200Success.
- 400
BAD_MOMENT— use a backup id ornow. - 404
BACKUP_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
confirmbooleanoptionaldefaultfalse- Must be
true.
Responses
- 202Accepted — the work continues in the background.
- 400
CONFIRM_REQUIRED. - 403Not an owner/admin, or
PLAN_QUOTA_EXHAUSTED. - 404
NO_DATABASE/BACKUP_NOT_FOUND. - 409
BACKUP_NOT_USABLE,RESTORE_RUNNING,DATABASE_NOT_READY, or the database is shared (needs a dedicated one). - 500
SAFETY_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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Returns
restores[].statusstringrunning,done,failed(seeerror) orundone.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.
- 404
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/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
}#Point-in-time recovery
Restore the database to any second in the plan's window (Pro and higher).
GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/backups/pitr
Point-in-time recovery of the project's database: whether it is on and the window you can restore to.
state is off, restart_required (turning it on needs one restart, see …/pitr/enable), on, disabled or error. earliest_restore_time is the later of now minus the plan's window (db.pitr_retention_days) and the end of the first base backup; with archiving on, any moment up to now can be restored (the latest changes are archived when a restore starts). Backups and recovery
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Returns
statestringoff,restart_required,on,disabledorerror(seeerror).availableboolean- A restore is possible now (archiving on and the first base backup done).
earliest_restore_timestring | null- The earliest moment that can be restored (UTC).
latest_restore_timestring | null- The newest archived moment;
restorable_until_nowsays whether later moments up to now work too. retention_daysinteger- The plan's window (Free 0, Pro 7, Ultra 14, Team 28, Enterprise 35; staff can override it).
Responses
- 200Success.
- 404
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/backups/pitr" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"Response
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"plan": "pro",
"pitr_eligible": true,
"retention_days": 7,
"retention_hours": 168,
"state": "on",
"enabled": true,
"pitr_enabled": true,
"wal_archive_enabled": true,
"restart_required": false,
"available": true,
"enabled_at": "2026-10-16T08:59:40+00:00",
"earliest_restore_time": "2026-10-16T09:00:12+00:00",
"latest_restore_time": "2026-10-23T09:09:31+00:00",
"restorable_until_now": true,
"base_backups": 8,
"last_base_backup": {
"name": "pitr-base-f0c3e9a21b4d4e7f8a6c2d9b5e3f1a07-20261023020004.tar.gz",
"finished_at": "2026-10-23T02:00:41+00:00",
"size_bytes": 48211044
},
"archived_wal": {
"files": 2210,
"bytes": 381204480,
"last_archived_at": "2026-10-23T09:09:31+00:00"
},
"error": null,
"message": null,
"execution_mode": "provisioned"
}POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/pitr/enable
Turn on point-in-time recovery (WAL archiving).
Databases created on Pro and higher have it from the start. An older database needs one restart (a few seconds) for Postgres to start archiving: without restart: true nothing restarts and the answer has state: "restart_required". The first base backup starts right after, and restores are possible once it finishes.
- Who
- An organization owner or admin (or the service key). Staff send a
reason.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Body
restartbooleanoptionaldefaultfalse- Allow the one restart it may need (default
false). reasonstring | nulloptional- Staff only: why (audited).
- 0–500 characters
Responses
- 200Success.
- 403Not an owner/admin, or
PLAN_FEATURE_UNAVAILABLE(Free). - 404
NO_DATABASE. - 409
DEDICATED_DATABASE_REQUIRED,DATABASE_NOT_READYorPITR_MAIN_DATABASE_ONLY(a staging environment). - 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/pitr/enable" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"restart": true}'Response
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"plan": "pro",
"pitr_eligible": true,
"retention_days": 7,
"retention_hours": 168,
"state": "on",
"enabled": true,
"pitr_enabled": true,
"wal_archive_enabled": true,
"restart_required": false,
"available": false,
"enabled_at": "2026-10-16T08:59:40+00:00",
"earliest_restore_time": null,
"latest_restore_time": null,
"restorable_until_now": false,
"base_backups": 0,
"last_base_backup": null,
"archived_wal": {
"files": 0,
"bytes": 0,
"last_archived_at": null
},
"error": null,
"message": "The first base backup is being taken; restores are possible once it finishes.",
"execution_mode": "provisioned"
}POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/pitr/disable
Stop point-in-time recovery archiving (no restart).
What was archived stays restorable until it leaves the window. Archiving is not turned back on automatically; …/pitr/enable turns it on again.
- Who
- An organization owner or admin (or the service key). Staff send a
reason.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Body
reasonstring | nulloptional- Staff only: why (audited).
- 0–500 characters
Responses
- 200Success.
- 403Not an owner/admin.
- 404
NO_DATABASE. - 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/pitr/disable" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{}'Response
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"plan": "pro",
"pitr_eligible": true,
"retention_days": 7,
"retention_hours": 168,
"state": "disabled",
"enabled": false,
"pitr_enabled": false,
"wal_archive_enabled": false,
"restart_required": false,
"available": true,
"enabled_at": "2026-10-16T08:59:40+00:00",
"earliest_restore_time": "2026-10-16T09:00:12+00:00",
"latest_restore_time": "2026-10-23T09:09:31+00:00",
"restorable_until_now": false,
"base_backups": 8,
"last_base_backup": {
"name": "pitr-base-f0c3e9a21b4d4e7f8a6c2d9b5e3f1a07-20261023020004.tar.gz",
"finished_at": "2026-10-23T02:00:41+00:00",
"size_bytes": 48211044
},
"archived_wal": {
"files": 2210,
"bytes": 381204480,
"last_archived_at": "2026-10-23T09:09:31+00:00"
},
"error": null,
"message": null,
"execution_mode": "provisioned"
}POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/restore
Restore the project's database to a moment (point-in-time recovery).
Answers 202 at once with the restore job; poll GET …/backups/pitr/jobs/{job_id} (or GET …/restores). The latest changes are archived first, then the newest base backup before target_time and the WAL after it are replayed in a new container beside production, which is checked (every table counted). Only then, with confirm: true, a safety backup is taken and the recovered database is switched in; the data from right before is kept for undo for 7 days (…/restores/{restore_id}/undo). verify_only: true stops after the check and changes nothing (status verified). A real restore uses one rollback from the monthly allowance (chrono.rollbacks_month); a check doesn't. Backups and recovery
- Who
- An organization owner or admin (or the service key). Staff send a
reason.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Body
target_timestringrequired- The moment, ISO-8601 (
2026-10-22T14:32:00Z; without a zone it is read as UTC). Betweenearliest_restore_timeand now. - 1–64 characters
confirmbooleanoptionaldefaultfalse- Must be
truefor a real restore. verify_onlybooleanoptionaldefaultfalsetrue: only recover a copy and check it (defaultfalse).reasonstring | nulloptional- Staff only: why (audited).
- 0–500 characters
Returns
statusstringrunning, thendone,verified(check only),failed(seeerror) or laterundone.phasestring- The step it is on: archiving the latest changes, fetching the archive, replaying to the moment, checked: N tables, M rows, safety backup, switching over.
recovered_tostring | null- The last transaction the recovered copy replayed (from Postgres's recovery log).
Responses
- 202Accepted — the work continues in the background.
- 400
CONFIRM_REQUIRED,BAD_TARGET_TIMEorTARGET_IN_FUTURE. - 403Not an owner/admin,
PLAN_FEATURE_UNAVAILABLE(Free) orPLAN_QUOTA_EXHAUSTED. - 404
NO_DATABASE. - 409
PITR_NOT_ENABLED,PITR_NOT_READY(first base backup not done),TARGET_OUT_OF_RANGE(the message has the earliest moment),RESTORE_RUNNING,DEDICATED_DATABASE_REQUIRED. - 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/restore" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"target_time": "2026-10-22T14:32:00Z", "confirm": true}'Response
{
"id": 12,
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"backup_id": 0,
"backup_at": "2026-10-22T14:32:00+00:00",
"safety_backup_id": null,
"status": "running",
"error": "",
"actor": "6e19c0a2-…",
"created_at": "2026-10-23T09:10:00+00:00",
"finished_at": null,
"undone_at": null,
"dropped_at": null,
"kind": "pitr",
"target_time": "2026-10-22T14:32:00+00:00",
"recovered_to": null,
"phase": "queued",
"undo_until": null,
"verify_only": false,
"job_id": "12",
"poll_url": "/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/backups/pitr/jobs/12"
}GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/backups/pitr/jobs/{job_id}
One restore job (point-in-time or from a backup): status, step, moment and undo window.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
job_idstringrequired- The job's
id(from the restore's answer).
Responses
- 200Success.
- 404
NOT_FOUND. - 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/databases/f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07/backups/pitr/jobs/12" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"Response
{
"id": 12,
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"backup_id": 0,
"backup_at": "2026-10-22T14:32:00+00:00",
"safety_backup_id": 1093,
"status": "done",
"error": "",
"actor": "6e19c0a2-…",
"created_at": "2026-10-23T09:10:00+00:00",
"finished_at": "2026-10-23T09:13:52+00:00",
"undone_at": null,
"dropped_at": null,
"kind": "pitr",
"target_time": "2026-10-22T14:32:00+00:00",
"recovered_to": "2026-10-22 14:31:58.412+00",
"phase": "checked: 14 tables, 182330 rows",
"undo_until": "2026-10-30T09:13:52+00:00"
}#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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
Returns
replicas[].statusstringprovisioninguntil its base copy is done, thenready(orfailedwitherror).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) asAuthorization: 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.
- 403
PLAN_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) asAuthorization: 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) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization.
project_idstringrequired- The project.
namestringrequiredsaas,marketplaceorchat.
Body
dry_runbooleanoptionaldefaultfalse- Only check.
Responses
- 200Success.
- 401Sign in to apply a template.
- 404
TEMPLATE_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"
}
]
}#More endpoints
GET/api/v1/governance/compute/plans
List compute plans.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/compute/plans" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/postgres-upgrades/{org_id}/{project_id}
Get postgres upgrade.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/postgres-upgrades/<org-id>/<project-id>" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/postgres-upgrades/{org_id}/{project_id}/{action}
Post postgres upgrade.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
actionstringrequired
Body
reasonstringrequired- 3–500 characters
confirmbooleanoptionaldefaultfalserehearsebooleanoptionaldefaulttruemethodstringoptionaldefaultauto- pattern `^(auto|pg_upgrade|dump)$`
volumestring | nulloptional- 0–120 characters
Responses
- 200Success.
- 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/postgres-upgrades/<org-id>/<project-id>/<action>" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/backups/health
Backup health: last good backup, failures since, recovery point (RPO) of daily backups and PITR, retention and on-demand limits with what was used.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/backups/health" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/backups/pitr/restore
Request tenant pitr restore.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
target_timestringrequired- ISO-8601 moment to restore to, e.g. 2026-10-22T14:32:00Z
- 1–64 characters
confirmbooleanoptionaldefaultfalseverify_onlybooleanoptionaldefaultfalse- Recover beside production and check it, without switching over
reasonstring | nulloptional- 0–500 characters
Responses
- 202Accepted — the work continues in the background.
- 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/<org-id>/databases/<project-id>/backups/pitr/restore" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/capabilities
Get database capabilities.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/capabilities" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/compare/{compare_id}
A compare job: running, failed (with error) or the full answer with status done.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
compare_idintegerrequired
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/compare/<compare_id>" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/data/metadata
Get tenant data metadata.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/data/metadata" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/data/query
Execute tenant data query.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
sqlstringrequired- at least 1 characters
grant_idstringrequired- at least 1 characters
Responses
- 200Success.
- 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/<org-id>/databases/<project-id>/data/query" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/diagnostics
Get database diagnostics.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/diagnostics" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/exports
Portable export bundles of the project (Postgres dump + migration metadata).
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Query parameters
limitintegeroptionaldefault20- How many to return.
- 1–100
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/exports" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/exports
Create a portable export bundle (download it with download_project_export).
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/exports" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/index-advisor
Indexes that would speed up the slowest statements, tested as hypothetical indexes (hypopg).
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Query parameters
queryidstring | nulloptional- 0–40 characters
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/index-advisor" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/index-advisor/apply
Build a recommended index with CREATE INDEX CONCURRENTLY (background; poll index_status).
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
schemastringoptionaldefaultpublic- 1–63 characters
tablestringrequired- 1–63 characters
columnsarray<string>required- 1–3 items
reasonstring | nulloptional- 0–500 characters
Responses
- 202Accepted — the work continues in the background.
- 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/<org-id>/databases/<project-id>/index-advisor/apply" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/index-advisor/indexes/{index_name}
Whether an index the advisor started is building, ready, failed or invalid.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
index_namestringrequired
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/index-advisor/indexes/<index_name>" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/index-advisor/query
Index recommendations for one statement (only EXPLAINed, never run).
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
querystringrequired- 1–20,000 characters
Responses
- 200Success.
- 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/<org-id>/databases/<project-id>/index-advisor/query" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/kill-query
Kill database query.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
pidintegerrequired- 0.0–…
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 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/<org-id>/databases/<project-id>/kill-query" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/maintenance
Run database maintenance.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
actionstringrequired- pattern `^(vacuum|vacuum_full|analyze|reindex|checkpoint|reset_stats)$`
tablestring | nulloptionalreasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 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/<org-id>/databases/<project-id>/maintenance" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"DELETE/api/v1/governance/tenants/{org_id}/databases/{project_id}/password
Forget database password.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/password" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"PUT/api/v1/governance/tenants/{org_id}/databases/{project_id}/password
Set database password.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
passwordstringrequired- 1–200 characters
Responses
- 200Success.
- 401No valid session or key.
- 422The body is missing a required field or has a field of the wrong type.
curl -s -X PUT "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/password" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/pooler
Get database pooler.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/pooler" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"PUT/api/v1/governance/tenants/{org_id}/databases/{project_id}/pooler
Set database pooler.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
pool_modestringrequired- pattern `^(session|transaction|statement)$`
pool_sizeintegerrequired- 1.0–5000.0
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 401No valid session or key.
- 422The body is missing a required field or has a field of the wrong type.
curl -s -X PUT "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/pooler" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/query-insights
The project's SQL statements (pg_stat_statements) by total time, average, calls, worst run or rows.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Query parameters
sortstringoptionaldefaulttotallimitintegeroptionaldefault50- How many to return.
- 1–1000
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/query-insights" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/query-insights/reset
Clear this database's query statistics.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 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/<org-id>/databases/<project-id>/query-insights/reset" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/reconcile
Reconcile project data plane.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/reconcile" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/reset-password
Reset database password.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/reset-password" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/restart
Restart database container.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 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/<org-id>/databases/<project-id>/restart" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/restore-into
Restore this project's backup (backup_id) or a moment (target_time) into an environment of the project (env_id) or another project (project_id) instead of replacing production. Owners/admins; confirm: true; counts as a rollback.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
env_idstring | nulloptional- An environment of this project: its database is replaced
- 36–36 characters
project_idstring | nulloptional- Another project of this organization: its database is replaced
- 1–64 characters
backup_idinteger | nulloptional- 1.0–…
target_timestring | nulloptional- 1–64 characters
confirmbooleanoptionaldefaultfalsereasonstring | nulloptional- 0–500 characters
Responses
- 202Accepted — the work continues in the background.
- 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/<org-id>/databases/<project-id>/restore-into" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/restore-tables
Copy single tables from a backup or a moment into production as restored_<table>_<stamp> beside the live ones (nothing live changes). Owners/admins; counts as a rollback.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
tablesarray<string>required- "schema.table" or "table" (public)
- 1–50 items
backup_idinteger | nulloptional- 1.0–…
target_timestring | nulloptional- 1–64 characters
reasonstring | nulloptional- 0–500 characters
Responses
- 202Accepted — the work continues in the background.
- 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/<org-id>/databases/<project-id>/restore-tables" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/databases/{project_id}/rotate-password
Rotate database password.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 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/<org-id>/databases/<project-id>/rotate-password" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"PUT/api/v1/governance/tenants/{org_id}/databases/{project_id}/settings
Set database settings.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
statement_timeout_msinteger | nulloptional- 0.0–86400000.0
idle_in_transaction_timeout_msinteger | nulloptional- 0.0–86400000.0
read_onlyboolean | nulloptionallog_min_duration_msinteger | nulloptional- -1.0–86400000.0
reasonstring | nulloptional- 0–500 characters
Responses
- 200Success.
- 401No valid session or key.
- 422The body is missing a required field or has a field of the wrong type.
curl -s -X PUT "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/settings" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/databases/{project_id}/setup
Get tenant database setup.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/setup" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"PUT/api/v1/governance/tenants/{org_id}/databases/{project_id}/statement-timeout
Set database statement timeout.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
statement_timeout_msintegerrequired- 1000.0–86400000.0
Responses
- 200Success.
- 401No valid session or key.
- 422The body is missing a required field or has a field of the wrong type.
curl -s -X PUT "$URL/api/v1/governance/tenants/<org-id>/databases/<project-id>/statement-timeout" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"DELETE/api/v1/governance/tenants/{org_id}/domains/{domain_id}
Delete tenant custom domain.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
domain_idstringrequired
Responses
- 200Success.
- 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/governance/tenants/<org-id>/domains/<domain_id>" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/domains/{domain_id}/verify
Verify tenant custom domain.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
domain_idstringrequired
Responses
- 200Success.
- 401No valid session or key.
curl -s -X POST "$URL/api/v1/governance/tenants/<org-id>/domains/<domain_id>/verify" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/projects/{project_id}/checkpoints
Create database checkpoint.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
Body
env_idstring | nulloptional- 0–36 characters
Responses
- 201Created.
- 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/<org-id>/projects/<project-id>/checkpoints" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/projects/{project_id}/checkpoints/{backup_id}/restore
Restore database checkpoint.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
backup_idintegerrequired
Body
env_idstring | nulloptional- 0–36 characters
confirmbooleanoptionaldefaultfalse
Responses
- 202Accepted — the work continues in the background.
- 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/<org-id>/projects/<project-id>/checkpoints/<backup-id>/restore" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"PATCH/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments/{env_id}
Change an environment (owners and admins): kind staging | version (with label, e.g. v2), protected (plan env.protection: no delete, reset or restore until turned off), expires_in_days (deleted automatically after that many days; 0 clears it).
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
env_idstringrequired
Body
kindstring | nulloptional- 0–16 characters
labelstring | nulloptional- 0–16 characters
protectedboolean | nulloptionalexpires_in_daysinteger | nulloptional- 0.0–365.0
Responses
- 200Success.
- 401No valid session or key.
- 422The body is missing a required field or has a field of the wrong type.
curl -s -X PATCH "$URL/api/v1/governance/tenants/<org-id>/projects/<project-id>/environments/<env_id>" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments/{env_id}/reset
Make an environment's database again from the one it started from (its parent environment, else production) with the same data option; sample/all rows are copied again with the same masking. A backup is taken first; functions and policies are kept.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
env_idstringrequired
Body
confirmbooleanoptionaldefaultfalse
Responses
- 200Success.
- 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/<org-id>/projects/<project-id>/environments/<env_id>/reset" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"POST/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments/{env_id}/restore
Put an environment's database back as it was at at (point-in-time, within db.pitr_retention_days; production is not touched). Runs as a job: poll get_environment_restore.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
env_idstringrequired
Body
atstringrequired- ISO time to put the environment's database back to
- 10–40 characters
confirmbooleanoptionaldefaultfalse
Responses
- 202Accepted — the work continues in the background.
- 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/<org-id>/projects/<project-id>/environments/<env_id>/restore" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"GET/api/v1/governance/tenants/{org_id}/projects/{project_id}/environments/{env_id}/restore/{restore_id}
How an environment restore is going: status running | done | failed, phase, recovered_to, error.
- Who
- A project team member's session (the console, or a token from
sov login) asAuthorization: Bearer <token>. The member's role must allow the action.
Path parameters
org_idstringrequired- The organization id.
project_idstringrequired- The project id.
env_idstringrequiredrestore_idintegerrequired
Responses
- 200Success.
- 401No valid session or key.
curl -s "$URL/api/v1/governance/tenants/<org-id>/projects/<project-id>/environments/<env_id>/restore/<restore_id>" \
-H "apikey: $ANON_KEY" \
-H "Authorization: Bearer $ACCESS_TOKEN"