Skip to content

Databases · early access

Managed Postgres, resident in the region you pick.

One request creates a Postgres database in that region's own cell, with vectors, a knowledge graph, sign-in, storage, functions and scheduled jobs. The Supabase client you already use connects with two values. The management API below lives under the same base URL and API key as the rest of CloudSitus.

https://cloudsitus.com/api/v1Create a database
POST/v1/databases
curl https://cloudsitus.com/api/v1/databases \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "region": "US", "label": "orders" }'
On this page

Overview

What you get

Each database is its own Postgres database and role inside the cell of the region you name. Nothing is copied out of that region, and a region with no open cell refuses the request instead of placing the database elsewhere.

Early access

Managed databases are in early access. A region is offered only while its cell is open, so the set of regions grows over time; when the product is not enabled for your account, every endpoint answers 503 databases_unavailable. Shapes may still gain fields.

Regionsregion codes

US, LATAM, UK, EU, CH, MENA, INDIA, ASIA, ANZ — passed as region on create. There is no default and no WORLD: where a database lives is a residency decision you make explicitly. A region that is not open yet answers 422 region_not_available, naming the regions that are.

Database id<cell>_<16>

For example us_k3v9q0x7m2a4b8c1. The prefix is the cell, the suffix 16 lowercase letters and digits. Every path below takes it as {id}.

Every database shipsbuilt in

Postgres with vector, pg_trgm, pgcrypto and uuid-ossp; an auth schema you own (auth.uid(), auth.users); storage; supabase_migrations; and the situs_graph schema (nodes, edges, neighbors(), similar()).

Billingusage

Billed hourly on usage from creation: an idle share, storage, statement time and I/O. A suspended database is billed for storage only; a deleted one is not billed during its restore window. Prices are on /pricing.

Auth

Authentication

The management API takes your CloudSitus API key as a bearer token, exactly like the AI endpoints. The keys a database issues (below) are for your application and the database's own URL — not for these endpoints.
AuthorizationBearer cs_live_…required

An account key from the Keys page. Missing or bad keys answer 401 (missing_authorization, invalid_api_key, api_key_expired).

Customer sub-keysreseller

A reseller's end-customer key gets 403 subkey_not_allowed unless databases for end-customers are enabled on the reseller account; then a sub-key sees and manages only its own databases.

Dashboard-session keys24 h keys

The short-lived key the dashboard mints for its chat and playground cannot reveal database keys, delete a database, rotate keys, run writing SQL, manage sign-in users or settings, deploy functions or secrets, restart a project or change realtime. Those calls answer 403 insufficient_key_scope with the refused operation.

Dry runs first

Every call that removes something — delete, rotate keys, delete a function, secret or user, switch sign-in or realtime off, restart, roll back an import — only describes what it would do until you send confirm=true (query string) or "confirm": true (body). Show the preview to a person, then repeat the call.

Client

Connect with the Supabase client

The database URL is https://db-<cell>.cloudsitus.com/p/<id> (the supabase_url field). createClient(supabase_url, anon_key) works as it does on Supabase, for the parts listed here.
TypeScript
import { createClient } from '@supabase/supabase-js'

// supabase_url + anon_key from POST /api/v1/databases
const db = createClient(
  'https://db-us.cloudsitus.com/p/us_k3v9q0x7m2a4b8c1',
  process.env.CLOUDSITUS_DB_ANON_KEY!,
)

const { data, error } = await db.from('orders').select('id, total').limit(10)
await db.storage.from('invoices').upload('2026/11/a.pdf', file)
await db.functions.invoke('send-receipt', { body: { id: 42 } })
anon_keypublishable

Safe in a browser. Requests run as the anon role; with a signed-in user's JWT as the bearer they run as that user's role, under your row-level security policies.

service_role_keysecret

Server-side only. Runs as service_role, which bypasses row-level security.

read_only_keysecret

Every request runs in a read-only transaction. Useful for analytics and reporting jobs.

/rest/v1tables

