API Reference

Pagination

How the list endpoints page through results with pageSize and pageToken.

Every list endpoint pages the same way, with a pageSize and a pageToken query parameter.

ParameterTypeDescription
pageSizeintegerResults per page, from 1 to 100. Defaults to 50.
pageTokenstringThe nextPageToken from the previous response, unchanged.

Each response carries a nextPageToken:

{
  "collections": [],
  "nextPageToken": "eyJvZmZzZXQiOjUwfQ"
}

When nextPageToken is null, you have reached the last page.

Tokens are opaque

Pass nextPageToken back exactly as you received it. Do not decode, modify, or construct one — the format is not part of the API and can change.

Fetching every page

async function listAllCollections(apiToken) {
  const collections = []
  let pageToken = null

  do {
    const url = new URL('https://api.superfunnel.ai/v1/cms/collections')
    url.searchParams.set('pageSize', '100')
    if (pageToken) url.searchParams.set('pageToken', pageToken)

    const response = await fetch(url, {
      headers: { 'x-api-key': `Bearer ${apiToken}` },
    })

    if (!response.ok) {
      throw new Error(`Request failed with ${response.status}`)
    }

    const page = await response.json()
    collections.push(...page.collections)
    pageToken = page.nextPageToken
  } while (pageToken)

  return collections
}

Use the largest page size you can handle

Requesting 100 results per page uses a fifth of the requests that 20 per page would, which matters against the shared CMS rate limit.

Only active records are returned. Deleted collections and entries never appear in a list response.