# Postgres

Create a branchable Postgres 19 database for development and previews, connect from a VM or your laptop, and schedule backups.

Source: https://slashinfra.com/docs/platform/postgres
Last modified: 2026-11-30T16:36:19.000Z

Postgres is in Alpha. It is a branchable Postgres 19 database for development and preview work, not production; each branch is a VM of its own that costs like one and sleeps when nobody uses it.

Figure: A branch is a copy of main you can change without touching main; a branch nobody uses sleeps.

## Create a database

Create makes the database and its `main` branch. `size` is the base memory of every branch, from 512 to 16384 MiB in steps of 512, and 512 when omitted. The create answer carries the password and URL once, so save them then. A plan that does not allow public ports cannot create a database.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases). 
- Select Create database. 
- Enter `app` in Name. 
- Enter `512` in Size (MiB). 
- Select Create database. The `app is ready` dialog shows the connection; copy it before you select Done.

### CLI

```bash
si org db create app --size 512
```

Output

```text
id:          6f1c0f0e8a
name:        app
branches:    main
user:        user
url:         postgresql://user:...@db-app.default.internal:5432/postgres
wss:         wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432
internal:    db-app.default.internal:5432
forward:     si port forward 6f1c0f0e8a 5432
rpo:         last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/databases" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"app","size":512}'
```

Output

```text
{"id":"6f1c0f0e8a","name":"app","project":"proj_6f1c0f0e8a","branches":["main"],"connection":{"wss":"wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432","internal":"db-app.default.internal:5432","url":"postgresql://user:...@db-app.default.internal:5432/postgres","forward":"si port forward 6f1c0f0e8a 5432","user":"user","password":"..."},"rpo":"last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only"}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/databases",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"name": "app", "size": 512},
)
res.raise_for_status()
database = res.json()
print(database["id"], database["connection"]["internal"])
```

Output

```text
6f1c0f0e8a db-app.default.internal:5432
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'app', size: 512 }),
})
if (!res.ok) throw new Error(await res.text())
const database = (await res.json()) as { id: string; connection: { internal: string } }
console.log(database.id, database.connection.internal)
```

Output

```text
6f1c0f0e8a db-app.default.internal:5432
```

A database belongs to the project in its `project` field, `default` when omitted. Its name is unique in that project; a duplicate answers 409 `name_taken`.

## Connect to a database

The create answer carries the password and URL once. The password is also stored as the project secret `db:app:main`, and a branch gets `db:app:preview` with the password it copied. The API’s get and list never return the password or the URL. The secrets API refuses to change or delete a `db:` secret; it goes with the database.

| Field | What it is |
| --- | --- |   
| `url` | `postgresql://user:<password>@db-app.default.internal:5432/postgres`, with the password percent-encoded | 
| `internal` | `db-app.default.internal:5432`, the private name inside the project | 
| `forward` | `si port forward 6f1c0f0e8a 5432`, the command that opens a local TCP port | 
| `wss` | `wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432`, the public wsproxy endpoint | 
| `user` | `user`, the one Postgres role in every branch | 
| `password` | 32 random bytes, base64url, answered once |

Port 6543 is the wsproxy. It relays to Postgres on `127.0.0.1:5432` inside the VM. The endpoint is public because Postgres authenticates with SCRAM. A WebSocket driver such as `@neondatabase/serverless` uses it; `psql` speaks TCP, so it uses a forward or the private name.

From a VM of the same project, connect to `db-app.default.internal:5432` with the same role and password. No key and no open port are needed.

From your laptop, open a forward and leave it running:

```bash
si port forward 6f1c0f0e8a 5432
```

Output

```text
127.0.0.1:5432 -> SVM 6f1c0f0e8a:5432
Ctrl-C closes every forward
```

In a second terminal, connect with your password:

```bash
psql 'postgresql://user:YOUR_PASSWORD@127.0.0.1:5432/postgres' -c 'select 1'
```

Output

```text
?column?
----------
1
(1 row)
```

## List databases

List returns every database of one project, newest first, with its branches, its connection without the password and its RPO. A project with none gets `[]`.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases). The table lists Name, Branches, Private name and Recovery point.

### CLI

```bash
si org db ls
```

Output

```text
name  id          branches  user  internal
app   6f1c0f0e8a  main      user  db-app.default.internal:5432
```

### curl

