deploy.previews.list

List an app's preview settings and open previews, with what they cost

GET /deploy/api/apps/{id}/previewsIAM deploy:DescribeAppRead

Request syntax

GET /deploy/api/apps/{id}/previews

Path parameters

  • idRequired

    string

    Constraints: uuid

Response

200 with `data`: settings (null when not set up), the repository, the open previews (URL, branch, pull request, status, machine, €/h, cost so far, idle deletion time, newest deployment, database branch) and their totals. 409 for a preview itself.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • settingsAlways

    object, may be null

    null: previews are not set up
  • settings.​enabledAlways

    boolean

    Whether pull requests (or branches) get preview environments
  • settings.​triggerWhen present

    one of pull_request, branch

    pull_request: a preview per open pull request into the app’s branch; branch: one per pushed branch
  • settings.​envOverridesWhen present

    map

    Plain variables set in every preview on top of the app’s (a key here wins)
  • settings.​sharedSecretKeysWhen present

    array of string

    Secret-bound variables of the app that previews get too; every other secret is withheld (plain values are copied)
  • settings.​databaseBranchWhen present

    boolean

    Give each preview a Postgres branch of the app’s bound database; off: previews get no database binding
  • settings.​idleDaysWhen present

    number

    Delete a preview this many days after the last push to its branch, unless kept
  • settings.​maxPreviewsWhen present

    number

    At most this many previews at once; the next one is refused with a commit status
  • settings.​instanceTypeWhen present

    string, may be null

    Machine type of a preview; null: the smallest the region offers
  • repositoryAlways

    object, may be null

    The repository the app builds from; previews need one
  • repository.​idAlways

    string

    The repository
  • repository.​nameAlways

    string

    Its name
  • previewsAlways

    array of object

    Open previews, oldest first
  • previews[].​idAlways

    string

    The preview’s own app id
  • previews[].​nameAlways

    string

    Its name: the app’s, with the pull request or branch
  • previews[].​branchAlways

    string

    The branch it deploys
  • previews[].​prNumberAlways

    number, may be null

    Its pull request; null for a branch preview
  • previews[].​urlAlways

    string

    Where it answers
  • previews[].​statusAlways

    string

    The app status: created, deploying, active, failed, deleting
  • previews[].​instanceTypeAlways

    string

    Its machine type
  • previews[].​eurPerHourAlways

    number, may be null

    What its machine costs per hour, net
  • previews[].​costSoFarAlways

    number, may be null

    Started hours since it was created × the hourly price
  • previews[].​createdAtAlways

    string

    When it was created
  • previews[].​lastPushAtAlways

    string, may be null

    The last push to its branch
  • previews[].​keepAlways

    boolean

    Kept: never deleted for being idle
  • previews[].​idleDeleteAtAlways

    string, may be null

    When it is deleted if nobody pushes before; null when kept or previews are off
  • previews[].​lastDeploymentAlways

    object, may be null

    Its newest deployment
  • previews[].​lastDeployment.​idAlways

    string

    The deployment
  • previews[].​lastDeployment.​statusAlways

    string

    Its status
  • previews[].​lastDeployment.​commitAlways

    string, may be null

    The commit it deploys
  • previews[].​databaseAlways

    string, may be null

    The database branch it is bound to, in words; null: none
  • totalsAlways

    object

    What the open previews cost
  • totals.​eurPerHourAlways

    number

    All open previews, per hour
  • totals.​costSoFarAlways

    number

    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:DescribeApp 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 list id

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_deploy_previews_list.