Databases
Branchable Postgres databases: create, branch, rotate a password and schedule backups
Resource, request and plan limits are listed on Limits.
Download OpenAPI specification · Version 0.1.0
List databases
Returns every database of one project with its branches, its connection without the password and the RPO. A branch is a machine of its own: the branch names come from its si.branch label, of the machines with si.db=<name>.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Query Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Response Body
Every database of the project, newest first; a project with none gets [].
application/json- response
Every database of the project, newest first; a project with none gets [].
[index: integer]?One Postgres database of the project and its branches.
curl -X GET 'https://api.slashinfra.com/databases'[ { "branches": [ "main", "dev" ], "connection": { "forward": "si port forward 6f1c0f0e8a 5432", "internal": "db-app.default.internal:5432", "user": "user", "wss": "wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432" }, "id": "6f1c0f0e8a", "name": "app", "project": "proj_6f1c0f0e8a", "rpo": "last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only" }]Create a database
Creates a Postgres 19 database db-<name> with a public wsproxy port on 6543; its password is in the secret db:<name>:main and is answered once, with the URL. Dev and preview only; see Postgres.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Request Body
The name and optional size of the new database.
- body
The name and optional size of the new database.
name*stringThe name of the database, unique in its project: db-<name> must fit the SVM name rules (^[a-z][a-z0-9-]{0,31}$).
project?stringThe project id or name that the database belongs to; default when omitted.
size?integerThe base memory of every branch in MiB, a whole number from 512 to 16384 in steps of 512; 512 (the xs size) when absent.
Response Body
A new database, with its connection and the password that is answered once.
application/json- response
A new database, with its connection and the password that is answered once.
branches*array<string>The branches of the new database: main.
connection*The connection of a new database or branch, with the URL and password that it answers once.
id*stringThe machine id of the main branch.
name*stringThe name of the database.
project*stringThe id of the project of the database.
rpo*stringThe recovery point objective of a database; dev and preview only.
curl -X POST 'https://api.slashinfra.com/databases' \ -H 'Content-Type: application/json' \ -d '{ "name": "app"}'{ "branches": [ "main" ], "connection": { "forward": "string", "internal": "string", "password": "string", "url": "postgresql://user:s3cret@db-app.default.internal:5432/postgres", "user": "string", "wss": "string" }, "id": "6f1c0f0e8a", "name": "app", "project": "proj_6f1c0f0e8a", "rpo": "string"}Delete a database
Deletes every branch machine of the database, its backup snapshots and its db:<name>:* secrets, and writes the database.delete audit row. The delete of a machine is confirmed by its node, as for any SVM.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
name*stringThe name of the database: the si.db label of its machines, unique in the project.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Response Body
Every branch machine is deleting, and its backup snapshots and password secrets are gone; no body.
response?stringtext/plainEvery branch machine is deleting, and its backup snapshots and password secrets are gone; no body.
curl -X DELETE 'https://api.slashinfra.com/databases/app'"string"Get a database
Returns one database of the project with its branches, its connection without the password and the RPO. The password is never part of this answer.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
name*stringThe name of the database: the si.db label of its machines, unique in the project.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Response Body
One Postgres database of the project and its branches.
application/json- response
One Postgres database of the project and its branches.
branches*array<string>The branches of the database, main first; each is a machine of its own.
connection*How a client reaches the database; its URL and password are never part of it after the create answer.
id*stringThe machine id of the main branch: ten symbols of the SVM id alphabet.
name*stringThe name of the database, unique in its project.
project*stringThe id of the project of the database.
rpo*stringThe recovery point objective: the last checkpoint of the disk, at most 60 s or 512 MiB of writes behind; dev and preview only.
curl -X GET 'https://api.slashinfra.com/databases/app'{ "branches": [ "main", "dev" ], "connection": { "forward": "si port forward 6f1c0f0e8a 5432", "internal": "db-app.default.internal:5432", "user": "user", "wss": "wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432" }, "id": "6f1c0f0e8a", "name": "app", "project": "proj_6f1c0f0e8a", "rpo": "last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only"}List database backups
Returns the backup snapshots of every branch of the database, newest first, with their state and sizes. A database without a backup gets [].
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
name*stringThe name of the database: the si.db label of its machines, unique in the project.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Response Body
The backup snapshots of the database, newest first; a database without a backup gets [].
application/json- response
The backup snapshots of the database, newest first; a database without a backup gets [].
[index: integer]?One disk-only snapshot.
curl -X GET 'https://api.slashinfra.com/databases/app/backups'[ { "created_ms": 1762747200000, "error": "timeout", "expires_ms": 1765339200000, "id": "0zs0pshr3x", "kind": "user", "logical_bytes": 2147483648, "name": "build-1-20261110-031900", "project": "proj_6f1c0f0e8a", "source": "6f1c0f0e8a", "state": "ready", "stored_bytes": 536870912, "used_by": [ "string" ] }]Schedule database backups
Creates the one snapshot schedule of the main branch: every fire runs CHECKPOINT over exec, captures the disk as a backup snapshot named <schedule>-YYYYMMDDTHHMMSSZ, and keeps the newest keep backups. GET /databases/:name/backups lists them. The RPO of a restore is the last checkpoint, at most 60 s or 512 MiB of writes behind.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
name*stringThe name of the database: the si.db label of its machines, unique in the project.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Request Body
The schedule of the automatic backups of the main branch.
- body
The schedule of the automatic backups of the main branch.
cron*stringA five-field cron whose next two fires are at least the plan minimum apart.
keep*integerHow many backup snapshots of the schedule to keep, from 1 to 100.
Response Body
One schedule of an SVM.
application/json- response
One schedule of an SVM.
action*||The command, inbox message or snapshot of one fire.
concurrency*stringskip refuses a fire while the previous run still runs; allow starts both.
"skip""allow"created_ms*integerThe creation time in milliseconds since the Unix epoch.
cron*stringThe normalized five-field cron.
enabled*booleanWhether the minute tick fires it.
id*stringThe schedule id.
name*stringThe name of the schedule, unique per SVM.
next_at*integerThe next fire in milliseconds since the Unix epoch; it moves when the tick claims a run.
project*stringThe id of the project of the SVM, which the schedule inherits and never takes as a parameter.
timezone*stringThe IANA timezone of the cron.
curl -X POST 'https://api.slashinfra.com/databases/app/backups' \ -H 'Content-Type: application/json' \ -d '{ "cron": "0 3 * * *", "keep": 7}'{ "action": { "command": "make backup", "timeout_s": 600, "type": "command" }, "concurrency": "skip", "created_ms": 1767225600000, "cron": "0 3 * * *", "enabled": true, "id": "01JCK3AAAAAAAAAAAAAAAAAAAA", "name": "nightly-backup", "next_at": 1767225600000, "project": "proj_6f1c0f0e8a", "timezone": "Europe/Berlin"}Create a branch
Creates a branch machine db-<database>-<branch> forked from the from branch (main by default), or started from a backup snapshot. The answer carries the branch URL and password once; see Postgres.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
name*stringThe name of the database: the si.db label of its machines, unique in the project.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Request Body
The name of the branch and where its disk comes from.
- body
The name of the branch and where its disk comes from.
from?stringThe branch to fork, by its name; main when absent, and an unknown branch answers 404.
name*stringThe name of the branch: the machine name db-<database>-<name> must fit the SVM name rules, and main is the database itself.
snapshot?stringA backup snapshot of this database to start the branch from, by id or name; it wins over from, and a snapshot of another database answers 404.
Response Body
A new branch of a database, with its own connection and the copied password that is answered once.
application/json- response
A new branch of a database, with its own connection and the copied password that is answered once.
branches*array<string>Every branch of the database, main first.
connection*The connection of a new database or branch, with the URL and password that it answers once.
database*stringThe name of the database that the branch belongs to.
id*stringThe machine id of the new branch.
name*stringThe name of the branch.
project*stringThe id of the project of the database.
rpo*stringThe recovery point objective of a database; dev and preview only.
curl -X POST 'https://api.slashinfra.com/databases/app/branches' \ -H 'Content-Type: application/json' \ -d '{ "name": "dev"}'{ "branches": [ "string" ], "connection": { "forward": "string", "internal": "string", "password": "string", "url": "postgresql://user:s3cret@db-app.default.internal:5432/postgres", "user": "string", "wss": "string" }, "database": "app", "id": "6f1c0f0e8b", "name": "dev", "project": "proj_6f1c0f0e8a", "rpo": "string"}Delete a branch
Deletes one branch machine and its password secret. main is the database: it answers 409 main_branch, and DELETE /databases/:name deletes the database.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
name*stringThe name of the database: the si.db label of its machines, unique in the project.
1 <= lengthbranch*stringThe branch name: si.branch of its machine, main for the database itself.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Response Body
The branch machine is deleting and its password secret is gone; no body.
response?stringtext/plainThe branch machine is deleting and its password secret is gone; no body.
curl -X DELETE 'https://api.slashinfra.com/databases/app/branches/dev'"string"Rotate a branch password
Generates a new 32-byte password, changes the Postgres role with ALTER ROLE over exec, then replaces the project secret db:<database>:<branch>. The answer carries the branch connection with the new URL and password once; an old connection stops working at the next authentication.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
name*stringThe name of the database: the si.db label of its machines, unique in the project.
1 <= lengthbranch*stringThe branch name: si.branch of its machine, main for the database itself.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Response Body
The connection of the branch with its new password and URL, answered once.
application/json- response
The connection of the branch with its new password and URL, answered once.
connection*The connection of a new database or branch, with the URL and password that it answers once.
curl -X POST 'https://api.slashinfra.com/databases/app/branches/dev/password'{ "connection": { "forward": "string", "internal": "string", "password": "string", "url": "postgresql://user:s3cret@db-app.default.internal:5432/postgres", "user": "string", "wss": "string" }}curl -X GET 'https://api.slashinfra.com/databases'[
{
"branches": [
"main",
"dev"
],
"connection": {
"forward": "si port forward 6f1c0f0e8a 5432",
"internal": "db-app.default.internal:5432",
"user": "user",
"wss": "wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432"
},
"id": "6f1c0f0e8a",
"name": "app",
"project": "proj_6f1c0f0e8a",
"rpo": "last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only"
}
]curl -X POST 'https://api.slashinfra.com/databases' \
-H 'Content-Type: application/json' \
-d '{
"name": "app"
}'{
"branches": [
"main"
],
"connection": {
"forward": "string",
"internal": "string",
"password": "string",
"url": "postgresql://user:s3cret@db-app.default.internal:5432/postgres",
"user": "string",
"wss": "string"
},
"id": "6f1c0f0e8a",
"name": "app",
"project": "proj_6f1c0f0e8a",
"rpo": "string"
}curl -X DELETE 'https://api.slashinfra.com/databases/app'"string"curl -X GET 'https://api.slashinfra.com/databases/app'{
"branches": [
"main",
"dev"
],
"connection": {
"forward": "si port forward 6f1c0f0e8a 5432",
"internal": "db-app.default.internal:5432",
"user": "user",
"wss": "wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432"
},
"id": "6f1c0f0e8a",
"name": "app",
"project": "proj_6f1c0f0e8a",
"rpo": "last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only"
}curl -X GET 'https://api.slashinfra.com/databases/app/backups'[
{
"created_ms": 1762747200000,
"error": "timeout",
"expires_ms": 1765339200000,
"id": "0zs0pshr3x",
"kind": "user",
"logical_bytes": 2147483648,
"name": "build-1-20261110-031900",
"project": "proj_6f1c0f0e8a",
"source": "6f1c0f0e8a",
"state": "ready",
"stored_bytes": 536870912,
"used_by": [
"string"
]
}
]curl -X POST 'https://api.slashinfra.com/databases/app/backups' \
-H 'Content-Type: application/json' \
-d '{
"cron": "0 3 * * *",
"keep": 7
}'{
"action": {
"command": "make backup",
"timeout_s": 600,
"type": "command"
},
"concurrency": "skip",
"created_ms": 1767225600000,
"cron": "0 3 * * *",
"enabled": true,
"id": "01JCK3AAAAAAAAAAAAAAAAAAAA",
"name": "nightly-backup",
"next_at": 1767225600000,
"project": "proj_6f1c0f0e8a",
"timezone": "Europe/Berlin"
}curl -X POST 'https://api.slashinfra.com/databases/app/branches' \
-H 'Content-Type: application/json' \
-d '{
"name": "dev"
}'{
"branches": [
"string"
],
"connection": {
"forward": "string",
"internal": "string",
"password": "string",
"url": "postgresql://user:s3cret@db-app.default.internal:5432/postgres",
"user": "string",
"wss": "string"
},
"database": "app",
"id": "6f1c0f0e8b",
"name": "dev",
"project": "proj_6f1c0f0e8a",
"rpo": "string"
}curl -X DELETE 'https://api.slashinfra.com/databases/app/branches/dev'"string"curl -X POST 'https://api.slashinfra.com/databases/app/branches/dev/password'{
"connection": {
"forward": "string",
"internal": "string",
"password": "string",
"url": "postgresql://user:s3cret@db-app.default.internal:5432/postgres",
"user": "string",
"wss": "string"
}
}