deploy.previews.keepKeep a preview (never delete it for being idle), or let it go idle again
Request syntax
PATCH /deploy/api/apps/{id}/previews/{previewId}
{
"keep": "boolean"
}Path parameters
idRequiredstring
Constraints: uuid
previewIdRequiredstring
Constraints: uuid
Request body
keepRequiredboolean
true: never delete for being idle
Response
200 with `data` as list. 404 when previewId is not a preview of the app.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Fields of data
settingsAlwaysobject, may be null
null: previews are not set upsettings.enabledAlwaysboolean
Whether pull requests (or branches) get preview environmentssettings.triggerWhen presentone of pull_request, branch
pull_request: a preview per open pull request into the app’s branch; branch: one per pushed branchsettings.envOverridesWhen presentmap
Plain variables set in every preview on top of the app’s (a key here wins)settings.sharedSecretKeysWhen presentarray of string
Secret-bound variables of the app that previews get too; every other secret is withheld (plain values are copied)settings.databaseBranchWhen presentboolean
Give each preview a Postgres branch of the app’s bound database; off: previews get no database bindingsettings.idleDaysWhen presentnumber
Delete a preview this many days after the last push to its branch, unless keptsettings.maxPreviewsWhen presentnumber
At most this many previews at once; the next one is refused with a commit statussettings.instanceTypeWhen presentstring, may be null
Machine type of a preview; null: the smallest the region offersrepositoryAlwaysobject, may be null
The repository the app builds from; previews need onerepository.idAlwaysstring
The repositoryrepository.nameAlwaysstring
Its namepreviewsAlwaysarray of object
Open previews, oldest firstpreviews[].idAlwaysstring
The preview’s own app idpreviews[].nameAlwaysstring
Its name: the app’s, with the pull request or branchpreviews[].branchAlwaysstring
The branch it deployspreviews[].prNumberAlwaysnumber, may be null
Its pull request; null for a branch previewpreviews[].urlAlwaysstring
Where it answerspreviews[].statusAlwaysstring
The app status: created, deploying, active, failed, deletingpreviews[].instanceTypeAlwaysstring
Its machine typepreviews[].eurPerHourAlwaysnumber, may be null
What its machine costs per hour, netpreviews[].costSoFarAlwaysnumber, may be null
Started hours since it was created × the hourly pricepreviews[].createdAtAlwaysstring
When it was createdpreviews[].lastPushAtAlwaysstring, may be null
The last push to its branchpreviews[].keepAlwaysboolean
Kept: never deleted for being idlepreviews[].idleDeleteAtAlwaysstring, may be null
When it is deleted if nobody pushes before; null when kept or previews are offpreviews[].lastDeploymentAlwaysobject, may be null
Its newest deploymentpreviews[].lastDeployment.idAlwaysstring
The deploymentpreviews[].lastDeployment.statusAlwaysstring
Its statuspreviews[].lastDeployment.commitAlwaysstring, may be null
The commit it deployspreviews[].databaseAlwaysstring, may be null
The database branch it is bound to, in words; null: nonetotalsAlwaysobject
What the open previews costtotals.eurPerHourAlwaysnumber
All open previews, per hourtotals.costSoFarAlwaysnumber
All open previews, since each was created
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:UpdatePreviewSettings 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 previews keep id previewId --keepcurl -X PATCH "https://console.platform.deutschecloud.app/deploy/api/apps/id/previews/previewId" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"keep":true}'import { DcloudClient } from '@dcloud/sdk';
const client = new DcloudClient();
const result = await client.deploy.previews.keep({ id: "id", previewId: "previewId", keep: true });from dcloud import Client
client = Client()
result = client.deploy.previews.keep(id="id", preview_id="previewId", keep=True)Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_deploy_previews_keep.