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

# Denoise

> Initiate a noise removal task using either an audio URL or file upload with optional webhook callback.

Remove background noise from an input audio file with optional webhook callback for asynchronous updates.

***

## Endpoint

```http theme={null}
POST /v1/denoise
```

This endpoint removes noise from an uploaded or linked audio file. A `webhook_url` can be provided for asynchronous task status updates.

***

## Sample Output

Listen to a real sample output:
<audio controls="1" controlslist="nodownload nofullscreen noremoteplayback" src="https://cdn1.wav.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_nonoise.mp3">Your browser does not support the audio playback.</audio>

<a href="https://cdn1.wav.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_nonoise.wav" target="_blank">Download Audio</a>

***

## Try it Yourself

Visit the [Denoise Endpoint Explorer](/api-documentation/endpoint/denoise) to try your own text samples.

***

## Request Parameters

| Parameter     | Type     | Required | Description                                                                             |
| ------------- | -------- | -------- | --------------------------------------------------------------------------------------- |
| `audio_url`   | `String` | Optional | The URL of an audio file to clean. Either `audio_url` or `audio_file` must be provided. |
| `audio_file`  | `File`   | Optional | Upload the audio file directly. Either `audio_url` or `audio_file` must be provided.    |
| `webhook_url` | `String` | Optional | Callback URL for async response.                                                        |

> **Note:** Either audio\_file or audio\_url must be provided.

> **content-type:** multipart/form-data

***

## Sample Request

### cURL

```bash theme={null}
curl -X POST "https://api.wav.com/api/public/v1/denoise" \
  -H "Authorization: <API_KEY>" \
  -F "audio_url=<YOUR_AUDIO_URL>" \
  -F "webhook_url=https://example.com/my-webhook"
```

### Python

```python theme={null}
import requests

url = "https://api.wav.com/api/public/v1/denoise"

headers = {
    "Authorization": "<API_KEY>"
}

data = {
    "webhook_url": "https://example.com/my-webhook"
}

# Option 1: audio_url
data["audio_url"] = "<YOUR_AUDIO_URL>"
response = requests.post(url, headers=headers, data=data)

# Option 2: File Upload
# with open("song.mp3", "rb") as f:
#     files = {"audio_file": f}
#     response = requests.post(url, headers=headers, data=data, files=files)

print(response.json())

```

***

## Sample Response

### Success (200 OK)

```json theme={null}
{
  "success":true,
  "task_id":"01e88c6d-5006-4ad9-b7c4-80360ca37860",
  "conversion_id":"c3f08613-998d-4ef9-80a9-9c05891e5237",
  "eta":71,
  "credit_estimate":0.48,
  "message":"",
  "status":"IN_QUEUE"
}
```

***

## Webhook Response

### Success (200 OK)

```json theme={null}
{
  "success": true, 
  "conversion_type": "Denoise", 
  "task_id": "01e88c6d-5006-4ad9-b7c4-80360ca37860", 
  "conversion_id": "c3f08613-998d-4ef9-80a9-9c05891e5237", 
  "audio_path": "files/2e7c373c-aef9-4dda-8e70-2ff50ad18169.wav", 
  "no_noise": "https://cdn1.wav.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_nonoise.mp3", 
  "noise": "https://cdn1.wav.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_noise.mp3", 
  "noise_wav": "", 
  "message": "de_noising conversion Completed", 
  "conversion_duration": 136.82721088435375, 
  "conversion_cost": "0.48"
}
```

***

## Common Errors

* **422 Unprocessable Entity**: Both `audio_url` and `audio_file` cannot be `None`.
* **500 Internal Server Error**: A server error occurred during processing.

***

## Payload and Request Formation


## OpenAPI

````yaml POST /v1/denoise
openapi: 3.1.0
info:
  title: WAV API
  version: 1.0.0
  description: API for retrieving conversion details by ID.
servers:
  - url: https://api.wav.com/api/public
    description: Production server
security: []
paths:
  /v1/denoise:
    post:
      summary: Removes noise from an audio file or URL
      description: >-
        Initiate a noise removal task using either an audio URL or file upload
        with optional webhook callback.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                audio_url:
                  type: string
                  description: 'Input audio URL (supported format: YouTube URL).'
                  example: https://www.youtube.com/watch?v=example123
                audio_file:
                  type: string
                  format: binary
                  description: Audio file to upload and process directly.
                webhook_url:
                  type: string
                  description: Callback URL for async processing results.
                  example: http://your-webhook-url.com/callback
              anyOf:
                - required:
                    - audio_url
                - required:
                    - audio_file
      responses:
        '200':
          description: Successfully initiated task
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  task_id:
                    type: string
                  conversion_id:
                    type: string
                  eta:
                    type: integer
                  credit_estimate:
                    type: number
                  message:
                    type: string
                  status:
                    type: string
                example:
                  success: true
                  task_id: 3d137437-4911-4669-b639-9e5701107c25
                  conversion_id: b764b4f6-a842-42dd-a55b-818eb8251dc7
                  eta: 71
                  credit_estimate: 0.03
                  message: Message published to queue
                  status: IN_QUEUE
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Either audio_url or audio_file must be provided.
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Internal Server Error
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Python
          source: >-
            import requests


            url = "https://api.wav.com/api/public/v1/denoise"


            headers = {
                "Authorization": "<API_KEY>"
            }


            data = {
                "webhook_url": "https://example.com/my-webhook"
            }


            # Option 1: audio_url

            data["audio_url"] = "<YOUR_AUDIO_URL>"

            response = requests.post(url, headers=headers, data=data)


            # Option 2: File Upload

            # with open("song.mp3", "rb") as f:

            #     files = {"audio_file": f}

            #     response = requests.post(url, headers=headers, data=data,
            files=files)


            print(response.json())
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````