> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# deleteMedia

> Delete a media item from a message.

Delete a media item from a message.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /Accounts/{AccountSid}/Messages/{MessageSid}/Media/{Sid}:
    delete:
      operationId: delete_message_media
      summary: Delete Message Media
      description: >-
        Delete media for a message. Media cannot be deleted if the parent
        message is still in progress (initiated or queued status).


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Messaging_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_messageMedia
      parameters:
        - name: AccountSid
          in: path
          description: >-
            The unique identifier of the project that sent or received this
            message.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
        - name: MessageSid
          in: path
          description: A unique ID that identifies this specific message.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
        - name: Sid
          in: path
          description: A unique ID that identifies this specific message.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
      responses:
        '204':
          description: 204 No Content response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        '400':
          description: >-
            The request was invalid or cannot be processed. Check the error
            details for more information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompatibilityErrorResponse'
        '401':
          description: Authentication failed. Please verify your credentials and try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompatibilityErrorResponse'
        '404':
          description: >-
            The requested resource was not found. Please verify the resource
            identifier.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompatibilityErrorResponse'
        '422':
          description: >-
            The request could not be processed due to validation errors. Check
            the error details for more information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompatibilityErrorResponse'
servers:
  - url: https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01
    description: SignalWire Compatibility API
components:
  schemas:
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    CompatibilityErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Error code.
        message:
          type: string
          description: Error message.
        more_info:
          type: string
          description: URL for more information about the error.
        status:
          type: integer
          description: HTTP status code.
      required:
        - code
        - message
        - more_info
        - status
      description: Error response model.
      title: CompatibilityErrorResponse

```

## **Example**

```typescript {8}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com",
});

await client.compat.messages.deleteMedia("SM...", "ME...");
```