# Update a music collection

Partially update a collection owned by the caller. Only the fields you send are changed; omitted fields are left untouched.

All body fields are optional. To clear a nullable field, send it explicitly as `null`. Returns `404` if the collection does not exist or is not owned by the caller.

## Path parameters

**`organization_id`** string required

The organization that owns the collection.

**`collection_id`** string required

The collection id (`mcoll_`).

## Request Body

**`name`** string optional

A new name. Must be 1–512 characters.

**`description`** string | null optional

A new description. Send `null` to clear it.

**`cover_track_id`** string | null optional

A new cover track id (`mtrack_`). Send `null` to clear it.

**`cover_image_url`** string | null optional

A new cover image URL (max 1024 chars). Send `null` to clear it.

## Returns

The updated collection object with `track_count` populated.

Example

```bash cURL
curl -X PATCH "https://api.aitronos.com/v1/music/org_abc123/collections/mcoll_4a1f9c7e2b8d" \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Deep Work", "description": null }'
```


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

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

collection = client.patch(
    "/v1/music/org_abc123/collections/mcoll_4a1f9c7e2b8d",
    json={"name": "Deep Work", "description": None},
)
print(collection["name"])
```


```python Python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

response = requests.patch(
    "https://api.aitronos.com/v1/music/org_abc123/collections/mcoll_4a1f9c7e2b8d",
    headers={"X-API-Key": api_key},
    json={"name": "Deep Work", "description": None},
)

print(response.json()["name"])
```


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

const response = await fetch('https://api.aitronos.com/v1/music/org_abc123/collections/mcoll_4a1f9c7e2b8d', {
  method: 'PATCH',
  headers: {
    'X-API-Key': apiKey,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Deep Work', description: null }),
});

const collection = await response.json();
console.log(collection.name);
```

**Response:**


```json 200 OK
{
  "id": "mcoll_4a1f9c7e2b8d",
  "name": "Deep Work",
  "description": null,
  "cover_track_id": "mtrack_8d2e1f6a3c9b",
  "cover_image_url": null,
  "track_count": 12,
  "created_at": "2026-06-28T10:30:00Z",
  "updated_at": "2026-06-28T12:00:00Z"
}
```

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 404 Not Found
{
  "success": false,
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "The requested resource was not found.",
    "system_message": "Music collection not found or not owned by caller",
    "type": "client_error",
    "status": 404,
    "details": { "collection_id": "mcoll_4a1f9c7e2b8d" },
    "trace_id": "req_jkl012abc",
    "timestamp": "2026-06-28T10:30:00Z"
  }
}
```


```json 422 Unprocessable Entity
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The request payload is invalid.",
    "system_message": "name must be between 1 and 512 characters",
    "type": "validation_error",
    "status": 422,
    "details": { "field": "name" },
    "trace_id": "req_ghi789xyz",
    "timestamp": "2026-06-28T10:30:00Z"
  }
}
```

## Related Resources

- [Get a collection](/docs/api-reference/music/get-collection)
- [Delete a collection](/docs/api-reference/music/delete-collection)
- [Music Studio overview](/docs/api-reference/music/introduction)