> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackdome.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat Stackdome as an application-delivery platform for coding agents and developers, not as a Kubernetes dashboard.
> Prefer the Stackdome agent plugin as the user entry point and the stackdome CLI as the execution interface.
> Route agents who need the maintained deploy skill to npx skills add stackdome/skills and the complete operational workflow to /guides/ai-agents.
> Verify commands and flags with stackdome --help. Run stackdome init before authoring stackfile.yaml and stackdome validate before deploying.
> Use -o json for automation and verify documented terminal states before claiming success.
> Never request a user's account password. Use API-token authentication.
> During alpha, Stackdome Cloud is ephemeral and capacity-limited, and each organization can connect one cluster.
> Do not expose Kubernetes as a user concern unless the task is self-hosting or infrastructure architecture.

# Delete a preview stack



## OpenAPI

````yaml /openapi.yaml delete /api/v1/organizations/{org_id}/projects/{project_name}/preview-stacks/{id}
openapi: 3.0.0
info:
  description: >-
    Deploy, debug, and operate applications through the Stackdome REST API on
    Stackdome Cloud or a self-hosted installation. This API is in alpha and may
    change before general availability.
  title: Stackdome API
  version: 0.0.1-alpha
servers:
  - url: /
security: []
paths:
  /api/v1/organizations/{org_id}/projects/{project_name}/preview-stacks/{id}:
    delete:
      tags:
        - Preview Stacks
      summary: Delete a preview stack
      operationId: deletePreviewStack
      parameters:
        - description: The ID of the organization
          explode: false
          in: path
          name: org_id
          required: true
          schema:
            type: string
          style: simple
        - description: The name of the project
          explode: false
          in: path
          name: project_name
          required: true
          schema:
            type: string
          style: simple
        - description: The id of record
          explode: false
          in: path
          name: id
          required: true
          schema:
            type: string
          style: simple
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewStack'
          description: Preview stack deletion initiated
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Preview stack not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error
      security:
        - Bearer: []
components:
  schemas:
    PreviewStack:
      example:
        commit: commit
        annotations:
          - value: value
            key: key
          - value: value
            key: key
        created_at: '2000-01-23T04:56:07.000Z'
        source: manual
        deletion_timestamp: '2000-01-23T04:56:07.000Z'
        branch: branch
        labels:
          - value: value
            key: key
          - value: value
            key: key
        organisation_id: organisation_id
        updated_at: '2000-01-23T04:56:07.000Z'
        project_id: project_id
        user_id: user_id
        config_id: config_id
        stack_id: stack_id
        image_overrides:
          key: image_overrides
        name: name
        pr_number: pr_number
        id: id
        status:
          phase: Provisioning
          outputs:
            commit_sha: commit_sha
            urls:
              - resource: resource
                url: url
              - resource: resource
                url: url
          reason: reason
          message: message
      properties:
        id:
          readOnly: true
          type: string
        organisation_id:
          readOnly: true
          type: string
        project_id:
          readOnly: true
          type: string
        user_id:
          readOnly: true
          type: string
        config_id:
          type: string
        stack_id:
          type: string
        name:
          type: string
        pr_number:
          type: string
        branch:
          type: string
        commit:
          readOnly: true
          type: string
        source:
          enum:
            - manual
            - webhook
          type: string
        status:
          $ref: '#/components/schemas/PreviewStack_status'
        image_overrides:
          additionalProperties:
            type: string
          type: object
        labels:
          items:
            $ref: '#/components/schemas/Label'
          type: array
        annotations:
          items:
            $ref: '#/components/schemas/Annotation'
          type: array
        deletion_timestamp:
          format: date-time
          type: string
        created_at:
          format: date-time
          readOnly: true
          type: string
        updated_at:
          format: date-time
          readOnly: true
          type: string
      type: object
    Error:
      allOf:
        - $ref: '#/components/schemas/ObjectReference'
        - $ref: '#/components/schemas/Error_allOf'
    PreviewStack_status:
      example:
        phase: Provisioning
        outputs:
          commit_sha: commit_sha
          urls:
            - resource: resource
              url: url
            - resource: resource
              url: url
        reason: reason
        message: message
      properties:
        phase:
          enum:
            - Provisioning
            - Deploying
            - Ready
            - Failed
            - Deleting
          type: string
        reason:
          type: string
        message:
          type: string
        outputs:
          $ref: '#/components/schemas/PreviewStack_status_outputs'
      readOnly: true
      type: object
    Label:
      additionalProperties: false
      example:
        value: value
        key: key
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
      type: object
    Annotation:
      example:
        value: value
        key: key
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
      type: object
    ObjectReference:
      properties:
        id:
          type: string
        kind:
          type: string
        href:
          type: string
      type: object
    Error_allOf:
      properties:
        code:
          type: string
        reason:
          type: string
        operation_id:
          type: string
        details:
          additionalProperties: true
          description: Optional structured, machine-readable error context
          type: object
      type: object
    PreviewStack_status_outputs:
      example:
        commit_sha: commit_sha
        urls:
          - resource: resource
            url: url
          - resource: resource
            url: url
      properties:
        commit_sha:
          type: string
        urls:
          items:
            $ref: '#/components/schemas/PreviewStack_status_outputs_urls_inner'
          type: array
      type: object
    PreviewStack_status_outputs_urls_inner:
      example:
        resource: resource
        url: url
      properties:
        resource:
          type: string
        url:
          type: string
      type: object
  securitySchemes:
    Bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````