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

# Prepare a managed-service disconnection review (browser session)

> Requires the applications rollout flag, applications.deploy, clusters.operate on the service's cluster, and clusters.operate and clusters.read on the application environment's cluster, all intersected with live token scopes: the authority connecting it needed. Resolves, on the primary database, what disconnecting one application environment from a running managed service does: the variables it stops receiving and, when this service gives the protocol's conventional names (DATABASE_URL, ...) while another service of the protocol is connected, the choices for who gives them next; that the shared credential is not revoked and how to make sure the application can no longer authenticate; whether the environment's release delivered the connection Secret; which deployed workloads read it, separating references Ankra attached (the next deploy removes them and rolls the workloads) from references written by hand; whether the namespace leaves the service's client port; when it takes effect; and what stays. It stores an actor-bound plan with a digest and a ten-minute expiry. Nothing changes. timing now is refused while every application of the service shares one credential. Refused while the service installs or retires, while a deploy of the environment is in flight, while the environment is already being disconnected, and for another generation. An actor may hold at most 10 open disconnection reviews and an organisation 50.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /org/service-admission/instances/{instance_id}/disconnections
openapi: 3.1.0
info:
  title: Ankra Platform API
  version: v1
  description: >-
    The Ankra platform HTTP contract. The /api/v1 surface is the public,
    bearer-authenticated API used by the Ankra CLI, MCP clients and automation;
    send a personal or service API token as `Authorization: Bearer <token>`.
    Browser routes under /org and /chat are served on api.platform.ankra.app
    (each declares that server); they and /oauth/access authenticate with the
    ankra_session cookie, and mutations also require the X-Ankra-CSRF header.
    Every operation declares the credential it accepts, and no operation is
    served without one. This document is published deliberately: it describes
    the contract only and carries no organisation data or credentials. Report
    security issues to security@ankra.ai (see /.well-known/security.txt).
servers:
  - url: https://platform.ankra.app
security:
  - BearerAuth: []
tags:
  - name: Onboarding
    description: >-
      Generate a first website from a prompt and deploy it to a new
      organisation's cluster.
  - name: Access Gate
    description: >-
      Private service sign-in and membership checks for trusted Ankra proxy
      relays.
  - name: Canvas Datasets
    description: >-
      Read the fixed, named datasets canvas dashboards bind their charts, tables
      and stats to.
  - name: Canvases
    description: >-
      Keep dashboards and pages in the organisation's canvas library, with
      revision history, undo and pins.
  - 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: Deploy Provenance
    description: >-
      Whether an application's deploys verify signed provenance from the
      organisation's own pipeline, the keys that provenance is signed with, and
      a dry-run that verifies images without deploying.
  - 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: AI Memory
    description: >-
      What the assistant has learned about you: your cross-session memories and
      learned profile.
  - 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: HPE Morpheus Credentials
    description: HPE Morpheus credentials and the capacity and quotas behind them.
  - name: OVH Credentials
    description: OVH credentials and SSH keys.
  - name: Proxmox Credentials
    description: Proxmox VE credentials and the capacity and quotas behind them.
  - 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:
  /org/service-admission/instances/{instance_id}/disconnections:
    post:
      tags:
        - Services
      summary: Prepare a managed-service disconnection review (browser session)
      description: >-
        Requires the applications rollout flag, applications.deploy,
        clusters.operate on the service's cluster, and clusters.operate and
        clusters.read on the application environment's cluster, all intersected
        with live token scopes: the authority connecting it needed. Resolves, on
        the primary database, what disconnecting one application environment
        from a running managed service does: the variables it stops receiving
        and, when this service gives the protocol's conventional names
        (DATABASE_URL, ...) while another service of the protocol is connected,
        the choices for who gives them next; that the shared credential is not
        revoked and how to make sure the application can no longer authenticate;
        whether the environment's release delivered the connection Secret; which
        deployed workloads read it, separating references Ankra attached (the
        next deploy removes them and rolls the workloads) from references
        written by hand; whether the namespace leaves the service's client port;
        when it takes effect; and what stays. It stores an actor-bound plan with
        a digest and a ten-minute expiry. Nothing changes. timing now is refused
        while every application of the service shares one credential. Refused
        while the service installs or retires, while a deploy of the environment
        is in flight, while the environment is already being disconnected, and
        for another generation. An actor may hold at most 10 open disconnection
        reviews and an organisation 50.
      operationId: prepareServiceDisconnectionSession
      parameters:
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceDisconnectionRequest'
      responses:
        '200':
          description: The stored disconnection review, its plan and digest.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceDisconnection'
        '307':
          description: Redirect to login
        '401':
          description: Authentication required
        '403':
          description: Insufficient permission or missing browser CSRF
        '404':
          description: Not accessible, absent, or rollout disabled
        '409':
          description: >-
            The disconnection was refused: the service is installing, retiring
            or retired, changed generation, does not serve the environment, the
            environment is already being disconnected or its deploy is in
            flight, a choice for the conventional names is needed, the digest is
            stale, the review expired, or disconnections are not available yet
        '422':
          description: >-
            Invalid or ambiguous request, timing now, or a choice for the
            conventional names the review does not offer
        '429':
          description: Too many open disconnection reviews
        '500':
          description: Internal error
        '503':
          description: Rollout availability could not be verified
      security:
        - SessionCookie: []
      servers:
        - url: https://api.platform.ankra.app