PostgREST-compatible tables, views, filters and RPC.

/storage/v1files

Buckets, uploads, downloads and signed URLs, in the same region as the database.

/functions/v1/<name>functions

Functions you deploy (see Functions), run in the database's region.

/auth/v1sign-in

The database's own sign-in server, once switched on (see Sign-in); 404 auth_not_configured until then.

/realtime/v1/websocketrealtime

Broadcast, presence and Postgres changes once realtime is enabled; 404 realtime_not_configured until then.

/cron/v1scheduled jobs

Scheduled SQL or HTTPS jobs, managed with the service key. It replaces pg_cron / pg_net, which are not available inside SQL.

/keys/v1/data-keyencryption

A per-database data key for encrypting values in your application (service key).

Not supported (yet)

Direct Postgres connections from outside the cell (psql, Prisma, Drizzle, supabase db push) — use the SQL endpoint, the client or migrations instead. Also not available: GraphQL, pg_net / pg_cron / Vault inside SQL, resumable (TUS) uploads, image transforms and realtime REST broadcast. Row-level security is opt-in per table, as on Supabase: a table without it is readable and writable with the anon key.

Endpoint

Create a database

POST/v1/databases
Creates the database in the named region and returns it with its three keys. The keys are derived, never stored: you can view them again later, and rotating revokes them.
regionstringrequired

One of the region codes above (or send X-Region). No default.

labelstringoptional

Letters, digits, space, _ and -, up to 48 characters. Labels are not unique: databases that share a label form a group you can query by name, one per region.

size—

Leave it out: there is no size to choose. A database scales with load, and to zero when idle.

POST/v1/databases
curl https://cloudsitus.com/api/v1/databases \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "region": "US", "label": "orders" }'
422region_not_available

The region is not open yet, or region is missing.

402plan_limit_reached

Your plan's database count is used up (limit, count in the error). Databases waiting for deletion do not count.

402insufficient_credit

On prepaid credit, creating a database needs a balance covering 24 idle hours of all your databases (needed_micro, balance_micro in the error).

400invalid_label / invalid_request

A label that is not a string, or a size.

Endpoint

List & get

GET/v1/databases
Every database on the account, oldest first, including those waiting for deletion. GET /v1/databases/{id} returns one.
statusavailable | suspended | pending_deletion

With suspended ({at, reason}), deletion ({requested_at, purge_after}) and read_only (set while the account is locked for an unpaid balance) explaining why.

?reveal=keysqueryoptional

On GET /v1/databases/{id}: adds anon_key, service_role_key and read_only_key (sent with cache-control: no-store). Refused for dashboard-session keys and for a database waiting for deletion.

authobject | null

The trusted JWT issuer, if any: {kind: "hs256" | "jwks", jwks_url, issuer, audience}. The secret is never returned.

Endpoint

Delete & restore

DELETE/v1/databases/{id}?confirm=true
Bills what is due, then holds the database for 7 days: it is suspended, unusable and not billed, and any other operation answers 409 database_pending_deletion. After the window it is purged for good.
cURL
# 1. Dry run: what would happen (nothing changes)
curl -X DELETE https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1 \
  -H "Authorization: Bearer cs_live_…"
# → { "object": "database.delete_preview", "deleted": false,
#     "restore_window_days": 7, "message": "…" }

# 2. Delete (held for 7 days, then purged)
curl -X DELETE "https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1?confirm=true" \
  -H "Authorization: Bearer cs_live_…"
# → { "object": "database", "deleted": true, "status": "pending_deletion",
#     "deletion": { "requested_at": "…", "purge_after": "…" },
#     "final_cost_micro": 1830 }

# 3. Changed your mind? Inside the 7 days:
curl -X POST https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/restore-deleted \
  -H "Authorization: Bearer cs_live_…"
POST /v1/databases/{id}/restore-deletedundo

Brings it back inside the window (still suspended if it was suspended before). 409 not_pending_deletion if it was not deleted; 410 restore_window_expired after the 7 days.

