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

# Submit Denoise Job

> Queue an audio or video file for voice isolation. The original is uploaded and a background job is enqueued; the response returns identifiers used to track progress via the SSE endpoint.

Queues an audio (or video) file for voice isolation. The endpoint accepts the upload, persists the original, creates a pending record, and enqueues a background job. Use the returned `denoiseId` with the [progress SSE endpoint](/api-reference/denoise-progress) to track completion.

## Authentication

Requires API key authentication via `x-api-key` header.

## Request

**Content-Type:** `multipart/form-data`

### Form Data

| Field   | Type | Required | Description                                                          |
| ------- | ---- | -------- | -------------------------------------------------------------------- |
| `audio` | File | Yes      | Audio or video file to denoise (max 200 MB, max 15 minutes duration) |

### File Limits

* **Maximum file size:** 200 MB
* **Maximum duration:** 15 minutes
* **Source type detection:** files with extension `mp4`, `mov`, `mkv`, `webm`, `avi`, or `m4v` are treated as video and their audio track is extracted before denoising. All other extensions are treated as audio.

Supported audio formats: WAV, MP3, M4A, FLAC, OGG.

## Response

**Status Code:** `200 OK`

**Content-Type:** `application/json`

### Response Schema

| Field       | Type          | Description                                                                               |
| ----------- | ------------- | ----------------------------------------------------------------------------------------- |
| `jobId`     | string        | Identifier of the queued background job. Mirrors `denoiseId`.                             |
| `denoiseId` | string (UUID) | Unique identifier of the denoising record. Use this with the progress and list endpoints. |

### Example Response

```json theme={null}
{
  "jobId": "5b1d2f7e-3f81-4c2a-9c5d-7a2e91b4c7a1",
  "denoiseId": "5b1d2f7e-3f81-4c2a-9c5d-7a2e91b4c7a1"
}
```

### Error Responses

**400 Bad Request**

```json theme={null}
{
  "errorCode": "400xx",
  "errorMessage": "audio is required and must be a file"
}
```

```json theme={null}
{
  "errorCode": "400xx",
  "errorMessage": "File size exceeds the maximum limit of 200MB. File size: <n>MB"
}
```

```json theme={null}
{
  "errorCode": "400xx",
  "errorMessage": "Duration exceeds the maximum limit of 15 minutes. Duration: <n> minutes"
}
```

**401 Unauthorized**

```json theme={null}
{
  "errorCode": "40101",
  "errorMessage": "Invalid or missing API key"
}
```

**402 Payment Required**

```json theme={null}
{
  "errorCode": "40201",
  "errorMessage": "Insufficient wallet balance"
}
```

## Example Usage

### JavaScript

```javascript theme={null}
const formData = new FormData();
const audioFile = document.querySelector('input[type="file"]').files[0];
formData.append("audio", audioFile);

const response = await fetch('https://api.munsit.com/api/v1/denoise', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    // Note: Content-Type is set automatically by FormData
  },
  body: formData,
});

if (response.ok) {
  const { jobId, denoiseId } = await response.json();
  console.log('Queued denoising', { jobId, denoiseId });
  // Next: subscribe to /denoise/{denoiseId}/progress for live updates
} else {
  const error = await response.json();
  console.error('Error:', error);
}
```

### Python

```python theme={null}
import requests

url = "https://api.munsit.com/api/v1/denoise"
headers = {
    "x-api-key": "YOUR_API_KEY"
}

with open("input_audio.wav", "rb") as audio_file:
    files = {"audio": audio_file}
    response = requests.post(url, files=files, headers=headers)

if response.status_code == 200:
    data = response.json()
    print(f"Queued denoising: denoiseId={data['denoiseId']}")
else:
    print(f"Error: {response.status_code} - {response.text}")
```

### cURL

```bash theme={null}
curl -X POST "https://api.munsit.com/api/v1/denoise" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "audio=@input_audio.wav"
```

<Note>
  **Async workflow**: This endpoint only enqueues the job. The denoised audio URL is delivered via the [progress SSE endpoint](/api-reference/denoise-progress) (`done` event) or can be fetched from the [list endpoint](/api-reference/denoise-list) once the record's `status` is `success`.
</Note>


## OpenAPI

````yaml POST /denoise
openapi: 3.1.0
info:
  title: Munsit API
  description: >-
    Munsit - First True Arabic Voice AI that speaks Dialects From Abu Dhabi to
    Rabat with Voice Cloning & On-prem support
  version: 1.0.0
servers:
  - url: https://api.munsit.com/api/v1
    description: Global production server
  - url: https://ae.api.faseeh.ai/api/v1
    description: UAE regional server
security:
  - apiKeyAuth: []
paths:
  /denoise:
    post:
      tags:
        - Voice Isolation
      summary: Submit Denoise Job
      description: >-
        Queue an audio or video file for voice isolation. The original is
        uploaded and a background job is enqueued; the response returns
        identifiers used to track progress via the SSE endpoint.
      operationId: denoiseAudio
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - audio
              properties:
                audio:
                  type: string
                  format: binary
                  description: >-
                    Audio or video file to denoise (max 200 MB, max 15 minutes
                    duration). Video containers (mp4, mov, mkv, webm, avi, m4v)
                    have their audio track extracted automatically.
      responses:
        '200':
          description: Denoising job queued
          content:
            application/json:
              schema:
                type: object
                required:
                  - jobId
                  - denoiseId
                properties:
                  jobId:
                    type: string
                    description: Background job identifier (mirrors denoiseId).
                  denoiseId:
                    type: string
                    format: uuid
                    description: >-
                      Unique identifier of the denoising record. Use this with
                      /denoise/{denoiseId}/progress and as the record id in
                      /denoise.
        '400':
          description: >-
            Bad Request - File size exceeds 200 MB or duration exceeds 15
            minutes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Payment Required - Insufficient wallet balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - errorCode
        - errorMessage
      properties:
        errorCode:
          type: string
          description: Error code identifier
        errorMessage:
          type: string
          description: Human-readable error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````