components:
  schemas:
    ServiceDisconnectionRequest:
      type: object
      additionalProperties: false
      description: >-
        What a person states when preparing a disconnection. Every field is
        required; connection_names_instance_id may be null.
      required:
        - consumer_id
        - expected_generation
        - timing
        - keep_network_access
        - connection_names_instance_id
        - connection_names_none
      properties:
        consumer_id:
          type: string
          format: uuid
          description: The consumer to disconnect, among the instance's consumers.
        expected_generation:
          type: integer
          format: int64
          minimum: 1
          description: The instance generation the person reviewed.
        timing:
          type: string
          enum:
            - after_next_deploy
            - now
          description: >-
            after_next_deploy: the application keeps working until its next
            deploy. now is refused while every application of the service shares
            one credential.
        keep_network_access:
          type: boolean
          description: True keeps the namespace admitted on the service's client port.
        connection_names_instance_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Only when the review asks for a choice: the other connected service
            that gives the conventional names from now on; null otherwise.
        connection_names_none:
          type: boolean
          description: >-
            Only when the review asks for a choice: true when no service gives
            the conventional names from now on.
    ServiceDisconnection:
      type: object
      additionalProperties: false
      description: >-
        One disconnection of an application environment from a managed service,
        as its preparing actor sees it.
      required:
        - id
        - instance_id
        - plan
        - digest
        - state
        - created_at
        - expires_at
        - confirmed_at
        - phase
        - settled_at
        - outcome
        - running_pods
      properties:
        id:
          type: string
          format: uuid
        instance_id:
          type: string
          format: uuid
        plan:
          $ref: '#/components/schemas/ServiceDisconnectionPlan'
        digest:
          type: string
          pattern: ^sha256:[a-f0-9]{64}$
        state:
          type: string
          enum:
            - pending
            - expired
            - in_progress
            - settled
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        confirmed_at:
          type:
            - string
            - 'null'
          format: date-time
        phase:
          type:
            - string
            - 'null'
          enum:
            - draining
            - removing
            - revoking
            - null
        settled_at:
          type:
            - string
            - 'null'
          format: date-time
        outcome:
          oneOf:
            - $ref: '#/components/schemas/ServiceDisconnectionOutcome'
            - type: 'null'
        running_pods:
          description: >-
            The pods in the environment's namespace that read the connection
            Secret now, read when the disconnection is served; not part of the
            plan or its digest. Null once settled, for an environment on another
            cluster, and when it could not be read.
          oneOf:
            - type: object
              additionalProperties: false
              required:
                - count
                - names
              properties:
                count:
                  type: integer
                names:
                  type: array
                  items:
                    type: string
            - type: 'null'
    ServiceDisconnectionPlan:
      type: object
      additionalProperties: false
      description: >-
        The reviewed statement of what a disconnection removes, keeps and cannot
        do. Every field is resolved by the server; the digest covers all of it.
      required:
        - schema_version
        - instance_id
        - organisation_id
        - actor_id
        - service_name
        - cluster_id
        - generation
        - engine
        - protocol
        - consumer
        - on_service_cluster
        - credential
        - connection_names
        - connection_secret
        - workloads
        - network
        - data
        - timing
        - kept
        - rotation
        - expires_at
      properties:
        schema_version:
          type: integer
        instance_id:
          type: string
          format: uuid
        organisation_id:
          type: string
          format: uuid
        actor_id:
          type: string
          format: uuid
        service_name:
          type: string
        cluster_id:
          type: string
          format: uuid
        generation:
          type: integer
          format: int64
        engine:
          type: string
          description: >-
            The engine's label (PostgreSQL, Valkey, ...); empty for a package
            Ankra knows only by its declared connection.
        protocol:
          type: string
        consumer:
          type: object
          additionalProperties: false
          required:
            - id
            - application_id
            - cluster_id
            - namespace
          properties:
            id:
              type: string
              format: uuid
            application_id:
              type: string
              format: uuid
            cluster_id:
              type: string
              format: uuid
            namespace:
              type: string
        on_service_cluster:
          type: boolean
          description: >-
            False for an environment on another cluster than the service: Ankra
            never delivered it a connection, so only the record is removed.
        credential:
          type: object
          additionalProperties: false
          description: >-
            What happens to the credential. Every engine's connected
            applications share one today, so nothing is revoked.
          required:
            - kind
            - other_consumers
            - statement
            - cannot_guarantee
          properties:
            kind:
              type: string
              enum:
                - shared
            other_consumers:
              type: integer
            statement:
              type: string
            cannot_guarantee:
              type: string
        connection_names:
          type: object
          additionalProperties: false
          description: >-
            The variables the application stops receiving and, when the service
            gives the protocol's conventional names, who gives them next.
          required:
            - variables
            - conventional
            - carries_conventional
            - choice_required
            - choices
            - choice
            - statement
          properties:
            variables:
              type: array
              items:
                type: string
            conventional:
              type: array
              items:
                type: string
            carries_conventional:
              type: boolean
            choice_required:
              type: boolean
              description: >-
                Confirming needs choice: another service of the protocol is
                connected.
            choices:
              type: array
              items:
                type: object
                additionalProperties: false
                description: >-
                  A connected service that may give the conventional names, or
                  nobody (none).
                required:
                  - instance_id
                  - service_name
                  - none
                  - installing
                properties:
                  instance_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  service_name:
                    type: string
                  none:
                    type: boolean
                  installing:
                    type: boolean
                    description: >-
                      The service is still being set up: choosing it points the
                      application at a new, empty service.
            choice:
              oneOf:
                - type: object
                  additionalProperties: false
                  description: >-
                    A connected service that may give the conventional names, or
                    nobody (none).
                  required:
                    - instance_id
                    - service_name
                    - none
                    - installing
                  properties:
                    instance_id:
                      type:
                        - string
                        - 'null'
                      format: uuid
                    service_name:
                      type: string
                    none:
                      type: boolean
                    installing:
                      type: boolean
                      description: >-
                        The service is still being set up: choosing it points
                        the application at a new, empty service.
                - type: 'null'
            statement:
              type: string
        connection_secret:
          type: object
          additionalProperties: false
          required:
            - secret_name
            - delivered
            - statement
          properties:
            secret_name:
              type: string
            delivered:
              type: boolean
              description: >-
                The environment's stored release renders this service's entry:
                it is kept in place until no pod reads it, then removed.
            statement:
              type: string
        workloads:
          type: object
          additionalProperties: false
          description: The deployed workloads that read the connection Secret.
          required:
            - state
            - attached_by_ankra
            - written_by_hand
            - statement
          properties:
            state:
              type: string
              enum:
                - known
                - not_stored
                - not_deployed
            attached_by_ankra:
              type: array
              items:
                type: string
            written_by_hand:
              type: array
              items:
                type: string
            statement:
              type: string
        network:
          type: object
          additionalProperties: false
          description: >-
            Whether the environment's namespace leaves the service's client
            port.
          required:
            - namespace
            - narrows
            - keep_network_access
            - reason
            - port
            - statement
          properties:
            namespace:
              type: string
            narrows:
              type: boolean
            keep_network_access:
              type: boolean
            reason:
              type: string
              enum:
                - narrows
                - keep_requested
                - open_by_design
                - open
                - changed_by_hand
                - still_needed
                - not_admitted
                - not_rendered
                - other_cluster
            port:
              type: integer
            statement:
              type: string
        data:
          type: string
        timing:
          type: object
          additionalProperties: false
          required:
            - mode
            - deploy_now_offered
            - now_offered
            - statement
          properties:
            mode:
              type: string
              enum:
                - after_next_deploy
            deploy_now_offered:
              type: boolean
            now_offered:
              type: boolean
            statement:
              type: string
        kept:
          type: array
          items:
            type: string
        rotation:
          type: string
        expires_at:
          type: string
          format: date-time
    ServiceDisconnectionOutcome:
      type: object
      additionalProperties: false
      description: What the settled disconnection observed, and only what it observed.
      required:
        - connection_secret
        - network
        - removed_namespaces
        - observed_at
      properties:
        connection_secret:
          type: string
          enum:
            - removed
            - not_delivered
            - not_confirmed
            - record_only
        network:
          type: string
          enum:
            - narrowed
            - left
            - not_confirmed
        network_reason:
          type: string
        removed_namespaces:
          type: array
          items:
            type: string
        observed_at:
          type: string
          format: date-time
  securitySchemes:
    BearerAuth:
      bearerFormat: PAT
      scheme: bearer
      type: http
    SessionCookie:
      description: Browser session. Mutations also require X-Ankra-CSRF.
      in: cookie
      name: ankra_session
      type: apiKey

````

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