# deleteFile

> Part of the MAP Audio Music API docs. Index of every page: https://map.audio/developers/music-api/llms.txt. OpenAPI document: https://map.audio/developers/music-api/openapi.json.

`DELETE https://api.map.audio/v1/files/{id}`

Delete a file

Delete a file's bytes now, before retention would; its record stays with status `deleted`, and an output leaves its job's outputs. A file whose job is still running cannot be deleted yet. Free.

Auth: `Authorization: Bearer` with an API key or a map.audio access token. Not an MCP tool: Deleting a render cannot be undone, so it stays with your own code: DELETE /v1/files/{id} with an API key.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | A file id (file_…), from a job's `result.outputs` or GET /v1/files. Matches `^file_[0-9A-HJKMNP-TV-Z]{26}$`. |

## Example

```sh
curl -sS -X DELETE "https://api.map.audio/v1/files/file_01M6BPRK0M34NBP2XKJ1RMX1TQ" \
  -H "Authorization: Bearer $MAP_API_KEY" \
  -H "Map-Version: 2026-11-01"
```

### 200: Deleted

```json
{
  "object": "file",
  "id": "file_01M6BPRK0M34NBP2XKJ1RMX1TQ",
  "kind": "output",
  "status": "deleted",
  "name": "master.wav",
  "contentType": "audio/wav",
  "bytes": 4608044,
  "sha256": "5a3485b7a3221be5f7ead6ab953cbc198988a7246158215b32bb937acbd3852b",
  "jobId": "job_01M6BPRE186QHP9QPYGDX5NNFP",
  "role": "master",
  "createdAt": "2026-11-01T14:03:41.877Z",
  "expiresAt": "2026-11-08T14:03:41.877Z"
}
```

### 409: File not ready

```json
{
  "error": {
    "type": "conflict",
    "code": "file_not_ready",
    "message": "File file_01M6BPRK0M34NBP2XKJ1RMX1TQ is still being written by job_01M6BPRE186QHP9QPYGDX5NNFP; retry when that job succeeds.",
    "param": "id",
    "retryable": true,
    "jobId": "job_01M6BPRE186QHP9QPYGDX5NNFP",
    "docUrl": "https://map.audio/developers/music-api/errors#file_not_ready",
    "requestId": "9a3f7c2e5b1d8f40-LHR"
  }
}
```

## Responses

- `200`: The file, deleted.
- `409`: File not ready
- `default`: Any other error: `error.code` names it, `error.param` the field at fault, and `error.docUrl` its entry in the error catalogue.

## Errors

- [`not_found`](https://map.audio/developers/music-api/errors#not_found)
- [`file_not_ready`](https://map.audio/developers/music-api/errors#file_not_ready)
- [`invalid_request`](https://map.audio/developers/music-api/errors#invalid_request)
