Channels

List channels

Retrieve a paginated list of all channels in your account.

http
GET /v1/channels

Authorization header:

http
Authorization: Bearer YOUR_API_KEY

Query Parameters

Parameter / Type / Required / Default / Description
ParameterTypeRequiredDefaultDescription
pageintegerNo1Page number for pagination
sizeintegerNo50Number of results per page (max: 100)
sortstringNo""Sort order (e.g., created, -created for descending)

Response

Success Response

Status Code: 200 OK

json
{
  "pager": {
    "page": 1,
    "totalPages": 5,
    "totalResults": 47,
    "sort": ""
  },
  "channels": [
    {
      "id": "abc123xyz",
      "key": "ch_def456",
      "name": "Product Tutorials",
      "description": "Video tutorials for our product lineup",
      "accountId": "acc_789",
      "version": 1,
      "planType": 2,
      "templateKey": "tmpl_modern",
      "status": 1,
      "created": "2024-01-15T10:30:00Z",
      "updated": "2024-01-20T14:45:00Z"
    },
    {
      "id": "xyz789abc",
      "key": "ch_ghi012",
      "name": "Marketing Videos",
      "description": "Promotional content and ads",
      "accountId": "acc_789",
      "version": 1,
      "planType": 2,
      "templateKey": "tmpl_light",
      "status": 1,
      "created": "2024-01-10T08:15:00Z",
      "updated": "2024-01-18T11:30:00Z"
    }
  ]
}

Response Fields

Pager Object

Field / Type / Description
FieldTypeDescription
pageintegerCurrent page number
totalPagesintegerTotal number of pages available
totalResultsintegerTotal number of channels in your account
sortstringApplied sort order

Channel Object

Field / Type / Description
FieldTypeDescription
idstringInternal channel identifier
keystringPublic channel key (use for embedding)
namestringChannel display name
descriptionstringChannel description
accountIdstringOwner account identifier
versionintegerChannel version number
planTypeintegerAssociated plan type
templateKeystringApplied template key
statusintegerChannel status (1 = Published)
createddatetimeCreation timestamp (ISO 8601)
updateddatetimeLast update timestamp (ISO 8601)

Error Responses

Status Code / Description
Status CodeDescription
401Unauthorized - Invalid or missing API key
500Internal Server Error

Code Examples

bash
curl -X GET "https://api.dyntube.com/v1/channels?page=1&size=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
javascript
const response = await fetch(
  'https://api.dyntube.com/v1/channels?page=1&size=20',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const data = await response.json();
console.log(`Found ${data.pager.totalResults} channels`);

data.channels.forEach(channel => {
  console.log(`- ${channel.name} (${channel.key})`);
});
python
import requests

response = requests.get(
    'https://api.dyntube.com/v1/channels',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={'page': 1, 'size': 20}
)

data = response.json()
print(f"Found {data['pager']['totalResults']} channels")

for channel in data['channels']:
    print(f"- {channel['name']} ({channel['key']})")
php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dyntube.com/v1/channels?page=1&size=20');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
echo "Found " . $data['pager']['totalResults'] . " channels\n";

foreach ($data['channels'] as $channel) {
    echo "- " . $channel['name'] . " (" . $channel['key'] . ")\n";
}
csharp
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");

var response = await client.GetAsync("https://api.dyntube.com/v1/channels?page=1&size=20");
var body = await response.Content.ReadAsStringAsync();
System.Console.WriteLine(body);

Pagination Example

javascript
async function getAllChannels() {
  const allChannels = [];
  let page = 1;
  let totalPages = 1;

  do {
    const response = await fetch(
      `https://api.dyntube.com/v1/channels?page=${page}&size=50`,
      {
        headers: {
          'Authorization': 'Bearer YOUR_API_KEY'
        }
      }
    );

    const data = await response.json();
    allChannels.push(...data.channels);
    totalPages = data.pager.totalPages;
    page++;
  } while (page <= totalPages);

  return allChannels;
}

See Also

  • Get Channel - Retrieve a single channel
  • Create Channel - Create a new channel
  • Channels API Overview - API overview and authentication

Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.