> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ankra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview a promotion between two environments

> What promoting the source environment's build into the target would do (ankra-ryfuy.38.4): the build that would move, what the target serves now, the deploy options that differ and stay as they are, the secrets check, the target's manifest-revision drift verdict, and every reason the promotion would be refused, with a fix path each. state is ready, already_current, blocked, or unknown when a read behind the verdict failed - never ready on a guess. Environment ids are the ids the environments read answers with. Held to the applications.deploy permission, as the write is; secrets.missing_keys is null unless the caller also holds applications.write, the env-secrets endpoints' permission.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json get /org/applications/{application_id}/promotions/preview
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
tags:
  - name: Clusters
    description: Create, inspect and manage clusters, and the stacks deployed on them.
  - name: Managed Clusters
    description: Provider-managed control planes, driven through one common surface.
  - name: Imported Clusters
    description: Clusters that already existed and were connected to Ankra.
  - name: Cluster Access
    description: Kubeconfigs, service-account tokens and per-cluster access grants.
  - name: Kubernetes
    description: Read and act on the Kubernetes objects inside a cluster.
  - name: DigitalOcean Clusters
    description: Provision and manage DigitalOcean Kubernetes clusters.
  - name: Hetzner Clusters
    description: Provision and manage Hetzner Kubernetes clusters.
  - name: OVH Clusters
    description: Provision and manage OVH Kubernetes clusters.
  - name: Scaleway Clusters
    description: Provision and manage Scaleway Kapsule clusters.
  - name: UpCloud Clusters
    description: Provision and manage UpCloud Kubernetes clusters.
  - name: Applications
    description: Deploy, configure and observe applications across the fleet.
  - name: Stack Profiles
    description: Reusable stack definitions, their versions and sharing.
  - name: Charts
    description: Browse the chart catalogue behind stacks and addons.
  - name: Helm
    description: Helm registries, credentials and the charts they expose.
  - name: Executions
    description: Long-running platform executions and their jobs.
  - name: Operations
    description: Cancel in-flight cluster operations and their jobs.
  - name: Chat
    description: Conversational sessions, plans and confirmable actions.
  - name: AI Agent Runs
    description: Autonomous agent runs and their outcomes.
  - name: AI Tickets
    description: The AI ticket board, its sync connections and settings.
  - name: AI Playbooks
    description: Reusable playbooks the AI lanes execute.
  - name: AI Conditions
    description: Conditions that gate AI autonomy.
  - name: AI Engineering Handoffs
    description: Work the AI lanes escalate to a human engineer.
  - name: AI Environment
    description: The environment and base stacks AI demos deploy into.
  - name: Security
    description: Findings, advisories, SBOMs, compliance and posture.
  - name: Cost
    description: Cluster and fleet cost, rate cards and cost settings.
  - name: Billing
    description: Subscription and spend caps.
  - name: Organisation
    description: Members, invitations, audit logs and organisation settings.
  - name: Account Tokens
    description: Personal access tokens for the API and CLI.
  - name: Credentials
    description: The shared credential store.
  - name: Azure Credentials
    description: Azure credentials and SSH keys.
  - name: DigitalOcean Credentials
    description: DigitalOcean credentials and SSH keys.
  - name: Hetzner Credentials
    description: Hetzner credentials and SSH keys.
  - name: OVH Credentials
    description: OVH credentials and SSH keys.
  - name: Scaleway Credentials
    description: Scaleway credentials.
  - name: UpCloud Credentials
    description: UpCloud credentials and SSH keys.
  - name: Data Source Credentials
    description: Credentials for metrics and log sources.
  - name: DNS Credentials
    description: Credentials for DNS providers.
  - name: DNS
    description: DNS zones and records, including custom organisation zones.
  - name: Cloudflare
    description: Cloudflare domains and the credentials behind them.
  - name: Variables
    description: Organisation- and cluster-scoped variables.
  - name: SOPS
    description: Encrypt and decrypt values with the organisation SOPS config.
  - name: Alerts
    description: Alert integrations and ingest credentials.
  - name: Notifications
    description: Notification routes and their delivery targets.
  - name: Support
    description: Support tickets.