Account deletionimmediate

Deleting your account deletes every database immediately, with no restore window.

Endpoint

Suspend, resume, restart

POST/v1/databases/{id}/suspend
Stops all access at once: open sessions end, every request answers 423 database_suspended, and only storage is billed. Idempotent.
suspend · reasonstringoptional

Up to 200 characters, shown back in suspended.reason.

POST /v1/databases/{id}/resumeno body

Makes it available again. Idempotent. 402 account_locked while an unpaid balance keeps the account locked.

POST /v1/databases/{id}/restartcomponents?, confirm

Restarts this project only — never the cluster. components is a subset of connections, realtime, functions, sign_in (default: all). Without confirm: true it returns database.restart_preview describing each effect; with it, database.restart with a status per component (restarted, skipped, failed, pending_operator). 501 restart_unavailable where a region does not support it yet.

Endpoint

Rotate keys

POST/v1/databases/{id}/rotate-key?confirm=true
Revokes the anon, service_role and read-only keys together (within about 30 seconds) and returns three new ones. Without confirm=true it returns database.rotate_key_preview.

Rotation breaks running clients

Every client holding an old key gets 401 key_revoked once the rotation lands. Deploy the new keys first where you can, then rotate.

Endpoint

Run SQL

POST/v1/databases/{id}/query
Runs one statement in one transaction, as the database's own role. Send "read_only": true for a read-only transaction; without it the statement may write.
sqlstringrequired

One statement, up to 100,000 characters. Use $1, $2… with params rather than string-building values.

paramsarrayoptional

Positional parameter values.

read_onlybooleanoptional

true runs the statement in a read-only transaction (a write then fails with 403 read_only). Read-only calls keep working while the account is locked, and are the only kind a dashboard-session key may send.

{id} as a labelgroups

Pass a label instead of an id to address a group of databases that share it; the X-Region header then picks the member (400 region_required without it, 422 no_database_in_region if the group has none there).

POST/v1/databases/{id}/query
curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/query \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "select id, total from orders where total > $1 order by id",
    "params": [100],
    "read_only": true
  }'

{
  "object": "database.query_result",
  "fields": [{ "name": "id", "type_id": 20 }, { "name": "total", "type_id": 1700 }],
  "rows": [{ "id": 7, "total": "129.00" }],
  "row_count": 1,
  "truncated": false,
  "command": "SELECT",
  "ms": 4
}

Limits and errors

At most 200 rows come back (truncated says when there were more) and a 5 MB payload. A statement times out after 15 seconds (408 statement_timeout). Postgres errors come back as sql_<SQLSTATE> with Postgres's message: 409 for constraint violations, 403 for permission errors, 400 otherwise. The SQL endpoint is for operations and tooling; your application should use the client.

Endpoint

Migrations

POST/v1/databases/migrations
Applies versioned migrations across your databases — every database on the account, or the ones you list. Each pending version runs in its own transaction together with its row in supabase_migrations.schema_migrations, so a re-run skips what is applied.
migrationsarrayrequired

Up to 500 entries of {version, name?, sql}. version is 1–32 digits and unique; versions run in numeric order. sql may hold several statements. Each migration up to 8 MB, 16 MB in total.

databasesstring[]optional

Up to 1,000 database ids. Default: every database on the account.

confirmbooleanoptional

true runs the pending versions. Without it the call is a dry run: it reports what is pending per database and runs nothing ("dry_run": true)."dry_run": false counts as the confirmation too.

GET /v1/databases/{id}/migrationshistory

The applied versions of one database, oldest first ({version, name}).

POST/v1/databases/migrations
# Apply the same migrations to every database on the account
# (or the ones you name). Already-applied versions are skipped.
# Without "confirm": true this is a dry run: it reports what is pending.
curl https://cloudsitus.com/api/v1/databases/migrations \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "migrations": [
      { "version": "20261113090000", "name": "orders",
        "sql": "create table public.orders (id bigint primary key, total numeric not null);" }
    ],
    "dry_run": true
  }'

