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

# Delete a materialization

> Deletes a terminal (MANIFEST_FILE_READY, FAILED, or CANCELLED)
materialization record. By default this removes the publisher's record
only; the caller owns table GC. Set dropTables=true to also drop
the physical tables this run produced (from the materialization's
manifest) as a best-effort cleanup.




## OpenAPI

````yaml /dataplane-public-api-doc.yaml delete /environments/{environmentName}/packages/{packageName}/materializations/{materializationId}
openapi: 3.1.0
info:
  title: Malloy Publisher - Semantic Model Serving API
  description: >
    The Malloy Publisher - Semantic Model Serving API provides comprehensive
    access to Malloy packages and their associated resources.

    A Malloy package is a directory containing Malloy models (.malloy files),
    Malloy notebooks (.malloynb files), and embedded databases

    (.parquet files) with a malloy-publisher.json manifest at the package's root
    directory.


    ## Key Features


    - **Environment Management**: Create and manage environments with their
    associated packages and connections

    - **Package Lifecycle**: Full CRUD operations for Malloy packages and their
    versions

    - **Model & Notebook Access**: Retrieve and execute Malloy models and
    notebooks

    - **Connection Management**: Secure database connection configuration and
    testing

    - **Query Execution**: Execute queries against models and retrieve results

    - **Watch Mode**: Real-time file watching for development workflows


    ## Resource Hierarchy


    The API follows a hierarchical resource structure:

    ```

    Environments

    ├── Connections

    └── Packages
        ├── Models
        ├── Notebooks
        └── Databases
    ```


    For examples, see the Malloy samples packages
    (https://github.com/malloydata/malloy-samples) repository.
  version: v0
servers:
  - url: https://{organization}.data.credibledata.com/api/v0/
    description: Production API server
    variables:
      organization:
        default: demo
        description: Your organization subdomain
security:
  - bearerAuth: []
tags:
  - name: publisher
    description: Publisher status and health check operations
  - name: environments
    description: >-
      Environment lifecycle management including creation, configuration, and
      deletion of data modeling environments
  - name: connections
    description: >-
      Database connection management for secure data source configuration and
      access
  - name: packages
    description: >-
      Package management for Malloy data models, including versioning and
      distribution
  - name: models
    description: Malloy model access and compilation operations
  - name: notebooks
    description: Malloy notebook access and execution operations
  - name: pages
    description: Static HTML pages (in-package data apps)
  - name: databases
    description: Embedded database management and access
  - name: watch-mode
    description: Real-time file watching for development workflows
  - name: materializations
    description: Package-level materializations for persisting Malloy sources
paths:
  /environments/{environmentName}/packages/{packageName}/materializations/{materializationId}:
    delete:
      tags:
        - materializations
      summary: Delete a materialization
      description: |
        Deletes a terminal (MANIFEST_FILE_READY, FAILED, or CANCELLED)
        materialization record. By default this removes the publisher's record
        only; the caller owns table GC. Set dropTables=true to also drop
        the physical tables this run produced (from the materialization's
        manifest) as a best-effort cleanup.
      operationId: delete-materialization
      parameters:
        - $ref: '#/components/parameters/environmentName'
        - $ref: '#/components/parameters/packageName'
        - $ref: '#/components/parameters/materializationId'
        - name: dropTables
          in: query
          required: false
          description: |
            When true, also drop the physical tables recorded in the
            materialization's manifest before deleting the record. Defaults to
            false (record-only delete; the caller owns table GC).
          schema:
            type: boolean
            default: false
      responses:
        '204':
          description: Materialization deleted
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Materialization cannot be deleted while it is active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    environmentName:
      name: environmentName
      in: path
      required: true
      description: Name of the environment
      schema:
        type: string
    packageName:
      name: packageName
      in: path
      required: true
      description: Name of the package
      schema:
        type: string
    materializationId:
      name: materializationId
      in: path
      required: true
      description: ID of the materialization
      schema:
        type: string
  responses:
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      description: Standard error response format
      properties:
        message:
          type: string
          description: Human-readable error message describing what went wrong
        details:
          type: string
          description: Additional error details or context
      required:
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````