> ## 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 an application's subject state

> One platform read of everything Ankra records about the application in an environment (ankra-ab5fog.8): the application's record, the place it runs (the one the query names by cluster and namespace, else the environment's one deployment, else every place listed), the installation's current state and the k8s mirror's view of its pods, the newest deploy runs and platform builds with their errors, the setup pull request and the reviews Ankra AI wrote, the active platform errors with the remedy their code names, and the named conversation's actions on it. Every section is three-state: a read that failed or was never attempted is unknown, never empty. Requires applications.read.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json get /api/v1/org/applications/{application_id}/subject-state
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
tags:
  - name: Canvas Pages
    description: >-
      Publish a chat canvas artifact at a public pages address and take it down
      again.
  - name: Cloud Delegation
    description: >-
      Platform browser consent and organisation-bound connections for Ankra
      Cloud.
  - name: Organisation IAM
    description: >-
      Custom organisation roles and scoped role assignments for member and
      service-account identities.
  - 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: AWS Clusters
    description: >-
      Provision and manage self-managed k3s / kubeadm clusters on AWS EC2 in
      your own VPC.
  - name: Ankra Cloud Clusters
    description: >-
      Provision and manage self-managed kubeadm / k3s clusters on Ankra Cloud
      servers: a private network, a NAT router and a bastion per 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: Pipelines
    description: >-
      Pipeline definitions, the approval of the authority they declare, and the
      caches pipelines keep between runs.
  - name: Workspaces
    description: >-
      Personal workspaces on the organisation's CI pool where a repository's
      heavy commands run, and the repository profiles they are built from.
  - name: Deploy Targets
    description: >-
      Environments, the hosts registered to receive deployments, and the
      releases deployed to them.
  - name: Backups
    description: >-
      Backup vaults, restore points, protection posture and captures for stacks
      and application deployments; a completed capture is not a verified
      restore.
  - name: Stack Profiles
    description: Reusable stack definitions, their versions and sharing.
  - name: Services
    description: >-
      Versioned service packages and explicit sharing. Runtime admission is
      separate from publication.
  - 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 Management
    description: >-
      Customer agent lifecycle, authenticated identity and organisation
      automation controls.
  - 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 Remediation
    description: >-
      The organisation's auto-remediation policy: what the AI lanes may fix by
      themselves, and who approves the rest.
  - 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: MCP Servers
    description: >-
      Register the MCP servers the organisation's AI agents can call, choose
      their tools and grant them to roles.
  - name: Security
    description: Findings, advisories, SBOMs, compliance and posture.
  - name: Cost
    description: Cluster and fleet cost, rate cards and cost settings.
  - name: Decisions
    description: >-
      The decision ledger behind the Security and Cost queues: proposals a
      surface computed, the approve and set-aside decisions people took on them,
      and the receipts of running them.
  - name: Usage
    description: >-
      What your organisation used of Ankra - vCPU-hours, playgrounds, managed
      services, hosted logs and metrics, and AI - per meter and period, with how
      completely it was measured and whether a published rate applies.
  - name: Billing
    description: Subscription and spend caps.
  - name: Organisation
    description: Members, invitations, audit logs and organisation settings.
  - name: Account
    description: >-
      Your own account: the contact email Ankra mails when it differs from your
      sign-in address.
  - name: Account Tokens
    description: Personal access tokens for the API and CLI.
  - name: Credentials
    description: The shared credential store.
  - name: AWS Credentials
    description: >-
      AWS credentials: access keys or CloudFormation-onboarded STS roles for
      cost, EKS and self-managed provisioning.
  - name: Ankra Cloud Credentials
    description: >-
      Ankra Cloud API tokens, shared by the self-managed and managed Ankra Cloud
      lanes.
  - 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: Object Storage Buckets
    description: >-
      Buckets Ankra creates and manages on an organisation's own provider
      credentials.
  - name: DNS
    description: DNS zones and records, including custom organisation zones.
  - name: Cloudflare
    description: Cloudflare domains and the credentials behind them.
  - name: Avura
    description: >-
      The linked Avura organization, the domains it shares with Ankra Platform,
      and their DNS records.
  - name: Variables
    description: Organisation- and cluster-scoped variables.
  - name: Secret Slots
    description: >-
      Store secrets in Vault and reference them by ${SECRET_SLOT:<slot_id>}
      sentinel instead of by value.
  - 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.
  - name: AI Settings
    description: Organisation AI provider, model catalog and per-function model settings
