> ## Documentation Index
> Fetch the complete documentation index at: https://docs.musique.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Acknowledge Playlist Sync

> Record that your integration has successfully synced a playlist.

Records that your integration has consumed the current state of a playlist. No request body is needed — all data is captured server-side: your token identity, the playlist state at the time of the call, and the server timestamp.

Every call appends a new entry to the audit log. Repeated or retried calls are always safe.

## Request

```http theme={null}
POST /api/v1/integration/playlists/{id}/sync
X-API-Key: msk_prod_1234567890abcdef
User-Agent: YourApp/1.0
```

No request body.

### Path Parameters

| Parameter | Type    | Description     |
| --------- | ------- | --------------- |
| `id`      | integer | The playlist ID |

## Response

`204 No Content` — no response body.

## Error Responses

| Status | Code                 | Description                                               |
| ------ | -------------------- | --------------------------------------------------------- |
| `401`  | `invalid_token`      | Token is missing, invalid, or revoked                     |
| `404`  | `playlist_not_found` | Playlist does not exist or belongs to a different company |
| `500`  | `internal_error`     | Unexpected server error                                   |

<Note>
  The `404` response covers both "playlist not found" and "playlist belongs to another company." This is intentional — the API does not reveal whether a playlist ID exists if your token cannot access it.
</Note>

## What gets recorded

Each successful call inserts one row into the sync audit log:

| Field                    | Description                                                                 |
| ------------------------ | --------------------------------------------------------------------------- |
| Token identity           | Which API token made the call                                               |
| Playlist ID              | The playlist that was synced                                                |
| `syncedAt`               | Server timestamp of the call                                                |
| `playlistSongsUpdatedAt` | Snapshot of the playlist's last song-change timestamp at the moment of sync |

The `playlistSongsUpdatedAt` snapshot is the key audit signal. It lets you (and Musique ops) answer: *was the partner's copy of the playlist current at the time they synced?*

## Usage pattern

Call this endpoint after you have successfully fetched and applied the playlist from [Get Playlist](/api-reference/playlists/get-playlist).

```bash theme={null}
# 1. Fetch the playlist
curl https://api.musique.app/api/v1/integration/playlists/1 \
  -H "X-API-Key: msk_prod_1234567890abcdef" \
  -H "User-Agent: YourApp/1.0"

# 2. Apply it in your system (download songs, update your player, etc.)

# 3. Acknowledge the sync
curl -X POST https://api.musique.app/api/v1/integration/playlists/1/sync \
  -H "X-API-Key: msk_prod_1234567890abcdef" \
  -H "User-Agent: YourApp/1.0"
```