```bash
curl -sS "https://api.slashinfra.com/databases" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
[{"id":"6f1c0f0e8a","name":"app","project":"proj_6f1c0f0e8a","branches":["main"],"connection":{"wss":"wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432","internal":"db-app.default.internal:5432","forward":"si port forward 6f1c0f0e8a 5432","user":"user"},"rpo":"last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only"}]
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/databases",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
for database in res.json():
print(database["name"], ",".join(database["branches"]))
```

Output

```text
app main
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const databases = (await res.json()) as { name: string; branches: string[] }[]
for (const database of databases) console.log(database.name, database.branches.join(','))
```

Output

```text
app main
```

## Get a database

Get returns one database by name, with its branches and its connection without the password. An unknown name answers 404 `database_not_found`.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases). 
- Select `app` in the table. Its Connection, Branches and Backups sections are on the same page.

### CLI

```bash
si org db get app
```

Output

```text
id:          6f1c0f0e8a
name:        app
branches:    main
user:        user
wss:         wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432
internal:    db-app.default.internal:5432
forward:     si port forward 6f1c0f0e8a 5432
rpo:         last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only
```

### curl

```bash
curl -sS "https://api.slashinfra.com/databases/app" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
{"id":"6f1c0f0e8a","name":"app","project":"proj_6f1c0f0e8a","branches":["main"],"connection":{"wss":"wss://6543-6f1c0f0e8a.slashinfra.dev/v1?address=127.0.0.1:5432","internal":"db-app.default.internal:5432","forward":"si port forward 6f1c0f0e8a 5432","user":"user"},"rpo":"last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only"}
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/databases/app",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
database = res.json()
print(database["name"], len(database["branches"]))
```

Output

```text
app 1
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases/app', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const database = (await res.json()) as { name: string; branches: string[] }
console.log(database.name, database.branches.length)
```

Output

```text
app 1
```

## Create a branch

A branch forks the disk of `main` or another branch and gets its own VM, CPU, memory and storage meter. Every branch uses the database size: each 512 MiB step gives 0.25 CPU, so a 512 MiB branch has 0.25 CPU and a 0.5 CPU ceiling. A branch counts as a VM against the plan’s 5 or 50 VMs. CPU and memory count while it runs, and storage counts while it sleeps. Its sleep mode is `auto`: a branch nobody uses sleeps like a VM, its open connections end, and the next connection wakes it.

The branch copies the parent’s password into `db:app:preview`, so its URL works with the same password until you rotate it. The create answer carries that URL and password once. To start from a backup instead of a branch, send `snapshot` with the backup’s id or name; it wins over `from`. The snapshot must be a `backup` of this database, or the request answers 404 `snapshot_not_found`, or 409 `not_a_backup` for another kind.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases) and select `app`. 
- In Branches, select Create branch. 
- Enter `preview` in Branch name. 
- Choose `main` in From. 
- Select Create branch. The `preview is ready` dialog shows its connection; copy it before you select Done.

### CLI

```bash
si org db branch app preview --from main
```

Output

```text
id:          6f1c0f0e8b
name:        preview
database:    app
branches:    main,preview
user:        user
url:         postgresql://user:...@db-app-preview.default.internal:5432/postgres
wss:         wss://6543-6f1c0f0e8b.slashinfra.dev/v1?address=127.0.0.1:5432
internal:    db-app-preview.default.internal:5432
forward:     si port forward 6f1c0f0e8b 5432
rpo:         last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/databases/app/branches" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"preview","from":"main"}'
```

Output

```text
{"id":"6f1c0f0e8b","name":"preview","database":"app","project":"proj_6f1c0f0e8a","branches":["main","preview"],"connection":{"wss":"wss://6543-6f1c0f0e8b.slashinfra.dev/v1?address=127.0.0.1:5432","internal":"db-app-preview.default.internal:5432","url":"postgresql://user:...@db-app-preview.default.internal:5432/postgres","forward":"si port forward 6f1c0f0e8b 5432","user":"user","password":"..."},"rpo":"last checkpoint (≤ 60 s or 512 MiB of writes); dev/preview only"}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/databases/app/branches",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"name": "preview", "from": "main"},
)
res.raise_for_status()
branch = res.json()
print(branch["id"], branch["connection"]["internal"])
```

Output

```text
6f1c0f0e8b db-app-preview.default.internal:5432
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases/app/branches', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'preview', from: 'main' }),
})
if (!res.ok) throw new Error(await res.text())
const branch = (await res.json()) as { id: string; connection: { internal: string } }
console.log(branch.id, branch.connection.internal)
```