paths:
  /api/v1/org/applications/{application_id}/subject-state:
    get:
      tags:
        - Applications
      summary: Get an application's subject state
      description: >-
        One platform read of everything Ankra records about the application in
        an environment (ankra-ab5fog.8): the application's record, the place it
        runs (the one the query names by cluster and namespace, else the
        environment's one deployment, else every place listed), the
        installation's current state and the k8s mirror's view of its pods, the
        newest deploy runs and platform builds with their errors, the setup pull
        request and the reviews Ankra AI wrote, the active platform errors with
        the remedy their code names, and the named conversation's actions on it.
        Every section is three-state: a read that failed or was never attempted
        is unknown, never empty. Requires applications.read.
      operationId: get_application_subject_state_api_v1
      parameters:
        - in: path
          name: application_id
          required: true
          schema:
            type: string
            title: Application Id
        - in: query
          name: environment
          required: false
          schema:
            title: Environment
            type: string
            maxLength: 200
          description: >-
            The environment in view, by name; its one deployment is the binding
            when the query names no cluster.
        - in: query
          name: cluster_id
          required: false
          schema:
            format: uuid
            title: Cluster Id
            type: string
          description: >-
            The cluster of the place the page read; with namespace it picks the
            binding.
        - in: query
          name: namespace
          required: false
          schema:
            title: Namespace
            type: string
            maxLength: 63
          description: The namespace of the place the page read.
        - in: query
          name: deploy_run_id
          required: false
          schema:
            title: Deploy Run Id
            type: string
            format: uuid
          description: The deploy run a hand-off pointed at; echoed on the subject.
        - in: query
          name: conversation_id
          required: false
          schema:
            maxLength: 128
            title: Conversation Id
            type: string
          description: >-
            The chat conversation whose actions on the subject to list; without
            it the actions section is unknown.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationSubjectState'
          description: The subject state, every section with its own presence
        '403':
          description: The caller lacks applications.read
        '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:
    ApplicationSubjectState:
      type: object
      properties:
        subject:
          $ref: '#/components/schemas/SubjectStateSubject'
        read_at:
          type: string
          title: Read At
        application:
          $ref: '#/components/schemas/SubjectStateApplication'
        binding:
          $ref: '#/components/schemas/SubjectStateBinding'
        health:
          $ref: '#/components/schemas/SubjectStateHealth'
        deploy_runs:
          $ref: '#/components/schemas/SubjectStateDeployRuns'
        builds:
          $ref: '#/components/schemas/SubjectStateBuilds'
        pull_requests:
          $ref: '#/components/schemas/SubjectStatePullRequests'
        tickets:
          $ref: '#/components/schemas/SubjectStateTickets'
        platform_errors:
          $ref: '#/components/schemas/SubjectStatePlatformErrors'
        chat_actions:
          $ref: '#/components/schemas/SubjectStateChatActions'
      required:
        - subject
        - read_at
        - application
        - binding
        - health
        - deploy_runs
        - builds
        - pull_requests
        - tickets
        - platform_errors
        - chat_actions
      title: ApplicationSubjectState
      description: >-
        One platform read of everything Ankra records about an application in an
        environment. Every section is three-state: present, absent (a successful
        read that found nothing) or unknown (the read failed or was never
        attempted; never a negative).
    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
    SubjectStateSubject:
      type: object
      properties:
        kind:
          type: string
          title: Kind
        application_id:
          type: string
          title: Application Id
        environment:
          type: string
          title: Environment
        cluster_id:
          type: string
          title: Cluster Id
        namespace:
          title: Namespace
          type: string
        deploy_run_id:
          type: string
          title: Deploy Run Id
          description: The deploy run the caller pointed at.
      required:
        - kind
        - application_id
      title: SubjectStateSubject
      description: The thing the state is about, as the caller named it.
    SubjectStateApplication:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        name:
          title: Name
          type: string
        repository:
          type: string
          title: Repository
        branch:
          type: string
          title: Branch
        state:
          type: string
          title: State
          description: The platform record's lifecycle state (setup, not serving health).
        error_message:
          type: string
          title: Error Message
      required:
        - status
      title: SubjectStateApplication
      description: The application's own record.
    SubjectStateBinding:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        place:
          $ref: '#/components/schemas/SubjectStatePlace'
        places:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStatePlace'
          title: Places
          description: Every matching place when none could be chosen.
      required:
        - status
      title: SubjectStateBinding
      description: >-
        The place the subject resolves to: place is set when exactly one
        matches; places lists them when several do.
    SubjectStateHealth:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        deployment_state:
          type: string
          title: Deployment State
          description: The installation's lifecycle status.
        state_message:
          type: string
          title: State Message
        state_changed_at:
          type: string
          title: State Changed At
        first_healthy_at:
          type: string
          title: First Healthy At
        last_live_at:
          type: string
          title: Last Live At
          description: When the k8s mirror last saw the workload.
        pods:
          $ref: '#/components/schemas/SubjectStatePods'
      required:
        - status
        - pods
      title: SubjectStateHealth
      description: The bound deployment's current state.
    SubjectStateDeployRuns:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        runs:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStateDeployRun'
          title: Runs
        capped:
          type: boolean
          title: Capped
          description: Older runs exist beyond the ones listed.
      required:
        - status
        - runs
        - capped
      title: SubjectStateDeployRuns
      description: The newest deploy runs of the bound place, newest first.
    SubjectStateBuilds:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        builds:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStateBuild'
          title: Builds
        capped:
          type: boolean
          title: Capped
      required:
        - status
        - builds
        - capped
      title: SubjectStateBuilds
      description: The newest platform builds, newest first.
    SubjectStatePullRequests:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        setup_pull_request:
          $ref: '#/components/schemas/SubjectStatePullRequest'
        ai_reviews:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStatePullRequest'
          title: Ai Reviews
      required:
        - status
        - ai_reviews
      title: SubjectStatePullRequests
      description: >-
        The setup pull request the platform opened and the reviews Ankra AI
        wrote.
    SubjectStateTickets:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        tickets:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStateTicket'
          title: Tickets
      required:
        - status
        - tickets
      title: SubjectStateTickets
      description: The AI board's tickets about the subject.
    SubjectStatePlatformErrors:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStatePlatformError'
          title: Errors
      required:
        - status
        - errors
      title: SubjectStatePlatformErrors
      description: The active platform errors on the subject.
    SubjectStateChatActions:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        actions:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStateChatAction'
          title: Actions
      required:
        - status
        - actions
      title: SubjectStateChatActions
      description: The conversation's recent actions on the subject.
    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
    SubjectStatePlace:
      type: object
      properties:
        cluster_id:
          type: string
          title: Cluster Id
        cluster_name:
          type: string
          title: Cluster Name
        namespace:
          title: Namespace
          type: string
        installation_id:
          type: string
          title: Installation Id
        environment_id:
          type: string
          title: Environment Id
        environment_name:
          type: string
          title: Environment Name
        status:
          type: string
          title: Status
          description: The installation's status.
      required:
        - cluster_id
        - cluster_name
        - namespace
        - installation_id
        - status
      title: SubjectStatePlace
      description: 'One deployment of the application: a cluster and a namespace.'
    SubjectStatePods:
      type: object
      properties:
        status:
          type: string
          title: Status
          description: >-
            present: the read succeeded and found the facts below. absent: the
            read succeeded and found nothing. unknown: the read failed, timed
            out or was never attempted; never a negative.
          enum:
            - present
            - absent
            - unknown
        reason:
          type: string
          title: Reason
          description: >-
            Why the section is not present: the failure for unknown, a short
            note for absent.
        total:
          title: Total
          type: integer
        ready:
          type: integer
          title: Ready
        problems:
          type: array
          items:
            $ref: '#/components/schemas/SubjectStatePodProblem'
          title: Problems
        observed_at:
          type: string
          title: Observed At
      required:
        - status
        - total
        - ready
      title: SubjectStatePods
      description: The workload's pods as the k8s mirror last saw them.
    SubjectStateDeployRun:
      type: object
      properties:
        id:
          title: Id
          type: string
        status:
          type: string
          title: Status
        error_message:
          type: string
          title: Error Message
        error_code:
          type: string
          title: Error Code
          description: >-
            The deploy refusal code the error text carries, when it is one of
            the deploy's own refusals.
        cluster_id:
          type: string
          title: Cluster Id
        cluster_name:
          type: string
          title: Cluster Name
        namespace:
          title: Namespace
          type: string
        created_at:
          type: string
          title: Created At
        finished_at:
          type: string
          title: Finished At
      required:
        - id
        - status
        - created_at
      title: SubjectStateDeployRun
      description: One deploy run.
    SubjectStateBuild:
      type: object
      properties:
        id:
          title: Id
          type: string
        status:
          type: string
          title: Status
        ref:
          type: string
          title: Ref
        head_sha:
          type: string
          title: Head Sha
        reason:
          title: Reason
          type: string
        component:
          type: string
          title: Component
        error_class:
          type: string
          title: Error Class
        error_message:
          type: string
          title: Error Message
        started_at:
          type: string
          title: Started At
        finished_at:
          type: string
          title: Finished At
      required:
        - id
        - status
      title: SubjectStateBuild
      description: One platform build.
    SubjectStatePullRequest:
      type: object
      properties:
        number:
          type: integer
          title: Number
        title:
          type: string
          title: Title
        url:
          title: Url
          type: string
        merge_state:
          type: string
          title: Merge State
          description: >-
            merged, closed, open or unknown: the setup pull request records its
            merge; an AI review records only that the review happened.
        merged_at:
          type: string
          title: Merged At
        closed_at:
          type: string
          title: Closed At
        verdict:
          type: string
          title: Verdict
        summary:
          type: string
          title: Summary
        branch:
          type: string
          title: Branch
        head_sha:
          type: string
          title: Head Sha
        lane:
          type: string
          title: Lane
        created_at:
          type: string
          title: Created At
      required:
        - url
        - merge_state
      title: SubjectStatePullRequest
      description: A pull request the platform knows about the application.
    SubjectStateTicket:
      type: object
      properties:
        id:
          title: Id
          type: string
        title:
          type: string
          title: Title
        status:
          type: string
          title: Status
        kind:
          type: string
          title: Kind
        created_at:
          type: string
          title: Created At
      required:
        - id
        - title
        - status
      title: SubjectStateTicket
      description: An AI board ticket about the subject.
    SubjectStatePlatformError:
      type: object
      properties:
        code:
          title: Code
          type: string
        message:
          title: Message
          type: string
        source:
          type: string
          title: Source
          description: 'The record the error sits on: installation or deploy_run.'
        source_id:
          type: string
          title: Source Id
        occurred_at:
          type: string
          title: Occurred At
        remedy:
          $ref: '#/components/schemas/SubjectStateRemedy'
      required:
        - message
        - source
        - source_id
      title: SubjectStatePlatformError
      description: >-
        An error the platform recorded about the subject, with its remedy when
        the code names one.
    SubjectStateChatAction:
      type: object
      properties:
        action_id:
          type: string
          title: Action Id
        tool_name:
          type: string
          title: Tool Name
        status:
          type: string
          title: Status
        description:
          type: string
          title: Description
        created_at:
          type: string
          title: Created At
        completed_at:
          type: string
          title: Completed At
      required:
        - action_id
        - tool_name
        - status
        - created_at
      title: SubjectStateChatAction
      description: An action the conversation proposed on the subject.
    SubjectStatePodProblem:
      type: object
      properties:
        pod:
          type: string
          title: Pod
        container:
          type: string
          title: Container
        reason:
          title: Reason
          type: string
        message:
          title: Message
          type: string
      required:
        - pod
        - container
        - reason
      title: SubjectStatePodProblem
      description: One container the kubelet could not start, from the k8s mirror.
    SubjectStateRemedy:
      type: object
      properties:
        kind:
          type: string
          title: Kind
          description: The operation that clears the error.
          enum:
            - deploy_again
            - wait_then_deploy_again
            - clear_stack_holder
            - recreate_deployment
        label:
          type: string
          title: Label
          description: A button label.
        description:
          type: string
          title: Description
      required:
        - kind
        - label
        - description
      title: SubjectStateRemedy
      description: The operation that clears a platform error with a known remedy.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.