# Add tracks to library
URL: https://musicapi.com/docs/reference/add-liked-tracks.md

`POST https://api.musicapi.com/api/{integrationUserUUID}/liked/tracks`

Section: Read and write a user's library.
Product: MusicAPI Core.
Auth: Basic, DevToken, DocsSession (any one of them). Use Basic with your Client ID and Client Secret from your server only.

[Check which services support adding tracks to user's library](/docs/get-started/services-and-features)


This endpoint saves tracks to the current user's library on Music Service.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `integrationUserUUID` | uuid | yes | The connected user: the `integrationUserUUID` from the sign-in callback. |

## Request body

`application/json`, required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `itemIds` | string[] | yes | Track IDs that are retrievable through track searches or when fetching playlist items. A maximum of 20 IDs can be sent in one request. |

## Response 200

ok

## Errors

- 404: Your account has no connected user with this uuid, or the item does not exist.
- 412: The user must sign in again (`IntegrationUserNotAuthenticated`).
- 429: Too many requests. Wait for the seconds in `Retry-After`.

## Example

```bash
curl -X POST "https://api.musicapi.com/api/{integrationUserUUID}/liked/tracks" \
  -u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"itemIds":["42YpD6LQura7bGOtntatQw"]}'
```