Output

```text
6f1c0f0e8b db-app-preview.default.internal:5432
```

## Rotate a branch password

Rotate generates a new 32-byte password, changes the Postgres role with `ALTER ROLE`, and replaces the secret `db:app:preview`. The answer carries the new URL and password once. An old connection stops working at the next authentication. `si org db password app` rotates `main` when you omit the branch.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases) and select `app`. 
- In Branches, select Reset password on the `preview` row. 
- Select Reset password in the dialog. The `New password for preview` dialog shows the new connection; copy it before you select Done.

### CLI

```bash
si org db password app preview
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/databases/app/branches/preview/password" \
-H "Authorization: Bearer $SI_API_KEY"
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/databases/app/branches/preview/password",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
print(res.json()["connection"]["internal"])
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases/app/branches/preview/password', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const answer = (await res.json()) as { connection: { internal: string } }
console.log(answer.connection.internal)
```

## Schedule backups

Schedule creates the one `snapshot` schedule of the main branch. Every fire runs `CHECKPOINT`, captures the disk as a `backup` snapshot named `backup-YYYYMMDDTHHMMSSZ`, and keeps the newest `keep`. The cron runs in UTC. A second schedule answers 409 `name_taken`.

The RPO of a restore is the last checkpoint, at most 60 seconds or 512 MiB of writes behind. There is no point-in-time recovery and no WAL archive. A backup is a disk snapshot, and a schedule that has not fired yet lists no backups.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases) and select `app`. 
- In Backups, select Schedule backups. 
- Enter `0 3 * * *` in Cron. 
- Enter `7` in Keep. 
- Select Schedule backups. The dashboard says `Backup scheduled`; the first snapshot appears after the first fire.

### CLI

```bash
si org db backup app --cron '0 3 * * *' --keep 7
```

Output

```text
backup
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/databases/app/backups" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"cron":"0 3 * * *","keep":7}'
```

Output

```text
{"id":"01JCK3AAAAAAAAAAAAAAAAAAAA","project":"proj_6f1c0f0e8a","name":"backup","cron":"0 3 * * *","timezone":"UTC","action":{"type":"snapshot","keep":7,"before":"..."},"concurrency":"skip","enabled":true,"next_at":1796007600000,"created_ms":1795961221924}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/databases/app/backups",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"cron": "0 3 * * *", "keep": 7},
)
res.raise_for_status()
schedule = res.json()
print(schedule["name"], schedule["cron"], schedule["action"]["keep"])
```

Output

```text
backup 0 3 * * * 7
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases/app/backups', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ cron: '0 3 * * *', keep: 7 }),
})
if (!res.ok) throw new Error(await res.text())
const schedule = (await res.json()) as { name: string; cron: string; action: { keep: number } }
console.log(schedule.name, schedule.cron, schedule.action.keep)
```

Output

```text
backup 0 3 * * * 7
```

## List backups

List returns every `backup` snapshot of every branch, newest first, with its state and sizes. A backup’s name is `backup-YYYYMMDDTHHMMSSZ` in UTC. `state` is `creating` while the capture runs, then `ready` or `failed`. `stored_bytes` is the compressed size of the capture, and the dashboard’s Size is that value. A database with no backup gets `[]`.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases) and select `app`. The Backups section lists Name, Created, Size and State; before the first fire it says `No backups yet`.

### CLI

```bash
si org db backup app
```

Output

```text
no backups; run si org db backup app --cron '0 3 * * *' --keep 7
```

### curl

```bash
curl -sS "https://api.slashinfra.com/databases/app/backups" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
[]
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/databases/app/backups",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
print(len(res.json()))
```

Output

```text
0
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases/app/backups', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
console.log(((await res.json()) as unknown[]).length)
```

Output

```text
0
```

## Delete a branch