{
  "object": "database.migration_report", "dry_run": true, "ok": true,
  "versions": ["20261113090000"],
  "databases": [
    { "id": "us_k3v9q0x7m2a4b8c1", "status": "ok", "applied": [], "skipped": [],
      "pending": ["20261113090000"] }
  ]
}

Failure is per database

A database stops at its first failing version (failed: {version, code, message}); the others carry on. Suspended databases are reported as suspended and skipped. Each migration has 90 seconds (migration_timeout), and four databases are migrated at a time.

Endpoint

Setup agent

POST/v1/databases/{id}/agent
Describe what you want in plain language; the agent inspects the schema, runs read-only queries and proposes migrations. In apply mode it also applies them. It runs on a model resident in the database's region where one exists.
instructionstringrequired

Up to 8,000 characters.

modeplan | applyoptional

plan (default) only proposes; apply applies the proposed migrations.

allow_destructivebooleanoptional

Apply mode only. Without it, dropping, truncating or rewriting data is refused. Never available to a dashboard-session key.

allow_global_processingbooleanoptional

Regions with no resident model (UK, ASIA, ANZ, INDIA, LATAM, MENA today) answer 422 no_resident_agent_model until a person allows the agent's model to run outside the region. The data stays in the database either way; only the conversation is processed elsewhere.

messagesarrayoptional

Up to 20 earlier turns {role: "user" | "assistant", content}. Nothing is stored: you keep the history.

modelstringoptional

Pin a model; honoured or refused, never swapped.

POST/v1/databases/{id}/agent
curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/agent \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "instruction": "Add a customers table with email unique, and link orders to it.",
    "mode": "plan"
  }'

{
  "object": "database.agent_run", "database": "us_k3v9q0x7m2a4b8c1",
  "mode": "plan", "model": "…", "region": "US", "processing": "resident",
  "answer": "…",
  "proposed_migrations": [{ "name": "customers", "sql": "create table …", "reason": "…" }],
  "actions": [], "steps": 3, "usage": { … }, "cost_micro": 812
}

Bounds

At most 10 tool steps and 90 seconds per run (stopped: "max_steps" | "budget" when hit); tool reads return at most 50 rows. Billed on the model's tokens (cost_micro); the queries count toward the database's usage.

Endpoint

Sign-in & JWT issuer

PUT/v1/databases/{id}/auth
Two ways to have signed-in users: trust the tokens of a provider you already run, or switch on the database's own sign-in server. Either way, auth.uid() and your row-level security policies see the user.
PUT …/auth · jwt_secretstring, 32–512 chars

Trust HS256 tokens signed with this secret. Never returned.

PUT …/auth · jwks_url + issuer + audiencestrings

Trust tokens verified against a public https JWKS URL; issuer and audience are required with it. JWKS tokens may carry the anon or authenticated role. {"jwt_secret": null, "jwks_url": null} removes the issuer.

GET | POST …/auth/serversign-in server

POST {enabled: true, site_url?} switches on the database's own sign-in server (email, phone, OAuth providers, magic links, MFA), reached through /auth/v1 on the database URL. Switching off needs confirm: true. GET returns its state, settings and which secrets are set (never their values).

PATCH …/auth/server/configsettings, secrets

Up to 200 keys at once: settings (e.g. site_url, uri_allow_list, disable_signup, password_min_length, jwt_exp, SMTP, providers; null resets one) and write-only secrets (e.g. smtp_pass, external_<provider>_secret; null removes one).

GET | POST …/auth/usersusers

List users (limit 1–100, offset, search q), or {action: "invite" | "create", email, password?, email_confirm?, redirect_to?}. Needs the sign-in server (409 auth_server_not_connected).

GET | POST | DELETE …/auth/users/{uid}one user

Read one user, {action: "ban" | "unban" | "resend" | "recover" | "magiclink"}, or delete with ?confirm=true.

