Finetuning.aiFinetuning.ai

POST /v1/playlists/:id/tracks/move

Move up to 100 tracks to another playlist

Move up to 100 tracks from playlist :id (the source) to another of your playlists in a single request.

For each track: it's added to the target playlist, and — only if that succeeds — removed from the source. A track that can't be added (privacy rule, already in the target, etc.) stays in the source playlist and is reported in errors.

Request

POST https://pub.finetuning.ai/v1/playlists/:id/tracks/move

Path parameters

ParameterTypeDescription
idstringThe source playlist ID (see GET /v1/playlists)

Headers

HeaderTypeRequiredDescription
X-API-KeystringYesYour API key
Content-TypestringYesapplication/json

Body

FieldTypeRequiredDescription
trackIdsstring[]Yes1–100 track IDs to move
targetPlaylistIdstringYesDestination playlist ID — must be different from the source

Example

curl -X POST https://pub.finetuning.ai/v1/playlists/9b2f51e2-4c1a-4b8e-9d3e-2f7a8c641b05/tracks/move \
  -H "X-API-Key: ft_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"trackIds": ["a4f6c1e9-2d3b-4c8a-9e5f-7b1d0c2a8e64", "c7d2e8a1-5f4b-4e9c-8a6d-3b9f1e0c5a72"], "targetPlaylistId": "3f8c2d10-7e5b-4a92-b6d1-8e4f0a92c7d3"}'

Response

200 OK
{
  "data": {
    "moved": ["a4f6c1e9-2d3b-4c8a-9e5f-7b1d0c2a8e64"],
    "errors": [
      { "trackId": "c7d2e8a1-5f4b-4e9c-8a6d-3b9f1e0c5a72", "error": "Cannot add private track to public playlist" }
    ]
  }
}

When zero tracks could be moved, the request returns 400 instead:

400 Bad Request
{
  "error": {
    "code": "MOVE_FAILED",
    "message": "Track already in playlist",
    "details": [
      { "trackId": "c7d2e8a1-5f4b-4e9c-8a6d-3b9f1e0c5a72", "error": "Track already in playlist" }
    ]
  }
}

Response fields

FieldTypeDescription
data.movedstring[]Track IDs that were added to the target and removed from the source
data.errorsarrayPer-item failures — omitted when every track was moved
data.errors[].trackIdstringThe track ID that failed
data.errors[].errorstringWhy it failed

Per-item error reasons

All the reasons from adding tracks apply, plus one move-specific case:

  • Added to target but not found in source playlist — the track landed in the target playlist, but wasn't actually in the source. The net effect is an add rather than a move.

Errors

CodeStatusDescription
VALIDATION_ERROR400trackIds invalid (missing/empty/non-strings/over 100), targetPlaylistId missing, or target equals the source
MOVE_FAILED400None of the tracks could be moved — see details for per-item reasons
MISSING_API_KEY401X-API-Key header was not provided
INVALID_API_KEY401API key is malformed, revoked, or does not exist
INTERNAL_ERROR500Unexpected server error

On this page