> ## Documentation Index
> Fetch the complete documentation index at: https://creatorinsights.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube Playlists

Retrieves the playlists for your connected YouTube channel so you can categorize uploaded videos or Shorts.

Included at zero credits with an active paid plan.

> [!NOTE]
>
> Examples use illustrative values. The playground sends a real request. Intelligence can consume plan credits. Publishing examples save drafts.

## Endpoint

**GET** `https://api.creatorinsights.in/v1/youtube/playlists`

**Content type:** Query parameters; no JSON request body.

[**Authentication:** `x-api-key: YOUR_SAVED_API_KEY`](https://creatorinsights.mintlify.site/mcp-setup)

For paid MCP calls in an organization with multiple workspaces, pass the intended `workspace` ID. Calls without it are rejected before execution.

## Request parameters

**MCP tool:** `get_youtube_playlists`. See [MCP Setup](https://creatorinsights.mintlify.site/mcp-setup.md) for AI clients.

## Request parameters

**account\_id** `string`

Active workspace ID or current name in your organization. Optional header alternative to passing workspace in the querySpecific YouTube account ID if multiple channels are connected

**workspace** `string`

Owned workspace ID, current name, or immutable publishing key. Omit to use the credential's assigned workspace; a legacy unbound key uses the primary workspace. The browser selection is not inferred.

## Request example

Send these arguments as URL query parameters.

```json theme={null}
{}
```

```bash cURL theme={null}
curl --get 'https://api.creatorinsights.in/v1/youtube/playlists' \
  -H "x-api-key: $CREATOR_INSIGHTS_API_KEY"
```

```javascript Node.js theme={null}
const parameters = {};
const url = new URL('https://api.creatorinsights.in/v1/youtube/playlists');
for (const [name, value] of Object.entries(parameters)) url.searchParams.set(name, String(value));
const response = await fetch(url, { headers: { 'x-api-key': process.env.CREATOR_INSIGHTS_API_KEY } });
const raw = await response.text();
let result;
try { result = JSON.parse(raw); } catch { throw new Error('Non-JSON response: ' + response.status); }
if (!response.ok || result.success === false) throw new Error(result.message || result.error || 'Request failed');
console.log(result.data);
```

```python Python theme={null}
import json, os, requests

arguments = json.loads("{}")
response = requests.get("https://api.creatorinsights.in/v1/youtube/playlists",
    headers={"x-api-key": os.environ["CREATOR_INSIGHTS_API_KEY"]},
    params=arguments, timeout=120)
response.raise_for_status()
result = response.json()
print(result["data"])
```

## Response example

HTTP 200. Illustrative dummy values; optional fields can be omitted, null, or empty. Additional platform fields may be returned. Field names are preserved by the API.

```json Success theme={null}
{
  "success": true,
  "data": {
    "success": true,
    "account_id": "507f1f77bcf86cd799439011",
    "workspace": "Default",
    "playlists": []
  }
}
```

## Response fields

**account\_id** `string`

Specific YouTube account ID if multiple channels are connected

**workspace** `string`

Workspace ID, current name, or immutable publishing key in the authenticated organization. Required for paid requests when more than one active workspace exists; pass an active workspace to select its accounts and data. Discover IDs with list\_workspaces; reuse the selected canonical ID throughout the workflow.

## Request example

Send these arguments as URL query parameters.

```json theme={null}
{
  "workspace": "YOUR_WORKSPACE_ID_OR_CURRENT_NAME"
}
```

```bash cURL theme={null}
curl --get 'https://api.creatorinsights.in/v1/youtube/playlists' \
  -H "x-api-key: $CREATOR_INSIGHTS_API_KEY" \
  --data-urlencode 'workspace=YOUR_WORKSPACE_ID_OR_CURRENT_NAME'
```

```javascript Node.js theme={null}
const parameters = {
  "workspace": "YOUR_WORKSPACE_ID_OR_CURRENT_NAME"
};
const url = new URL('https://api.creatorinsights.in/v1/youtube/playlists');
for (const [name, value] of Object.entries(parameters)) url.searchParams.set(name, String(value));
const response = await fetch(url, { headers: { 'x-api-key': process.env.CREATOR_INSIGHTS_API_KEY } });
const raw = await response.text();
let result;
try { result = JSON.parse(raw); } catch { throw new Error('Non-JSON response: ' + response.status); }
if (!response.ok || result.success === false) throw new Error(result.message || result.error || 'Request failed');
console.log(result.data);
```

```python Python theme={null}
import json, os, requests

arguments = json.loads("{\"workspace\":\"YOUR_WORKSPACE_ID_OR_CURRENT_NAME\"}")
response = requests.get("https://api.creatorinsights.in/v1/youtube/playlists",
    headers={"x-api-key": os.environ["CREATOR_INSIGHTS_API_KEY"]},
    params=arguments, timeout=120)
response.raise_for_status()
result = response.json()
print(result["data"])
```

## Response example

HTTP 200. Illustrative values; optional fields can be omitted, null, or empty. Additional platform fields may be returned.

```json Success theme={null}
{
  "success": true,
  "data": {
    "success": true,
    "account_id": "507f1f77bcf86cd799439011",
    "workspace": "Default",
    "playlists": []
  }
}
```

## Response fields

**success** `boolean` *required*

Whether this operation succeeded. Also check HTTP status and nested platform statuses.

**data** `object` *required*

Operation-specific payload. See the nested field table and response example below.

| Field | Type | Description |
| - | - | - |
| `success` | boolean | Example response field. Availability depends on the record and selected options. |
| `data` | object | Nested object. Expand the response schema for its fields. |
| `data.success` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.account_id` | string | Example response field. Availability depends on the record and selected options. |
| `data.workspace` | string | Example response field. Availability depends on the record and selected options. |
| `data.playlists` | array | List of returned entries; may be empty. |

**data** `object` *required*

Operation-specific payload. See the nested field table and response example below.

| Field | Type | Description |
| - | - | - |
| `success` | boolean | Example response field. Availability depends on the record and selected options. |
| `data` | object | Nested object. Expand the response schema for its fields. |
| `data.success` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.account_id` | string | Example response field. Availability depends on the record and selected options. |
| `data.workspace` | string | Example response field. Availability depends on the record and selected options. |
| `data.playlists` | array | List of returned entries; may be empty. |

The interactive schema includes deeper nested fields. Sample fields are descriptive, not a promise that every record includes them.

## n8n and JSON tool endpoint

**POST** `https://api.creatorinsights.in/api/v1/tools/get_youtube_playlists`. Use Header Auth with `x-api-key` and body content type JSON. This alias always returns the n8n envelope below, including zero `credits_deducted` for included operations.

## n8n and JSON tool endpoint

**POST** `https://api.creatorinsights.in/api/v1/tools/get_youtube_playlists`. Use Header Auth with `x-api-key` and body content type JSON. This alias returns the n8n envelope below; included operations can report zero credits\_deducted.

```bash theme={null}
curl -X POST 'https://api.creatorinsights.in/api/v1/tools/get_youtube_playlists' \
  -H "x-api-key: $CREATOR_INSIGHTS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{\"workspace\":\"YOUR_WORKSPACE_ID_OR_CURRENT_NAME\"}'
```

```json theme={null}
{
  "status": true,
  "tool": "get_youtube_playlists",
  "credits_deducted": 0,
  "data": {
    "success": true,
    "account_id": "507f1f77bcf86cd799439011",
    "workspace": "Default",
    "playlists": []
  }
}
```

## Errors

Handle non-2xx responses before mapping data. Error codes vary with the cause; these are representative examples. A 429 response may be plain text. Never treat a queued post as published or blindly retry a partial publication.

```json theme={null}
{
  "success": false,
  "error": "UNAUTHORIZED",
  "message": "Missing or invalid API key"
}
```

| HTTP status | Meaning |
| - | - |
| 400 | Invalid arguments |
| 401 | Missing or invalid API key |
| 402 | Insufficient Creator Insights plan credits |
| 403 | Subscription or permission required |
| 404 | Resource not found |
| 409 | Conflicting request, idempotency key, or unfinished upload |
| 410 | Managed media expired; upload the file again |
| 413 | Media too large |
| 415 | Unsupported media type |
| 422 | Account selection, connection, or platform payload needs attention |
| 500 | Authentication or server error |
| 503 | Service temporarily unavailable or operation failed; inspect saved status before retrying |
| 429 | Rate limit; inspect response headers and retry later. |

```json theme={null}
{
  "status": true,
  "tool": "get_youtube_playlists",
  "credits_deducted": 0,
  "data": {
    "success": true,
    "account_id": "507f1f77bcf86cd799439011",
    "workspace": "Default",
    "playlists": []
  }
}
```

## Errors

Handle non-2xx responses before mapping data. Error codes vary with the cause; these are representative examples. A 429 response may be plain text. Never treat a queued post as published or blindly retry a partial publication.

```json theme={null}
{
  "success": false,
  "error": "UNAUTHORIZED",
  "message": "Missing or invalid API key"
}
```

| HTTP status | Meaning |
| - | - |
| 400 | Invalid arguments |
| 401 | Missing or invalid API key |
| 402 | Insufficient Creator Insights plan credits |
| 403 | Subscription or permission required |
| 404 | Resource not found |
| 409 | Conflicting request or idempotency key |
| 413 | Media too large |
| 415 | Unsupported media type |
| 422 | Account selection, connection, or platform payload needs attention |
| 500 | Authentication or server error |
| 503 | Service temporarily unavailable or operation failed; inspect saved status before retrying |
| 429 | Rate limit; inspect response headers and retry later. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.