# Save a shared track

Save a shared track into the recipient's own library. Returns `201 Created` with the new library edge. Unlike the public resolve, this endpoint **requires sign-in**.

Only a shared **track** can be saved — a shared collection is read-only. The track is added as a `shared`-sourced library edge; the original track is unchanged. A revoked, expired, or removed share returns a graceful `404`.

## Path parameters

**`token`** string required

The raw share token from the share `url`.

## Returns

A library edge object.

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

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

**`source`** string · Always `shared` for this endpoint.

**`share_link_id`** string · Id of the originating share link (`mslink_`-prefixed), or `null`.

**`created_at`** string · When the edge was created (UTC).

Example

```bash cURL
curl -X POST "https://api.aitronos.com/v1/music/shared/shr_9f3a2b7c1e4d6a8f0b2c4d6e8f1a3b5c/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")

edge = client.post("/v1/music/shared/shr_9f3a2b7c1e4d6a8f0b2c4d6e8f1a3b5c/save")
print(edge["track_id"])
```


```python Python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

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


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

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

const edge = await response.json();
console.log(edge.track_id);
```

**Response:**


```json 201 Created
{
  "id": "mlib_6d2f9a4c1e83",
  "track_id": "mtrack_b4d9e1c6a72f",
  "source": "shared",
  "share_link_id": "mslink_3a7f2c9e8b14",
  "created_at": "2026-06-28T10:30:00Z"
}
```

Errors

```json 401 Unauthorized
{
  "success": false,
  "error": {
    "code": "AUTHENTICATION_REQUIRED",
    "message": "Authentication required. Please provide a valid API key.",
    "system_message": "Saving a shared track requires sign-in",
    "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": "This share link is no longer available.",
    "system_message": "Share token invalid, revoked, expired, or content removed",
    "type": "client_error",
    "status": 404,
    "details": {},
    "trace_id": "req_jkl012mno",
    "timestamp": "2026-06-28T10:30:00Z"
  }
}
```

## Related Resources

- [Open a shared link](/docs/api-reference/music/resolve-share)
- [List saved tracks](/docs/api-reference/music/list-tracks)
- [Share a track](/docs/api-reference/music/share-track)