Delete removes the branch VM and its `db:app:preview` secret. `main` is the database itself: it answers 409 `main_branch`, and [`DELETE /databases/app`](https://slashinfra.com/docs/api-reference/control/databases#deleteDatabasesByName) deletes the database. The database, `main` and the other branches stay. The CLI has no command to delete a branch; use the dashboard or the API.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases) and select `app`. 
- In Branches, select Delete branch on the `preview` row. 
- Select Delete branch in the dialog. The dashboard says `Branch preview deleted`.

### curl

```bash
curl -sS -i -X DELETE "https://api.slashinfra.com/databases/app/branches/preview" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
HTTP/2 204
...
```

### Python

```python
import os, requests

res = requests.delete(
"https://api.slashinfra.com/databases/app/branches/preview",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
print(res.status_code)
```

Output

```text
204
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases/app/branches/preview', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
console.log(res.status)
```

Output

```text
204
```

## Delete a database

Delete removes every branch VM, every `backup` snapshot and every `db:app:*` secret, and writes a `database.delete` audit row. It cannot be undone. The answer is `204` when the VMs are deleting, not when they are gone.

### Dashboard

- Open [Databases](https://app.slashinfra.com/databases) and select `app`. 
- Select Delete database. 
- Select Delete database in the dialog. The dashboard returns to the list.

### CLI

```bash
si org db rm app
```

Output

```text
deleted database app
```

### curl

```bash
curl -sS -i -X DELETE "https://api.slashinfra.com/databases/app" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
HTTP/2 204
...
```

### Python

```python
import os, requests

res = requests.delete(
"https://api.slashinfra.com/databases/app",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
print(res.status_code)
```

Output

```text
204
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/databases/app', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
console.log(res.status)
```

Output

```text
204
```

## Options

| Field | Type | Default | Allowed values | What it changes |
| --- | --- | --- | --- | --- |   
| `name` (create) | string | Required | `db-<name>` has 1 to 32 lowercase letters, digits and hyphens, starting with a letter; unique in the project | The database name and its `main` VM name, `db-<name>`. | 
| `project` (`--project`) | string | `default` | A project name, or its `proj_` id | The project that holds the database. A body field on create, a query parameter on every other operation. | 
| `size` (`--size`) | integer | 512 | 512 to 16384, in steps of 512 | The base memory of every branch, and its CPU: each 512 MiB gives 0.25 CPU. The size cannot change. | 
| `name` (branch create) | string | Required | `db-<database>-<branch>` has 1 to 32 lowercase letters, digits and hyphens, starting with a letter; unique in the database; not `main` | The branch name and its VM name. | 
| `from` (`--from`) | string | `main` | A branch of this database | The branch to fork. Ignored when `snapshot` is set. | 
| `snapshot` (`--snapshot`) | string | None | A `backup` snapshot of this database, by id or name | The disk to start the branch from. It wins over `from`. | 
| `cron` (`--cron`) | string | Required for a schedule | Five fields: minute, hour, day, month, weekday, with the next two fires at least the plan minimum apart | When the backup runs, in UTC. | 
| `keep` (`--keep`) | integer | Required for a schedule | 1 to 100 | How many `backup` snapshots the schedule keeps; the oldest goes when a new one is made. | 
| `ref` (path) | string | Required | A database name, unique in the `project` query | The database that get, delete, branch, backups and password act on. | 
| `branch` (path, `[BRANCH]`) | string | Required in the path; `main` in the CLI | `main`, or a branch name of the database | The branch that delete and password act on. |

## Errors

| Code | When | Fix |
| --- | --- | --- |   
| [`invalid_name`](https://slashinfra.com/docs/reference/errors#invalid_name) | Create or branch create sends a name that breaks the rule in Options. | Fit `db-<name>` or `db-<database>-<branch>` to 1 to 32 lowercase letters, digits and hyphens, starting with a letter. | 
| [`invalid_size`](https://slashinfra.com/docs/reference/errors#invalid_size) | Create sends a size outside 512 to 16384, or not a step of 512. | Send a whole number from 512 to 16384 in steps of 512. | 
| [`size_unavailable`](https://slashinfra.com/docs/reference/errors#size_unavailable) | No node offers the requested memory. | Choose a smaller size. | 
| [`name_taken`](https://slashinfra.com/docs/reference/errors#name_taken) | Create, branch create or schedule uses a name that is already used. | Choose another name; a database has one `backup` schedule. | 
| [`database_create_failed`](https://slashinfra.com/docs/reference/errors#database_create_failed) | The VM or its `initdb` failed; nothing was kept. | Try again. | 
| [`database_init_failed`](https://slashinfra.com/docs/reference/errors#database_init_failed) | The database did not start; nothing was kept. | Try again. | 
| [`no_capacity`](https://slashinfra.com/docs/reference/errors#no_capacity) | No node has free capacity for the VM. | Wait for `Retry-After` and retry. | 
| [`public_ports_not_allowed`](https://slashinfra.com/docs/reference/errors#public_ports_not_allowed) | The plan refuses public ports, and a database opens its wsproxy port 6543 public. | Use a plan with public ports. | 
| [`database_not_found`](https://slashinfra.com/docs/reference/errors#database_not_found) | Get, delete, branch, backups or password names no database of the project. | Check the name and the project. | 
| [`branch_not_found`](https://slashinfra.com/docs/reference/errors#branch_not_found) | Branch create’s `from`, delete or password names no branch of the database. | Check the branch name. | 
| [`snapshot_not_found`](https://slashinfra.com/docs/reference/errors#snapshot_not_found) | Branch create’s `snapshot` names no snapshot of the project, or one of another database. | Check the snapshot name or id and the database. | 
| [`not_a_backup`](https://slashinfra.com/docs/reference/errors#not_a_backup) | `snapshot` names a snapshot that is not a `backup`. | Choose a `backup` snapshot. | 
| [`password_missing`](https://slashinfra.com/docs/reference/errors#password_missing) | The branch has no stored password secret. | Reset the password, or create the branch again. | 
| [`database_unavailable`](https://slashinfra.com/docs/reference/errors#database_unavailable) | The password change cannot reach the database; it is starting or not reachable. | Try again in a moment. | 
| [`main_branch`](https://slashinfra.com/docs/reference/errors#main_branch) | Delete branch names `main`. | Delete the database instead. | 
| [`invalid_cron`](https://slashinfra.com/docs/reference/errors#invalid_cron) | The cron is not five fields. | Send minute, hour, day, month and weekday. | 
| [`schedule_too_frequent`](https://slashinfra.com/docs/reference/errors#schedule_too_frequent) | Two fires are closer together than the plan allows. | Use a longer interval. | 
| [`invalid_keep`](https://slashinfra.com/docs/reference/errors#invalid_keep) | `keep` is outside 1 to 100. | Send a whole number from 1 to 100. | 
| [`project_not_found`](https://slashinfra.com/docs/reference/errors#project_not_found) | The project query or create body names no project of the organization, or one outside the key’s scope. | Check the name or id, and the key’s project scope. |

Errors that any request can return are in the [error catalog](https://slashinfra.com/docs/reference/errors).

## Permissions

| Operation | Who can | Key action |
| --- | --- | --- |   
| Create a database | Any member | `database:write` | 
| List databases | Any member | `database:read` | 
| Get a database | Any member | `database:read` | 
| Create a branch | Any member | `database:write` | 
| Rotate a branch password | Any member | `database:write` | 
| Schedule backups | Any member | `database:write` | 
| List backups | Any member | `database:read` | 
| Delete a branch | Any member | `database:delete` | 
| Delete a database | Any member | `database:delete` |

## Limits

- A database name must make `db-<name>` a valid VM name: 1 to 32 lowercase letters, digits and hyphens, starting with a letter. A branch name must make `db-<database>-<branch>` fit the same rule, so a long database name leaves fewer characters for the branch. 
- The size is 512 to 16384 MiB in steps of 512, and 512 is the default. Every branch uses the database size, and the size cannot change after create. 
- Each branch has a 50 GiB sparse disk, like a VM; empty space does not count as stored data, and a full disk answers `507`. 
- Each 512 MiB step gives 0.25 CPU of base CPU. A 512 MiB branch has 0.25 CPU and a 0.5 CPU ceiling; a 16384 MiB branch has 8 CPU and a 16 CPU ceiling. 
- A branch counts as a VM against the plan: Standard allows 5 VMs and Pro 50, branches included. A create beyond the limit fails and keeps nothing. 
- A database has one `backup` schedule. `keep` is 1 to 100 `backup` snapshots, and they do not count against the plan’s 50 or 200 snapshot limit. 
- The RPO is the last checkpoint, at most 60 seconds or 512 MiB of writes behind. There is no point-in-time recovery and no WAL archive. 
- A backup is a disk snapshot of one branch. The database cannot serve logical replication, because its `wal_level` is `minimal`. 
- The Postgres image has no SSH server, no desktop, no outbound network and a minimal shell. 
- A plan without public ports cannot create a database.

The full list is in [Limits](https://slashinfra.com/docs/reference/limits).

## Next

- [Private network](https://slashinfra.com/docs/platform/private-network): reach the database from your VMs by its `.internal` name. 
- [Snapshots and forks](https://slashinfra.com/docs/platform/snapshots): what a `backup` snapshot is and how retention deletes it. 
- [Control API databases](https://slashinfra.com/docs/api-reference/control/databases): every operation, field and status code.
