> ## 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.

# Get Application Demos

> Return the application's active demos plus everything the demos tab needs in one round-trip: the caller's TTL policy, the staging-cluster status, and the default container port (the generated Dockerfile's EXPOSE port when known). A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication).



## OpenAPI

````yaml https://platform.ankra.app/openapi.json get /api/v1/org/applications/{application_id}/demos
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:
  /api/v1/org/applications/{application_id}/demos:
    get:
      tags:
        - Applications
      summary: Get Application Demos
      description: >-
        Return the application's active demos plus everything the demos tab
        needs in one round-trip: the caller's TTL policy, the staging-cluster
        status, and the default container port (the generated Dockerfile's
        EXPOSE port when known). A browser session twin is mounted at the same
        path without the /api/v1 prefix (cookie authentication).
      operationId: get_application_demos_api_v1_org_applications__application_id__demos_get
      parameters:
        - in: path
          name: application_id
          required: true
          schema:
            type: string
            title: Application Id
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ankra-Organisation-Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationDemosResponse'
          description: Successful Response
        '401':
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: Not found ("Application not found")
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ApplicationDemosResponse:
      description: >-
        The application's active demos plus everything the demos tab needs in
        one round-trip.
      properties:
        default_container_port:
          description: >-
            The port a demo of this application should target by default (the
            generated Dockerfile's EXPOSE port when known).
          type: integer
        demos:
          items:
            $ref: '#/components/schemas/DemoWorkspace'
          type: array
        staging:
          $ref: '#/components/schemas/DemoStagingStatus'
        ttl:
          $ref: '#/components/schemas/DemoTTLPolicy'
      required:
        - demos
        - ttl
        - staging
        - default_container_port
      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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    DemoWorkspace:
      description: >-
        One ephemeral PR or branch demo record. kind is pr_demo or branch_demo;
        status is one of pending, provisioning, ready, failed, tearing_down,
        destroyed.
      properties:
        application_id:
          anyOf:
            - type: string
            - type: 'null'
        branch:
          anyOf:
            - type: string
            - type: 'null'
        cluster_id:
          anyOf:
            - type: string
            - type: 'null'
        component:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The deployable component this demo runs; null for rows predating
            component records.
        container_port:
          anyOf:
            - type: integer
            - type: 'null'
        created_at:
          format: date-time
          type: string
        created_by_user_id:
          type: string
        database:
          type: boolean
        detected_container_port:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            The port the readiness reconciler's log parser saw the container
            announce; set with port_corrected_at when a runtime correction
            happened.
        port_corrected_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When the demo's container port was automatically corrected from the
            container's own logs; a demo row receives at most one correction.
        demo_base_stack_error:
          anyOf:
            - type: string
            - type: 'null'
        demo_base_stack_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            References the shared base stack this demo depends on;
            name/status/error are joined from the base stack for display. All
            absent when the demo has no base-stack dependency.
        demo_base_stack_name:
          anyOf:
            - type: string
            - type: 'null'
        demo_base_stack_status:
          anyOf:
            - type: string
            - type: 'null'
        demo_stack_error:
          anyOf:
            - type: string
            - type: 'null'
        demo_stack_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The stack-profile replica attached to a full-stack demo; absent for
            single-service demos (as are demo_stack_status and
            demo_stack_error).
        demo_stack_status:
          anyOf:
            - type: string
            - type: 'null'
        environment:
          description: >-
            The demo's env entry names and secret flags only - values (sentinel
            or plaintext) never ride list surfaces.
          items:
            $ref: '#/components/schemas/DemoEnvironmentSummaryEntry'
          type: array
        expires_at:
          format: date-time
          type: string
        head_sha:
          anyOf:
            - type: string
            - type: 'null'
        id:
          type: string
        image_tag:
          anyOf:
            - type: string
            - type: 'null'
        kind:
          type: string
        last_error:
          anyOf:
            - type: string
            - type: 'null'
        namespace:
          type: string
        pod_name:
          anyOf:
            - type: string
            - type: 'null'
        pr_number:
          anyOf:
            - type: integer
            - type: 'null'
        preview_url:
          anyOf:
            - type: string
            - type: 'null'
        preview_dns_unconfirmed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Stamped when the demo was published ready although a successful DNS
            probe at that moment still found nothing behind the preview
            hostname: the URL had not resolved as of this time. Absent is no
            adverse claim, never a confirmation that the URL works.
        repos:
          items:
            $ref: '#/components/schemas/DemoWorkspaceRepo'
          type: array
        stack_profile_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The profile's display name, denormalized so list surfaces can badge
            full-stack demos without a second lookup.
        status:
          type: string
        provisioning_deadline_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            The instant the readiness reconciler gives up on a
            still-provisioning demo and marks it failed. An absolute deadline
            rather than the timestamp it derives from, because the underlying
            column (ai_workspaces.updated_at) is not purely a status-change
            clock - extending a demo TTL moves it too - while the deadline stays
            true whatever moves it. Present only while the demo status is
            provisioning - that is the reconciler own WHERE clause, and no
            deadline is enforced against a demo in any other state. Absent
            otherwise (and on surfaces that do not resolve it); a consumer
            without it must show no time estimate rather than falling back to
            created_at.
        provisioning_timeout_seconds:
          type: integer
          description: >-
            The width of the provisioning window ending at
            provisioning_deadline_at, so a consumer can render
            elapsed-against-budget directly; wider for a demo carrying a stack
            replica or waiting on a deploying base stack. Present only alongside
            provisioning_deadline_at, i.e. only while the demo is provisioning.
        components:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/DemoWorkspaceComponent'
          description: >-
            Every deployable component the demo runs; null for single-workload
            demos predating multi-component records.
      required:
        - id
        - kind
        - application_id
        - cluster_id
        - namespace
        - pod_name
        - pr_number
        - branch
        - image_tag
        - container_port
        - preview_url
        - head_sha
        - status
        - last_error
        - repos
        - database
        - expires_at
        - created_by_user_id
        - created_at
      type: object
    DemoStagingStatus:
      description: The staging-cluster status the demos tab renders.
      properties:
        agent_online:
          type: boolean
        cluster_id:
          anyOf:
            - type: string
            - type: 'null'
        cluster_name:
          anyOf:
            - type: string
            - type: 'null'
        configured:
          type: boolean
      required:
        - configured
        - cluster_id
        - cluster_name
        - agent_online
      type: object
    DemoTTLPolicy:
      description: >-
        The caller-specific TTL contract the demos tab renders: the pre-filled
        default, the role-capped maximum, and whether the caller may deploy at
        all.
      properties:
        can_deploy:
          type: boolean
        default_ttl_hours:
          type: integer
        max_ttl_hours:
          type: integer
      required:
        - default_ttl_hours
        - max_ttl_hours
        - can_deploy
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    DemoEnvironmentSummaryEntry:
      description: >-
        The value-free projection list surfaces expose: names and secret flags
        only, never values.
      properties:
        name:
          type: string
        secret:
          type: boolean
      required:
        - name
        - secret
      type: object
    DemoWorkspaceRepo:
      description: One repository cloned into a workspace pod.
      properties:
        name:
          type: string
        path:
          type: string
        url:
          type: string
      required:
        - name
        - url
        - path
      type: object
    DemoWorkspaceComponent:
      type: object
      description: >-
        One deployable component of a demo: its own Deployment and Service
        inside the demo namespace. The entry component owns the demo host's root
        path.
      properties:
        name:
          type: string
        image_tag:
          type: string
        container_port:
          type: integer
        ingress_path:
          type: string
          description: >-
            Path prefix the component is published under on the demo host; empty
            keeps it in-cluster only.
        entry:
          type: boolean
        detected_container_port:
          type: integer
          description: >-
            The port this component's container announced in its own logs; set
            with port_corrected_at when a runtime correction repointed its
            workload.
        port_corrected_at:
          type: string
          format: date-time
          description: >-
            When this component's container port was automatically corrected
            from its own logs; each component receives at most one correction.
            The entry component mirrors the demo row's port_corrected_at.
      required:
        - name
        - container_port

````