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

# Record a computed proposal (upsert by dedupe key)

> Records what a surface computed. The dedupe key is the proposal's identity within the organisation: a re-post refreshes a proposal nobody has decided and leaves a decided, running or finished one exactly as it was decided, so an approval is always of the plan the person saw. status "superseded" withdraws the proposal the dedupe key names instead; withdrawing one somebody approved or set aside erases that decision and takes the area's permission (403 otherwise). Any member who may write may propose; a scoped token needs the area's permission. Answers 201 when the dedupe key was new and 200 when it named an existing proposal. Bearer-PAT twin of the browser route of the same name under /org; the console's session cookie is not accepted here and the browser route answers a token with a login redirect.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /api/v1/org/decisions
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: AWS Clusters
    description: >-
      Provision and manage self-managed k3s / kubeadm clusters on AWS EC2 in
      your own VPC.
  - 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: 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 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: 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: 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: AWS Credentials
    description: >-
      AWS credentials: access keys or CloudFormation-onboarded STS roles for
      cost, EKS and self-managed provisioning.
  - 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: 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.
  - name: AI Settings
    description: Organisation AI provider, model catalog and per-function model settings
paths:
  /api/v1/org/decisions:
    post:
      tags:
        - Decisions
      summary: Record a computed proposal (upsert by dedupe key)
      description: >-
        Records what a surface computed. The dedupe key is the proposal's
        identity within the organisation: a re-post refreshes a proposal nobody
        has decided and leaves a decided, running or finished one exactly as it
        was decided, so an approval is always of the plan the person saw. status
        "superseded" withdraws the proposal the dedupe key names instead;
        withdrawing one somebody approved or set aside erases that decision and
        takes the area's permission (403 otherwise). Any member who may write
        may propose; a scoped token needs the area's permission. Answers 201
        when the dedupe key was new and 200 when it named an existing proposal.
        Bearer-PAT twin of the browser route of the same name under /org; the
        console's session cookie is not accepted here and the browser route
        answers a token with a login redirect.
      operationId: upsert_decision_api_v1_org_decisions_post
      parameters:
        - description: PAT organisation override.
          in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionProposalUpsertRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionProposal'
          description: >-
            The proposal the dedupe key already named, refreshed or left as
            decided
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionProposal'
          description: The proposal was created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: >-
            Missing or malformed Authorization header, or a body field the
            ledger refuses (unknown area, missing kind, summary or dedupe_key, a
            document that is not a JSON object)
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Unknown, expired, or revoked API token
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: >-
            Token may not use this surface, a scoped token lacks the area's
            permission, or the caller lacks it for superseding a decided
            proposal
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: >-
            status "superseded" named a dedupe key the organisation does not
            hold
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: >-
            The dedupe key names a proposal of another area or kind, or a
            superseded proposal is running or has run
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Request validation error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Internal server error
      security:
        - BearerAuth: []
components:
  schemas:
    DecisionProposalUpsertRequest:
      description: >-
        Body of POST /api/v1/org/decisions: what a surface computed, keyed by
        dedupe_key. With status "superseded" only dedupe_key is read.
      properties:
        area:
          enum:
            - security
            - cost
          type: string
        kind:
          maxLength: 64
          type: string
        subject:
          additionalProperties: true
          type: object
        summary:
          maxLength: 2000
          type: string
        plan:
          additionalProperties: true
          type: object
        evidence:
          additionalProperties: true
          type: object
        source:
          maxLength: 64
          type: string
        dedupe_key:
          maxLength: 512
          type: string
        status:
          default: proposed
          enum:
            - proposed
            - superseded
          type: string
      required:
        - dedupe_key
      title: DecisionProposalUpsertRequest
      type: object
    DecisionProposal:
      description: >-
        One proposal of the decision ledger: what it is about, what the surface
        computed, where it stands, who decided, and what running it did.
      properties:
        id:
          type: string
          format: uuid
        area:
          description: >-
            security or cost; decides which permission approving and running it
            takes.
          enum:
            - security
            - cost
          type: string
        kind:
          description: >-
            What the proposal does, e.g. addon_upgrade, image_rebuild,
            right_size, off_hours_schedule, waste_cleanup. Only kinds with a
            platform operation are executable.
          type: string
        subject:
          additionalProperties: true
          description: >-
            Identity of what the proposal is about (finding_id, cluster_id,
            addon_name, waste_finding_id ...), one document per kind.
          type: object
        summary:
          type: string
        plan:
          additionalProperties: true
          description: >-
            The steps the surface computed. plan.parameters is the machine half
            the executable kinds are called with: addon_upgrade takes
            {cluster_id, addon_name, chart_version}; off_hours_schedule takes
            {cluster_id, timezone, schedules: [{action, stop_mode,
            cron_expression}]}; waste_cleanup takes {waste_finding_id}.
          type: object
        evidence:
          additionalProperties: true
          type: object
        status:
          enum:
            - proposed
            - approved
            - set_aside
            - running
            - succeeded
            - failed
            - superseded
          type: string
        source:
          description: Which surface computed it (default "surface").
          type: string
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          description: Ankra user id of whoever posted it.
        decided_by:
          anyOf:
            - type: string
            - type: 'null'
          description: Ankra user id of the last approve or set-aside.
        decided_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        decision_note:
          anyOf:
            - type: string
            - type: 'null'
        operation_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          description: >-
            The platform execution a run dispatched, to watch under
            /api/v1/org/executions.
        receipt:
          anyOf:
            - $ref: '#/components/schemas/DecisionReceipt'
            - type: 'null'
        dedupe_key:
          type: string
        executable:
          description: >-
            Whether the platform has an operation for the kind, so a surface
            offers "run" only where running can work.
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - area
        - kind
        - subject
        - summary
        - plan
        - evidence
        - status
        - source
        - created_by
        - decided_by
        - decided_at
        - decision_note
        - operation_id
        - receipt
        - dedupe_key
        - executable
        - created_at
        - updated_at
      title: DecisionProposal
      type: object
    ContractDetailError:
      example:
        detail: Cluster not found
      properties:
        detail:
          oneOf:
            - type: string
            - additionalProperties: true
              properties: {}
              type: object
      required:
        - detail
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    DecisionReceipt:
      description: >-
        The record of running a proposal: who ran it and when, the platform
        operation it became, the steps taken and how it ended.
      properties:
        claimed_at:
          type: string
          format: date-time
        executed_by:
          type: string
        dispatched_at:
          type: string
          format: date-time
        operation_id:
          type: string
          format: uuid
        completed_at:
          type: string
          format: date-time
        execution_status:
          description: >-
            The platform execution's terminal status once a read settled it
            (success, failed, critical, cancelled).
          type: string
        steps:
          items:
            $ref: '#/components/schemas/DecisionReceiptStep'
          type: array
      required:
        - steps
      title: DecisionReceipt
      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
    DecisionReceiptStep:
      properties:
        name:
          type: string
        outcome:
          enum:
            - dispatched
            - succeeded
            - failed
            - refused
            - error
            - abandoned
          type: string
        detail:
          type: string
        evidence:
          additionalProperties: true
          type: object
      required:
        - name
        - outcome
      title: DecisionReceiptStep
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: PAT
      scheme: bearer
      type: http

````