paths:
  /org/applications/{application_id}/promotions/preview:
    get:
      tags:
        - Applications
      summary: Preview a promotion between two environments
      description: >-
        What promoting the source environment's build into the target would do
        (ankra-ryfuy.38.4): the build that would move, what the target serves
        now, the deploy options that differ and stay as they are, the secrets
        check, the target's manifest-revision drift verdict, and every reason
        the promotion would be refused, with a fix path each. state is ready,
        already_current, blocked, or unknown when a read behind the verdict
        failed - never ready on a guess. Environment ids are the ids the
        environments read answers with. Held to the applications.deploy
        permission, as the write is; secrets.missing_keys is null unless the
        caller also holds applications.write, the env-secrets endpoints'
        permission.
      operationId: preview_application_promotion
      parameters:
        - in: path
          name: application_id
          required: true
          schema:
            type: string
            title: Application Id
        - in: query
          name: source_environment_id
          required: true
          schema:
            title: Source Environment Id
            type: string
        - in: query
          name: target_environment_id
          required: true
          schema:
            title: Target Environment Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationPromotionPreview'
          description: Successful Response
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: The caller may not deploy this application.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: Not found ("Application not found" or "Environment not found")
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: '"Source and target environments must differ."'
components:
  schemas:
    ApplicationPromotionPreview:
      description: >-
        The confirmation's data: what would move, what the target serves now,
        what differs and stays, and every reason the promotion would be refused.
        Three-valued throughout.
      properties:
        application_id:
          type: string
        read_state:
          type: string
          enum:
            - ok
            - unknown
        read_reason:
          type: string
        state:
          type: string
          enum:
            - ready
            - already_current
            - blocked
            - unknown
          description: >-
            unknown when a read behind the verdict failed (read_reason names it)
            - never ready.
        source:
          anyOf:
            - $ref: '#/components/schemas/ApplicationPromotionPreviewSource'
            - type: 'null'
        target:
          anyOf:
            - $ref: '#/components/schemas/ApplicationPromotionPreviewTarget'
            - type: 'null'
        blockers:
          items:
            $ref: '#/components/schemas/ApplicationPromotionBlocker'
          type: array
        secrets:
          anyOf:
            - $ref: '#/components/schemas/ApplicationPromotionSecrets'
            - type: 'null'
        config_differences:
          items:
            $ref: '#/components/schemas/ApplicationPromotionConfigDifference'
          type: array
      required:
        - application_id
        - read_state
        - read_reason
        - state
        - source
        - target
        - blockers
        - secrets
        - config_differences
      title: ApplicationPromotionPreview
      type: object
    DemoDetailError:
      description: >-
        The FastAPI-style detail envelope the demo routes use for
        400/403/404/409/502 responses.
      properties:
        detail:
          type: string
      required:
        - detail
      type: object
    ApplicationPromotionPreviewSource:
      description: >-
        What the source environment runs. image_tag and commit_sha are null when
        its installations disagree or carry none - never "".
      properties:
        id:
          type: string
        name:
          type: string
        role:
          type: string
        image_tag:
          anyOf:
            - type: string
            - type: 'null'
        commit_sha:
          anyOf:
            - type: string
            - type: 'null'
        status:
          type: string
          description: >-
            The least-proven installation status across the environment: healthy
            only when every installation is.
      required:
        - id
        - name
        - role
        - image_tag
        - commit_sha
        - status
      title: ApplicationPromotionPreviewSource
      type: object
    ApplicationPromotionPreviewTarget:
      description: What the target environment runs now and how it is updated.
      properties:
        id:
          type: string
        name:
          type: string
        role:
          type: string
        image_tag:
          anyOf:
            - type: string
            - type: 'null'
        commit_sha:
          anyOf:
            - type: string
            - type: 'null'
        status:
          type: string
        follows:
          type: string
          enum:
            - pushes
            - manual
            - unknown
        drift:
          type: string
          enum:
            - in_sync
            - drifted
            - not_applicable
            - unknown
          description: The manifest-revision verdict on the target's first installation.
      required:
        - id
        - name
        - role
        - image_tag
        - commit_sha
        - status
        - follows
        - drift
      title: ApplicationPromotionPreviewTarget
      type: object
    ApplicationPromotionBlocker:
      description: One reason the promotion would be refused.
      properties:
        reason:
          type: string
          enum:
            - source_not_proven
            - source_tag_unknown
            - source_not_settled
            - target_follows_pushes
            - target_follows_unknown
            - target_deploy_in_flight
            - secrets_missing
        detail:
          type: string
          description: The frozen sentence; the POST's 409 detail is this text verbatim.
        fix_path:
          type: string
          enum:
            - none
            - settings
            - secrets
            - deployments
      required:
        - reason
        - detail
        - fix_path
      title: ApplicationPromotionBlocker
      type: object
    ApplicationPromotionSecrets:
      properties:
        state:
          type: string
          enum:
            - known
            - unknown
        missing_keys:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            Required keys with no value catalogued. A claim only under state
            "known"; empty under "unknown" because nothing could be checked, not
            because nothing is missing; null when the caller may not read the
            secret catalogue (applications.write, the env-secrets endpoints'
            permission) - the blocker still says keys are missing, never which.
        target_apply_state:
          type: string
          description: >-
            applied | pending | unknown for the target's installations.
            Informative: the deploy a promotion enqueues seals the catalogue's
            current values itself.
      required:
        - state
        - missing_keys
        - target_apply_state
      title: ApplicationPromotionSecrets
      type: object
    ApplicationPromotionConfigDifference:
      description: >-
        One deploy option the two environments set differently. It stays as it
        is in the target; the preview only names it. An absent key renders as
        "".
      properties:
        key:
          type: string
        source_value:
          type: string
        target_value:
          type: string
      required:
        - key
        - source_value
        - target_value
      title: ApplicationPromotionConfigDifference
      type: object

````