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

# Delete media file

> Permanently deletes a media file and automatically removes all references from agents
that use this file. The deletion is performed in two stages: first removing agent
references, then deleting the file itself.

<Warning>This operation permanently deletes the media file and cannot be undone.</Warning>

## Cascade Deletion

The deletion process follows this sequence:

1. **Remove agent references**: All agents using this media file are updated automatically
2. **Delete file**: The media file is permanently removed

## What Gets Updated

Agents are automatically updated if they use the media file for:

* Warm transfer hold music
* Cold transfer hold music
* Ambient noise/background sounds

## Error Handling

If removing agent references fails, the media file is **NOT** deleted to ensure data consistency. You can safely retry the operation.


## OpenAPI

````yaml https://blackbox.dasha.ai/swagger/v1/swagger.json delete /api/v1/media/{id}
openapi: 3.0.4
info:
  title: Dasha BlackBox Agent API
  description: API for managing AI agents and calls
  contact:
    name: DashaAI Team
    email: support@dasha.ai
  version: v1
servers:
  - url: https://blackbox.dasha.ai
    description: Dasha BlackBox Agent API
security:
  - {}
  - {}
tags:
  - name: ActivityLogs
  - name: Agents
  - name: CallResults
  - name: Calls
  - name: Chats
  - name: CustomerData
  - name: Mcp
  - name: Media
  - name: Misc
  - name: PronunciationDictionaries
  - name: Providers
  - name: SipAliases
  - name: SipCredentials
  - name: SipPhoneNumbers
  - name: TextChat
  - name: TwilioProvider
  - name: Voice
  - name: WebhookTest
  - name: WebIntegrations
  - name: WebSocket
    description: WebSocket endpoints for real-time communication
paths:
  /api/v1/media/{id}:
    delete:
      tags:
        - Media
      summary: Delete media file
      description: >-
        Permanently deletes a media file and automatically removes all
        references from agents

        that use this file. The deletion is performed in two stages: first
        removing agent

        references, then deleting the file itself.
      parameters:
        - name: id
          in: path
          description: Media file identifier
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: Media file deleted and agent references removed successfully
        '401':
          description: Authentication failed or API key is missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Media file with specified ID does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Failed to remove agent references (file NOT deleted)
        '502':
          description: Upstream service error
        '503':
          description: Service temporarily unavailable
        '504':
          description: Request timeout
components:
  schemas:
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}

````