PUT /playlists/{playlistId}

Kompletní nahrazení playlistu (PUT). Přístup jen pro admina nebo vlastníka playlistu.

Path parameters

  • playlistId string Required

    Unikátní ID playlistu

application/json

Body Required

  • name string
  • userId string

Responses

  • 200 application/json

    Playlist úspěšně upraven.

    Hide response attributes Show response attributes object
    • id
    • name string
    • userId string
    • songIds array[string]
    • songCount integer
  • 400 application/json

    Chyba v požadavku klienta

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 401 application/json

    Chyba autentizace

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 403 application/json

    Nedostatečná oprávnění

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 404 application/json

    Zdroj nenalezen

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 422 application/json

    Validační chyba (chybný formát dat)

    Hide response attributes Show response attributes object
    • code string
    • message string
    • errors array[object]

      Pole konkrétních chyb validace

      Hide errors attributes Show errors attributes object
      • field string

        Název chybného pole

      • message string

        Popis chyby

  • 500 application/json

    Chyba serveru

    Hide response attributes Show response attributes object
    • code string
    • message string
PUT /playlists/{playlistId}
curl \
 --request PUT 'https://api.mstonjek.cz/v1/playlists/playlist_001' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"string","userId":"string"}'
Request examples
{
  "name": "string",
  "userId": "string"
}
Response examples (200)
{
  "id": "8d3f7e7a-6a6b-4b99-9b52-6f9d7d2a0a11",
  "name": "Chill Vibes",
  "userId": "user_123",
  "songIds": [
    "song_123",
    "song_456"
  ],
  "songCount": 2
}
Response examples (400)
{
  "code": "BAD_REQUEST",
  "message": "Neplatný formát dat v těle požadavku."
}
Response examples (401)
{
  "code": "UNAUTHORIZED",
  "message": "Token není platný"
}
Response examples (403)
{
  "code": "FORBIDDEN",
  "message": "Nemáte oprávnění"
}
Response examples (404)
{
  "code": "NOT_FOUND",
  "message": "Zdroj uživatel 'user_123' nebyl nalezen."
}
Response examples (422)
{
  "code": "VALIDATION_FAILED",
  "message": "Vstupní data obsahují chyby.",
  "errors": [
    {
      "field": "email",
      "message": "Emailová adresa není platná."
    }
  ]
}
Response examples (500)
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Server momentálně nedostupný"
}