deploy.host-database-branches.createCut a branch: a full copy of the database, on the same pool host
The pool host copies the database (pg_dump and pg_restore into a new database with its own role) while the app keeps running: the copy holds the data as of its start. It takes seconds for a small database and longer for a big one; state goes creating, then ready or failed. A branch is not billed, has the database’s size limit, and is deleted after expiresInHours. At most 2 branches per app; the pool host refuses one it has no disk for.
Request syntax
POST /deploy/api/apps/{id}/host-database/branches
{
"expiresInHours": "number"
}Path parameters
idRequiredstring
Constraints: uuid
Request body
expiresInHoursOptionalnumber
Hours until the branch is deleted, 1 to 168 (7 days); 24 when not given
Constraints: integer, 1-168
Response
202 with `data`: the branch as get describes it, state creating. 400 for an app not on pooled hosting; 404 when the app has no active pool-host database; 409 when the app already has 2 branches, its database is being restored, or its pool host is not ready.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Fields of data
idAlwaysstring
Branch idappIdAlwaysstring
The app whose database it copiesnameAlwaysstring
Its database (and role) name on the pool hostparentNameAlwaysstring
The database it was copied fromstateAlwaysone of creating, ready, failed, deleting, deleted
creating, then ready or failed; deleting, then deletederrorAlwaysstring, may be null
Why the copy failedbytesAlwaysnumber, may be null
Its size as the pool host last reported itexpiresAtAlwaysstring
When it is deleted (ISO 8601)createdAtAlwaysstring
When it was cutreadyAtAlwaysstring, may be null
When the copy was donedeletedAtAlwaysstring, may be null
When it was deletedmigrationAlwaysobject, may be null
The last migrate run on the branch; null before the firstmigration.stateAlwaysone of running, done, failed
running until the pool host answers; done: exit code 0; failed otherwisemigration.deploymentIdAlwaysstring, may be null
The deployment whose migrate command ranmigration.requestedAtAlwaysstring, may be null
When it was asked formigration.exitCodeAlwaysnumber, may be null
Its exit code; -1 when stopped after 10 minutes; null when it could not runmigration.summaryAlwaysstring, may be null
What it did, in one line: "2 columns added, the 42 existing rows stay"migration.diffAlwaysobject, may be null
The shape before and after, compared; null when it could not runmigration.diff.summaryAlwaysstring
The same linemigration.diff.tablesAddedAlwaysarray of string
schema.tablemigration.diff.tablesDroppedAlwaysarray of string
schema.tablemigration.diff.columnsAddedAlwaysarray of string
schema.table.column and its typemigration.diff.columnsDroppedAlwaysarray of string
schema.table.columnmigration.diff.columnsChangedAlwaysarray of string
schema.table.column: before → aftermigration.diff.indexesAddedAlwaysarray of string
Index definitionsmigration.diff.indexesDroppedAlwaysarray of string
Index definitionsmigration.diff.constraintsAddedAlwaysarray of string
table: name and definitionmigration.diff.constraintsDroppedAlwaysarray of string
table: name and definitionmigration.diff.rowsChangedAlwaysarray of string
table: rows before → aftermigration.diff.rowsBeforeAlwaysnumber
Rows in the tables that stayed, beforemigration.diff.rowsAfterAlwaysnumber
Rows in those tables, aftermigration.logTailAlwaysstring, may be null
The last 64 KiB of its outputmigration.errorAlwaysstring, may be null
Why it could not runmigration.finishedAtAlwaysstring, may be null
When the pool host answered
Checked against the handlers: every route test validates their answers against this schema.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow deploy:ManageHostDatabase on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud deploy host-database-branches create idcurl -X POST "https://console.platform.deutschecloud.app/deploy/api/apps/id/host-database/branches" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{}'import { DcloudClient } from '@dcloud/sdk';
const client = new DcloudClient();
const result = await client.deploy.hostDatabaseBranches.create({ id: "id" });from dcloud import Client
client = Client()
result = client.deploy.host_database_branches.create(id="id")Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_deploy_host-database-branches_create.