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

# Delete the provider cluster

> Browser session authentication; RBAC permission `clusters.delete`. For Kapsule, provider_cluster_id is the opaque region-qualified `regions/{region}/clusters/{id}` reference. CNI is immutable. Imported/unknown provenance is disconnect-only; provider deletion is allowed by default only for created clusters.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /org/clusters/managed/{provider}/{cluster_id}/delete-provider-cluster
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /org/clusters/managed/{provider}/{cluster_id}/delete-provider-cluster:
    post:
      tags:
        - Scaleway / Kapsule
      summary: Delete the provider cluster
      description: >-
        Browser session authentication; RBAC permission `clusters.delete`. For
        Kapsule, provider_cluster_id is the opaque region-qualified
        `regions/{region}/clusters/{id}` reference. CNI is immutable.
        Imported/unknown provenance is disconnect-only; provider deletion is
        allowed by default only for created clusters.
      operationId: managed_provider_delete_browser
      parameters:
        - in: path
          name: provider
          required: true
          schema:
            $ref: '#/components/schemas/ManagedProvider'
        - in: path
          name: cluster_id
          required: true
          schema:
            format: uuid
            type: string
        - in: query
          name: force
          required: false
          schema:
            type: boolean
        - in: query
          name: retention_policy
          required: false
          schema:
            default: delete
            enum:
              - delete
              - retain
            type: string
        - description: Must match the ankra_csrf browser cookie.
          in: header
          name: X-Ankra-CSRF
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedDeprovisionResponse'
          description: Successful response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Invalid request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Unauthenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Permission or CSRF check failed
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Resource not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Conflicting or unsafe lifecycle state
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Request validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Provider or internal failure
      security:
        - SessionCookie: []
components:
  schemas:
    ManagedProvider:
      enum:
        - doks
        - uks
        - gke
        - ovh_mks
        - aks
        - eks
        - kapsule
      example: kapsule
      type: string
    ManagedDeprovisionResponse:
      properties:
        cluster_id:
          format: uuid
          type: string
        errors:
          items:
            type: string
          type: array
        operation_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
        resources_marked:
          type: integer
        retention_policy:
          enum:
            - delete
            - retain
          type: string
        success:
          type: boolean
      required:
        - success
        - cluster_id
        - resources_marked
        - errors
      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
    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
  securitySchemes:
    SessionCookie:
      description: Browser session. Mutations also require X-Ankra-CSRF.
      in: cookie
      name: ankra_session
      type: apiKey

````