Skip to content

Reorder a collection

Reorder the tracks in a collection owned by the caller. Each track's new position is its index in the ordered_track_ids array (zero-based). Ids that are not in the collection are ignored.

PATCHhttps://api.aitronos.com/v1/music/{organization_id}/collections/{collection_id}/order

Returns 404 if the collection is not owned by the caller.

Path parameters

organization_id string required

The organization that owns the collection.

collection_id string required

The collection id (mcoll_).

Request Body

ordered_track_ids array required

An array of track ids (mtrack_) in the desired order. Each track is moved to the position matching its index in the array (zero-based). Ids not currently in the collection are ignored.

Returns

A mutation acknowledgement with success, id (the collection id), and detail.

cURL
curl -X PATCH "https://api.aitronos.com/v1/music/org_abc123/collections/mcoll_4a1f9c7e2b8d/order" \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ordered_track_ids": ["mtrack_1b9c4e7f2a6d", "mtrack_8d2e1f6a3c9b"] }'

Response:

200 OK
{
  "success": true,
  "id": "mcoll_4a1f9c7e2b8d",
  "detail": "Collection reordered."
}