cURL
# Trust your own sign-in provider's tokens (JWKS) …
curl -X PUT https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/auth \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "jwks_url": "https://auth.example.com/.well-known/jwks.json",
        "issuer": "https://auth.example.com/", "audience": "orders-app" }'

# … or run the database's own sign-in server instead
curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/auth/server \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": true, "site_url": "https://app.example.com" }'

One issuer at a time

The sign-in server and a JWKS issuer cannot both be active; switching one on while the other is set answers 409 issuer_conflict. User JWTs must carry exp.

Endpoint

Realtime

POST/v1/databases/{id}/realtime
Switches realtime on for the database: {"enabled": true, "postgres_changes": true}. Clients connect to wss://db-<cell>.cloudsitus.com/p/<id>/realtime/v1/websocket with the usual supabase.channel(…) calls.
GET …/realtimestate

What is on and what this region offers: broadcast_presence and postgres_changes (on, available, on_request, unavailable), the socket URL and the published tables.

enabledbooleanrequired

Switching off needs confirm: true.

postgres_changesbooleanoptional

Stream row changes. Where a region offers it on request only, the call answers 409 postgres_changes_on_request; broadcast and presence still work.

Limits

Up to 500 connections per database; an idle socket closes after 120 seconds. Read-only keys cannot connect.

Endpoint

Functions

PUT/v1/databases/{id}/functions/{name}
Deploys one bundled JavaScript module as an HTTP function, run in the database's region. Called from your app with supabase.functions.invoke(name) or at /functions/v1/<name>. Returns 201 when created, 200 when replaced.
namepath

1–31 characters: lowercase letters, digits, -, _.

codestringrequired

One bundled module, up to 10 MB (bundle imports first; unbundled projects are not supported).

verify_jwtbooleanoptional

Default true: callers must present a valid key or user JWT.

memory_mb · timeout_sintegersoptional

128–3008 MB and 1–300 seconds.

GET …/functionslist

Deployed functions and the names of their secrets.

DELETE …/functions/{name}?confirm=trueremove

Dry run without confirm.

POST …/functions/{name}/invoketest call

{method?, path?, body?, role?: "anon" | "service_role", headers?} → the function's status, headers and body (first 64 KB). Body up to 1 MB; 70-second limit.

PUT …/function-secretsenv

{"secrets": {"NAME": "value"}}, 1–100 at a time, names A–Z 0–9 _ (not starting SUPABASE_, AWS_ or LAMBDA_), values up to 4 KB. Values are never returned. DELETE …/function-secrets/{NAME}?confirm=true removes one.

cURL
# Deploy ONE bundled JS module (esbuild/deno bundle output)
curl -X PUT https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/functions/send-receipt \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile code dist/send-receipt.js '{code: $code, timeout_s: 30}')"

# Call it from your app with the client …
#   await db.functions.invoke('send-receipt', { body: { id: 42 } })
# … or test it through the API
curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/functions/send-receipt/invoke \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "method": "POST", "body": { "id": 42 } }'

Limits

Requests and responses up to 6 MB, environment up to 4 KB, 50 calls in flight per database. 409 functions_not_available where a region has no function runtime yet.

Endpoint

Exports

POST/v1/databases/{id}/exports
A full dump of your database, taken as the database's own role, plus your storage files. Exports work even on an empty balance or a locked account: you can always take your data out.
formatcustom | plainoptional

custom (default, for pg_restore) or plain SQL.

Responsedatabase.export

id, status (queued → running → done | failed), url and expires_at once done, size_bytes. List with GET …/exports, poll GET …/exports/{job}.

cURL
curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/exports \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "format": "custom" }'
# → 202 { "object": "database.export", "id": "…", "status": "queued", … }

curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/exports/<job> \
  -H "Authorization: Bearer cs_live_…"
# → { "status": "done", "url": "https://…", "expires_at": "…", "size_bytes": 482113 }

Link lifetime

