# Delete a music track

Soft-delete a track. Only the track's creator may delete it; the audit and billing history survives.

After deletion the track no longer appears in any library. Returns `403` if the caller is not the creator, and `404` if the track does not exist or the caller has no access to it.

## Path parameters

**`organization_id`** string required

The organization the track is scoped to. The caller must belong to it.

**`track_id`** string required

Id of the track to delete (`mtrack_`-prefixed).

## Returns

A mutation acknowledgement.

**`success`** boolean · Whether the mutation succeeded.

**`id`** string · Id of the deleted track.

**`detail`** string · Human-readable confirmation message.

Example

```bash cURL
curl -X DELETE "https://api.aitronos.com/v1/music/org_abc123/tracks/mtrack_7c1a9e2f4b8d" \
  -H "X-API-Key: $FREDDY_API_KEY"
```


```python Python SDK
from aitronos import Aitronos  # pip install aitronos-sdk

client = Aitronos(api_key="your-api-key")

ack = client.delete("/v1/music/org_abc123/tracks/mtrack_7c1a9e2f4b8d")
print(ack["detail"])
```


```python Python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

response = requests.delete(
    "https://api.aitronos.com/v1/music/org_abc123/tracks/mtrack_7c1a9e2f4b8d",
    headers={"X-API-Key": api_key},
)
print(response.json()["detail"])
```


```javascript JavaScript
const apiKey = process.env.FREDDY_API_KEY;

const response = await fetch(
  'https://api.aitronos.com/v1/music/org_abc123/tracks/mtrack_7c1a9e2f4b8d',
  { method: 'DELETE', headers: { 'X-API-Key': apiKey } }
);

const ack = await response.json();
console.log(ack.detail);
```

**Response:**


```json 200 OK
{
  "success": true,
  "id": "mtrack_7c1a9e2f4b8d",
  "detail": "Track deleted."
}
```

Errors

```json 401 Unauthorized
{
  "success": false,
  "error": {
    "code": "AUTHENTICATION_REQUIRED",
    "message": "Authentication required. Please provide a valid API key.",
    "system_message": "Missing or invalid authorization header",
    "type": "authentication_error",
    "status": 401,
    "details": {},
    "trace_id": "req_abc123xyz",
    "timestamp": "2026-06-28T10:30:00Z"
  }
}
```


```json 403 Forbidden
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "You do not have permission to access this resource.",
    "system_message": "Only the track creator may delete it",
    "type": "authorization_error",
    "status": 403,
    "details": { "track_id": "mtrack_7c1a9e2f4b8d" },
    "trace_id": "req_def456uvw",
    "timestamp": "2026-06-28T10:30:00Z"
  }
}
```


```json 404 Not Found
{
  "success": false,
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "The requested resource could not be found.",
    "system_message": "Music track not found",
    "type": "client_error",
    "status": 404,
    "details": { "track_id": "mtrack_7c1a9e2f4b8d" },
    "trace_id": "req_jkl012mno",
    "timestamp": "2026-06-28T10:30:00Z"
  }
}
```

## Related Resources

- [Get a track](/docs/api-reference/music/get-track)
- [Remove a saved track](/docs/api-reference/music/unsave-track)
- [List saved tracks](/docs/api-reference/music/list-tracks)