ReferenceAPI

Branch a database

Branch a ready or sleeping database into a new database with its current data.

POST https://api.nevia.cloud/v1/databases/{db}/branch
curl -X POST "https://api.nevia.cloud/v1/databases/01d4cnjkgq02b6tfqvy8yh391pq/branch" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "orders-staging"
  }'
{
  "database": {
    "id": "01d4cnjkgq02b6tfqvy8yh391pq",
    "workspace": "01d4cnjjq40hnnh0nwmkg35nv2h",
    "name": "api-staging",
    "state": "ready",
    "pending": null,
    "engine": "postgres",
    "version": "18.6",
    "host": "01d4cnjkgq02b6tfqvy8yh391pq.live.nevia.cloud",
    "port": 5432,
    "parent": null,
    "from_checkpoint": "01d4cnjkwhftngfp8vkmp723mhv",
    "generation": 1,
    "protected": false,
    "error": null,
    "created_at": "2026-09-10T12:34:56Z",
    "deleted_at": "2026-09-10T12:34:56Z"
  },
  "operations": [
    "01d4cnjm89yk0r3xtv80dy0x7by"
  ]
}

Authorization

bearerAuth
Authorization Bearer <token>

Send the token in the Authorization: Bearer <token> header. See Authenticate.

In: header

Path Parameters

db* string

Database id: 27 lowercase letters and digits.

Match ^[A-Za-z0-9_-]{1,64}$

Header Parameters

Idempotency-Key? string

Optional retry key, kept 24 hours

Length 1 <= length <= 255

Request Body

application/json

Copy of this database's current data, with its own password

Behavior

The response carries a database.branch operation, finished in a 200 and running in a 202. Read the new database's credentials with GET /v1/databases/{db}/connection, using the branch's id. For a 202, read them once the database is ready.

Response

application/json

The new database, ready or failed, when the branch finished during the request.