> 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.

# Get all playlists

GET https://api.fastpix.com/v1/on-demand/playlists

This endpoint retrieves all playlists in a specified workspace. It allows you to view the collection of manual and smart playlists along with their associated metadata.
#### How it works

 - When a user sends a GET request to this endpoint, FastPix returns a list of all playlists in the workspace, including details such as playlist IDs, titles, creation mode (manual or smart), and other relevant metadata.

#### Example

  An e-learning platform requests all playlists within a workspace to display an overview of available learning paths. The response includes multiple playlists like "Beginner Python Series" and "Advanced Java Tutorials," enabling the platform to show users a catalog of curated content collections.

Reference: https://fastpix.com/docs/video-on-demand-api/playlist/get-all-playlists

## 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

### Query parameters

- `limit` (integer, optional, default: 10) — The number of playlists to return (default is 10, max is 50).
- `offset` (integer, optional, default: 1) — The page number to retrieve, starting from 1. Use this parameter to paginate the playlist results.

## Response

### 200

Successfully retrieved all playlists

- `success` (boolean, required) — Shows the request status. Returns true for success and false for failure.
- `data` (list of PlaylistItem, required)
- `pagination` (Pagination, optional) — Pagination organizes content into pages for better readability and navigation.

## Types

### PlaylistItem

- `id` (string, optional) — The unique id of the playlist
- `name` (string, optional) — The name of the playlist set by the user
- `type` (enum, optional) — type of the playlist, when it was created
  - Allowed values: `manual`, `smart`
- `referenceId` (string, optional) — Unique string value assigned by user to the playlist.
- `createdAt` (datetime, optional) — Timestamp of playlist creation.
- `mediaCount` (integer, optional) — No. of media present in the playlist

### Pagination

Pagination organizes content into pages for better readability and navigation.

- `totalRecords` (integer, optional) — The total number of records matching the request, across all pages.
- `currentOffset` (integer, optional) — The page returned by this response. Pages are numbered from 1, so the first page has a `currentOffset` of 1.
- `offsetCount` (integer, optional) — The total number of pages: `totalRecords` divided by `limit`, rounded up.

## Examples

**Response**

```json
{
  "success": true,
  "data": [
    {
      "id": "db6e860f-cb57-43dd-8acf-39c9effd5608",
      "name": "playist1",
      "type": "smart",
      "referenceId": "playlists101",
      "createdAt": "2025-06-04T13:29:04.253244Z",
      "mediaCount": 0
    },
    {
      "id": "5c18559f-c1b1-4697-9282-77211d4396bb",
      "name": "playist2",
      "type": "smart",
      "referenceId": "playlists102",
      "createdAt": "2025-06-04T13:01:05.073809Z",
      "mediaCount": 0
    },
    {
      "id": "a4735902-b5e6-431f-8875-7a1a2cbc7a7b",
      "name": "Onboarding",
      "type": "manual",
      "referenceId": "playlists103",
      "createdAt": "2025-06-04T12:17:38.917664Z",
      "mediaCount": 0
    },
    {
      "id": "1ffce718-7072-4b61-9b27-e7d18198094d",
      "name": "December playlist",
      "type": "manual",
      "referenceId": "playlists104",
      "createdAt": "2025-05-15T11:06:51.545280Z",
      "mediaCount": 0
    },
    {
      "id": "2455174e-64d9-4324-86bd-80cb1af5b20a",
      "name": "March Highlights",
      "type": "smart",
      "referenceId": "playlists105",
      "createdAt": "2025-05-12T12:55:24.368182Z",
      "mediaCount": 9
    },
    {
      "id": "d55c4e51-e426-498f-b760-6f9357e2349e",
      "name": "playlist1",
      "type": "smart",
      "referenceId": "playlists106",
      "createdAt": "2025-05-07T10:49:29.226943Z",
      "mediaCount": 9
    },
    {
      "id": "63d73b6e-50dd-4653-990b-8a8df85ad09f",
      "name": "playlist1",
      "type": "smart",
      "referenceId": "playlists107",
      "createdAt": "2025-05-07T10:48:09.179324Z",
      "mediaCount": 9
    },
    {
      "id": "5a93de86-0848-4ab4-befe-8dba4b8433e5",
      "name": "playlist1",
      "type": "smart",
      "referenceId": "playlists108",
      "createdAt": "2025-05-07T10:47:06.339271Z",
      "mediaCount": 9
    },
    {
      "id": "d315b847-38c4-431f-b1b6-32dc5013700a",
      "name": "playlist1",
      "type": "smart",
      "referenceId": "playlists109",
      "createdAt": "2025-05-07T10:03:21.487649Z",
      "mediaCount": 9
    },
    {
      "id": "86348042-6367-4dfc-b018-b3ee9934f45b",
      "name": "playlist1",
      "type": "manual",
      "referenceId": "playlists201",
      "createdAt": "2025-05-05T12:48:44.177451Z",
      "mediaCount": 2
    }
  ],
  "pagination": {
    "totalRecords": 46,
    "currentOffset": 1,
    "offsetCount": 5
  }
}
```

**SDK Code**

```python
import requests

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

response = requests.get(url, auth=("<username>", "<password>"))

print(response.json())
```

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

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

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"
	"net/http"
	"io"
)

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	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")

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

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

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.get("https://api.fastpix.com/v1/on-demand/playlists")
  .basicAuth("<username>", "<password>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fastpix.com/v1/on-demand/playlists', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

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

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

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

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let headers = ["Authorization": "Basic \(credentials)"]

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

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()
```