# Save a music track

Add a track to the authenticated user's library. Idempotent — saving an already-saved track returns the same library entry.

Saving only adds a library edge; it never modifies the track itself. Returns `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 save (`mtrack_`-prefixed).

## Returns

The library entry (edge) created or returned for the track.

**`id`** string · Library entry id (`mlib_`-prefixed).

**`track_id`** string · Id of the saved track (`mtrack_`-prefixed).

**`source`** string · How the track entered the library: `own` or `shared`.

**`created_at`** string · When the track was saved to the library (UTC).

**`saved`** boolean · Always `true` — the track is now in the library.

Example

```bash cURL
curl -X POST "https://api.aitronos.com/v1/music/org_abc123/tracks/mtrack_7c1a9e2f4b8d/save" \
  -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")

entry = client.post("/v1/music/org_abc123/tracks/mtrack_7c1a9e2f4b8d/save")
print(entry["id"], entry["saved"])
```


```python Python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

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


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

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

const entry = await response.json();
console.log(entry.id, entry.saved);
```

**Response:**


```json 200 OK
{
  "id": "mlib_5d3b8a1f9c2e",
  "track_id": "mtrack_7c1a9e2f4b8d",
  "source": "own",
  "created_at": "2026-06-28T10:32:00Z",
  "saved": true
}
```

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 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

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