> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Update a playlist by ID

PUT https://api.fastpix.com/v1/on-demand/playlists/{playlistId}
Content-Type: application/json

This endpoint allows you to update the name and description of an existing playlist. It enables modifications to the playlist's metadata without altering the media items or playlist structure.
#### How it works

 - When a user sends a PUT request to this endpoint with the `playlistId` and updated name and description in the request body, FastPix updates the playlist metadata accordingly and returns the updated playlist details.

#### Example
An e-learning platform updates the playlist titled "Beginner Python Series" to rename it as "Python Basics" and add a more detailed description. The updated metadata is reflected when retrieving the playlist, helping users better understand the playlist content.

Reference: https://fastpix.com/docs/video-on-demand-api/playlist/update-a-playlist

## Authentication

- `Authorization` header (basic auth, required) — FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request. * Username: Access Token ID * Password: Secret Key Activate your FastPix account to generate your API credentials. See the guide here

## Request

### Path parameters

- `playlistId` (string, required) — The unique id of the playlist you want to retrieve.

### Body (application/json)

This endpoint expects an UpdatePlaylistRequest.

- `name` (string, required) — New name to the playlist.
- `description` (string, required) — Updated description to the playlist.

## Response

### 200

Playlist updated successfully

- `success` (boolean, required) — Shows the request status. Returns true for success and false for failure.
- `data` (playlistCreatedSchema, required)

## Types

### playlistCreatedSchema

- `type`: `manual` (manual)
  - `createdAt` (datetime, optional) — Timestamp of playlist creation.
  - `description` (string, optional) — Description of the playlist set by the user.
  - `id` (string, optional) — The unique id of the playlist
  - `mediaCount` (integer, optional) — No. of media present in the playlist
  - `mediaList` (list of PlaylistByIdResponseMediaListItem, optional)
  - `name` (string, optional) — The name of the playlist set by the user
  - `referenceId` (string, optional) — Unique string value assigned by user to the playlist.
  - `updatedAt` (datetime, optional) — Playlist's most recent update timestamp.
  - `workspaceId` (string, optional) — The unique id of the workspace in which the playlist is present.
- `type`: `smart` (smart)
  - `metadata` (PlaylistByIdResponseMetadata, required) — Required when the playlist type is `smart`. Media created between `startDate` and `endDate` of `createdDate` is added. Optionally, you can include media based on `updatedDate`.
  - `playOrder` (enum, required) — Determines the insertion order of media into playlist.
    - Allowed values: `createdDate ASC`, `createdDate DESC`
  - `createdAt` (datetime, optional) — Timestamp of playlist creation.
  - `description` (string, optional) — Description of the playlist set by the user.
  - `id` (string, optional) — The unique id of the playlist
  - `mediaCount` (integer, optional) — No. of media present in the playlist
  - `mediaList` (list of PlaylistByIdResponseMediaListItem, optional)
  - `name` (string, optional) — The name of the playlist set by the user
  - `referenceId` (string, optional) — Unique string value assigned by user to the playlist.
  - `updatedAt` (datetime, optional) — Playlist's most recent update timestamp.
  - `workspaceId` (string, optional) — The unique id of the workspace in which the playlist is present.

### PlaylistByIdResponseMediaListItem

- `createdAt` (datetime, optional) — Timestamp of media creation in the workspace.
- `creatorId` (string, optional, nullable) — Creator ID of the media.
- `duration` (double, optional) — Duration of the media in seconds.
- `id` (string, optional) — unique id of the particular media.
- `sourceResolution` (string, optional) — source resolution of the media.
- `status` (string, optional) — status of the media, only media with ready status is added to playlist.
- `thumbnail` (string, optional) — thumbnail for the particular media.
- `title` (string, optional, nullable) — Title of the media.

### PlaylistByIdResponseMetadata

Required when the playlist type is `smart`. Media created between `startDate` and `endDate` of `createdDate` is added. Optionally, you can include media based on `updatedDate`.

- `createdDate` (DateRange, optional) — Date range with start and end dates.
- `updatedDate` (DateRange, optional) — Date range with start and end dates.

### DateRange

Date range with start and end dates.

- `startDate` (string, optional)
- `endDate` (string, optional)

## Examples

**Request**

```json
{
  "name": "updated name",
  "description": "updated description"
}
```

**Response**

```json
{
  "success": true,
  "data": {
    "type": "smart",
    "metadata": {
      "createdDate": {
        "startDate": "2024-11-11",
        "endDate": "2024-12-12"
      },
      "updatedDate": {
        "startDate": "2024-11-11",
        "endDate": "2024-12-12"
      }
    },
    "playOrder": "createdDate ASC",
    "createdAt": "2025-06-04T13:29:39.409886Z",
    "description": "This is a playlist",
    "id": "e3dfdf15-16bb-4835-98b9-484c1e4320cc",
    "mediaCount": 3,
    "mediaList": [
      {
        "createdAt": "2024-11-12T05:58:38.000708Z",
        "creatorId": "FastPix@14612",
        "duration": 10.5,
        "id": "942e0ced-146b-487e-988f-6de578de1000",
        "sourceResolution": "1080p",
        "status": "Ready",
        "thumbnail": "https://venus-images.fastpix.dev/ff31b32e-4979-4d2b-ad2a-685af43c9902/thumbnail.png",
        "title": "Media 1"
      },
      {
        "createdAt": "2024-12-05T07:23:18.000108Z",
        "creatorId": "FastPix@14612",
        "duration": 10.5,
        "id": "6d12262b-0686-4131-9de2-bb515f7c0f38",
        "sourceResolution": "1080p",
        "status": "Ready",
        "thumbnail": "https://mercury-images.fastpix.dev/e49a0d7b-6f2c-4743-84d1-45522cc20ded/thumbnail.png",
        "title": "Media 2"
      },
      {
        "createdAt": "2024-12-05T07:21:15.000508Z",
        "creatorId": "FastPix@14612",
        "duration": 10.5,
        "id": "a1cd180e-f9b5-4e99-9d44-b9c9baabad89",
        "sourceResolution": "1080p",
        "status": "Ready",
        "thumbnail": "https://mercury-images.fastpix.dev/e49a0d7b-6f2c-4743-84d1-45522cc20ded/thumbnail.png",
        "title": "Media 3"
      }
    ],
    "name": "playist",
    "referenceId": "a1",
    "updatedAt": "2025-06-04T13:29:39.409886Z",
    "workspaceId": "d760b903-86ef-44d6-9b73-334130e0cf2d"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.fastpix.com/v1/on-demand/playlists/playlistId"

payload = {
    "name": "updated name",
    "description": "updated description"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.fastpix.com/v1/on-demand/playlists/playlistId';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'PUT',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"name":"updated name","description":"updated description"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fastpix.com/v1/on-demand/playlists/playlistId"

	payload := strings.NewReader("{\n  \"name\": \"updated name\",\n  \"description\": \"updated description\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fastpix.com/v1/on-demand/playlists/playlistId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"updated name\",\n  \"description\": \"updated description\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.fastpix.com/v1/on-demand/playlists/playlistId")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"updated name\",\n  \"description\": \"updated description\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.fastpix.com/v1/on-demand/playlists/playlistId', [
  'body' => '{
  "name": "updated name",
  "description": "updated description"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.fastpix.com/v1/on-demand/playlists/playlistId");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.PUT);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"updated name\",\n  \"description\": \"updated description\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "updated name",
  "description": "updated description"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fastpix.com/v1/on-demand/playlists/playlistId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```