The download link is valid for 24 hours, and the file is deleted soon after. One export runs at a time per database (409 export_in_progress).

Endpoint

Point-in-time restore

POST/v1/databases/{id}/restores
Restores the database as it was at a moment in the past into a new database in the same region, with its own keys. The original is not touched.
restore_timeISO-8601 with a zonerequired

E.g. 2026-11-12T18:30:00Z. Not in the future, not before the database was created, and inside the region's backup window — otherwise 400 restore_time_out_of_range names the range you can pick from.

confirmbooleanoptional

true starts the restore. Without it the call is a dry run: database.restore_preview checks restore_time and shows what the new database would cost per month at least. Nothing starts.

Responsedatabase.restore

status, phase, and new_database (the new id) once done. Expect 30–60 minutes. List with GET …/restores, poll GET …/restores/{job}.

Not restoredby design

Storage files, scheduled jobs, functions and their secrets stay with the original database.

cURL
curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/restores \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "restore_time": "2026-11-12T18:30:00Z" }'
# → 200 { "object": "database.restore_preview", "started": false,
#         "estimate": { "monthly_floor_usd": … }, … }   nothing started yet

curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/restores   -H "Authorization: Bearer cs_live_…"   -H "Content-Type: application/json"   -d '{ "restore_time": "2026-11-12T18:30:00Z", "confirm": true }'
# → 202 { "object": "database.restore", "id": "…", "status": "queued",
#         "restore_time": "…", "new_database": null, "phase": "queued" }

# Poll; when done, new_database is the id of the restored copy
curl https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/restores/<job> -H "Authorization: Bearer cs_live_…"

It is a new database

The copy is billed from creation and appears in GET /v1/databases, labelled restore of <id> @ <time>. Starting one needs the same credit as creating a database (402 insufficient_credit); one restore runs at a time per database (409 restore_in_progress).

Endpoint

Imports: bring your backend

POST/v1/databases/imports/plan
Move a Supabase project, any public Postgres (RDS, Cloud SQL, Neon, self-hosted…) or an S3, GCS or R2 bucket into a new database: plan → run → verify → cut over, with a one-call rollback. The source is only ever read.
source.kindsupabase | postgres | s3required

postgres / supabase take db_url (postgres:// or postgresql://, TLS required: sslmode require, verify-ca or verify-full), optional ca_cert (PEM), schemas and location. supabase adds project_url and service_role_key (for Storage). s3 takes bucket, access_key_id, secret_access_key, and optional region, endpoint (https), prefix, target_bucket. GET /v1/databases/imports/sources lists what each kind copies.

POST …/imports/plansource, region

The target region's cell connects read-only and returns database.import_plan: a summary (tables, rows, auth users, buckets, objects, scheduled jobs), extension compatibility, steps, estimates, any refusals, warnings, a residency receipt (where the source is, where the data will live, crosses_border) and a plan_hash. Nothing is created.

POST /v1/databases/importsrun

Same source and region, plus plan_hash, label?, options? (include_auth, include_storage, include_cron), acknowledge_transfer: true when the receipt crosses a border or the source location is unknown, and confirm: true (without it you get a preview). Creates the database and returns 202 with the job to poll. Keys are not in this response: read them with ?reveal=keys.

GET …/{id}/imports/{job}progress

status and phase (inspect → schema → data → auth → post → storage → cron → verify → done), the report and warnings.

POST …/{id}/imports/{job}/verifysource

Compares row counts, sequences, sampled rows, policies, sign-in users and storage against the source. Credentials are used for this request only.

GET …/{id}/imports/{job}/cutoverchecklist

ready, blockers, and the cut-over steps (freeze writes, final copy, switch env vars, activate scheduled jobs, DNS and webhooks) with the rollback steps.

POST …/{id}/imports/{job}/rollbackconfirm

Deletes the new database (the usual 7-day restore window applies). Dry run without confirm.

cURL
# 1. Plan: the target region's cell reads the source (read-only) and
#    returns an inventory, a residency receipt and a plan_hash.
curl https://cloudsitus.com/api/v1/databases/imports/plan \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "region": "EU",
    "source": { "kind": "postgres",
                "db_url": "postgresql://reader:…@db.example.com:5432/app?sslmode=require" }
  }'

