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

# Delete media asset

> Delete a media asset and its R2 object. Requires a private API key.



## OpenAPI

````yaml https://api.marblecms.com/openapi.json delete /v1/media/{id}
openapi: 3.1.0
info:
  title: Marble API
  version: 1.0.0
  description: A headless CMS API for managing and delivering content programmatically.
servers:
  - url: https://api.marblecms.com
    description: Production
security:
  - apiKey: []
paths:
  /v1/media/{id}:
    delete:
      tags:
        - Media
      summary: Delete media asset
      description: Delete a media asset and its R2 object. Requires a private API key.
      parameters:
        - schema:
            type: string
            example: cryitfjp1234jl04vdnycek8
            description: Media asset ID
          required: true
          description: Media asset ID
          name: id
          in: path
      responses:
        '200':
          description: Media asset deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '403':
          description: Public API key used for write operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
        '404':
          description: Media asset not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
components:
  schemas:
    DeleteResponse:
      type: object
      properties:
        id:
          type: string
          example: cryitfjp5678mn09qrstuvwx
      required:
        - id
    Forbidden:
      type: object
      properties:
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: >-
            Write operations require a private API key (msk_...). Public keys
            are read-only.
      required:
        - error
        - message
    NotFound:
      type: object
      properties:
        error:
          type: string
          example: Post not found
        message:
          type: string
          example: The requested resource does not exist
      required:
        - error
        - message
    ServerError:
      type: object
      properties:
        error:
          type: string
          example: Internal server error
        message:
          type: string
          example: Failed to fetch resource
      required:
        - error
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Your Marble API key

````