# 2. Run: same source + the plan_hash, then confirm.
curl https://cloudsitus.com/api/v1/databases/imports \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "region": "EU", "label": "app", "source": { … },
        "plan_hash": "9c1e…", "acknowledge_transfer": true, "confirm": true }'
# → 202 { "object": "database.import", "id": "import_…",
#         "database": { "id": "eu_…", "supabase_url": "…" },
#         "poll": "/api/v1/databases/eu_…/imports/import_…" }

# 3. Verify against the source, 4. read the cut-over checklist
curl -X POST https://cloudsitus.com/api/v1/databases/eu_…/imports/import_…/verify -d '{ "source": { … } }' …
curl https://cloudsitus.com/api/v1/databases/eu_…/imports/import_…/cutover -H "Authorization: Bearer cs_live_…"

# 5. Roll back = delete the new database (the source was only read)
curl -X POST "https://cloudsitus.com/api/v1/databases/eu_…/imports/import_…/rollback?confirm=true" …

How credentials and sources are handled

Source credentials are never stored: they are sealed into the running job and wiped when it starts, so an interrupted import fails rather than retrying. Only public addresses are accepted (400 source_not_public) and TLS is required (400 tls_required). Scheduled jobs are created paused — activate them at cut-over. A changed source answers 409 plan_changed with the new plan; a refused plan 422 import_refused; a missing acknowledgement 422 transfer_not_acknowledged. Self-serve imports go up to 100 GiB.

Endpoint

Schema & stats

GET/v1/databases/{id}/tables
Read-only views of the schema, run as the database's own role. ?schemas= takes up to 10 comma-separated schemas (default public; system schemas are refused).
GET …/tableslist

Tables and views with columns, primary key, foreign keys, row-level-security state and a row estimate.

GET …/extensionslist

Available and installed extensions with versions.

GET …/types/typescripttypes

{types: "…"} — the supabase-js Database type, as supabase gen types typescript would emit it.

GET …/stats?days=14free

Size, active time and transactions per UTC day, newest first (days 1–35). Works on an empty balance.

GET /v1/databases/allowanceplans

On a plan, the month's usage against what the plan includes, per dimension, with warnings from 80%. {enabled: false} on prepaid credit.

cURL
curl "https://cloudsitus.com/api/v1/databases/us_k3v9q0x7m2a4b8c1/types/typescript?schemas=public" \
  -H "Authorization: Bearer cs_live_…" | jq -r .types > database.types.ts

Reference

Limits

Per database, on the database URL (your application's traffic).
Requestsrate

200 requests per second, bursts to 400, then 429.

REST/rest/v1

Bodies up to 10 MB, up to 1,000 rows per response.

Storage/storage/v1

Files up to 50 MiB by default; 8 concurrent uploads per database.

Scheduled jobs/cron/v1

Up to 100 jobs, intervals of 10 seconds or more, HTTPS calls to public addresses only.

Statementsrunaway guard

A statement is stopped after 330 seconds, a transaction after 600.

Reference

Errors

Same envelope as the rest of the API: { "error": { "code", "message", … } }. The message is for people; branch on code.
503databases_unavailable

The product is not enabled for this account yet.

404database_not_found

No such database on this account (another account's id answers the same way).

409database_pending_deletion

Deleted and waiting out its 7 days; restore it first. purge_after in the error.

423database_suspended

Resume it first.

402account_locked / payment_required

An unpaid balance or no credit. Reads, exports and deletes keep working while locked.

403insufficient_key_scope

A dashboard-session key tried a restricted operation.

503databases_busy

The region's cell is busy; retry with back-off.

502upstream_error

The cell failed; the request id (x-request-id) is what support needs.