Freedam

Published URLs

A publication channel of the type Website gives each asset it publishes stable public URLs: an image at the sizes and crops the channel allows, a video player and HLS stream, a document's file, PDF and viewer. Administrators set up channels in Admin → Publishing (see Publishing).

The API lists these URLs, so a website or a back office can find every published image, video and document of a product, a product line or a campaign, without anyone copying links from the asset page.

  • The URLs do not expire. They carry a signature for the channel and the asset, not for a user or a date. Store them with your content and use them on every page view; do not call the API each time a page is shown.
  • The URLs need no token. Your visitors' browsers load them directly. The API token is only needed to list them.
  • The URLs always serve the current version of the asset. A new version replaces the old one at the same URL.

Endpoints

Method Path Description
GET /api/v1/publications/channels The website channels.
GET /api/v1/publications/channels/{channelKey}/assets The assets a channel publishes, with their published URLs, paginated.
GET /api/v1/assets/{gaid}/publications The publications of one asset, one per website channel.

All three need a token with the publications:read ability (see Authentication), and the token's user needs the assets.view permission. Lists only include assets that user may view; an asset they may not view answers 404 on /assets/{gaid}/publications, exactly like an asset that does not exist. A workspace without the Publishing feature answers 403 with "code": "feature_unavailable". Microsoft 365 channels are not listed: their URLs are for Microsoft.

Each request counts against the API rate limit of 60 requests per minute per token (see Rate Limiting). The published URLs themselves are not counted against it.

Channels

curl https://acme.freedam.io/api/v1/publications/channels \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
{
    "data": [
        {
            "key": "k3j9x2m1p0qa",
            "name": "Corporate website",
            "asset_types": ["image", "video", "document"],
            "widths": [128, 256, 512, 1024, 2048],
            "max_width": 2048,
            "formats": [
                { "name": "hero", "ratio": "16:9", "ratio_width": 16, "ratio_height": 9 },
                { "name": "card", "ratio": "1:1", "ratio_width": 1, "ratio_height": 1 }
            ],
            "is_serving": true
        }
    ]
}
Field Description
key The channel's identifier, in the API paths and in its published URLs.
asset_types The types the channel publishes. A channel with a watermark publishes images only.
widths, max_width The widths, in pixels, its image URLs serve.
formats The crop formats an administrator declared, used with fmt= in image URLs.
is_serving false while the channel is turned off: its URLs then answer 404, and its assets have the status channel_stopped.

Assets of a channel

GET /api/v1/publications/channels/{channelKey}/assets takes the search parameters of GET /api/v1/assets (q, filters, mime_type, asset_class_id, sort_by, sort_direction, page, per_page up to 100) and these:

Parameter Description
type image, video or document.
gaids[] Only these assets, up to 100 GAIDs. Unknown GAIDs and assets you may not view are left out.
published_since Only assets published on the channel at or after this date, in ISO 8601. A value without a UTC offset is read as UTC.
status serving (default), rights_expired, not_eligible, channel_stopped or all. See Status.

An unknown channel key, or the key of a channel that is not a website channel, answers 404.

Each asset has its descriptive fields (gaid, title, description, alt_text, mime_type, type, file_size, width, height, keywords, metadata, updated_at) and a publication object. Unlike GET /api/v1/assets, there is no media_urls: those URLs are signed for one user and expire after an hour.

Publications of one asset

GET /api/v1/assets/{gaid}/publications returns one publication object per website channel that publishes the asset and whose URLs answer now, with the channel's name in channel_name. An asset no channel publishes returns an empty data list.

The publication object

Field Types Description
channel all The channel key.
status all serving, rights_expired, not_eligible or channel_stopped.
source all rule when the channel's conditions selected the asset, explicit when a person published it.
published_at all When the asset was published on the channel.
duties all Rights duties that applied when it was published, such as attribution: show the credit next to the asset.
url all The image at the channel's largest width, the video player, or the document's original file.
url_template all The image URL with a literal {options} segment. See Image options.
widths all The widths url_template serves for this asset, smallest first: the channel's widths up to the original's width.
formats all { name, ratio, url } for each channel format, at the channel's largest width.
focus_point all { x, y } in percent from the top-left corner, or null.
thumbnail_url all The image at the smallest channel width of at least 400 pixels.
player_url, embed_html, stream_url, poster_url, duration, subtitles video The player page, a responsive <iframe> of it, the HLS master playlist, the poster image, the duration in seconds and the subtitle tracks { language, label, url, is_default }.
download_url, pdf_url, preview_url, viewer_url, embed_html, page_count, extension document The original file, its PDF (the original for a PDF, null for an office file without a converted PDF), the first page as an image, the page-by-page viewer and its <iframe> (null without a PDF), the number of pages and the file extension.

For a video, the image fields are its poster; for a document, its first page. The fields have the same names as the Freedam Picker payload.

Status

status tells whether the published URLs answer now.

Status The URLs answer When
serving the file The asset is published and its rights allow the channel.
rights_expired 410 Gone The asset's rights policy reached its end date. They serve the file again, at the same URL, when the policy is renewed.
not_eligible 404 The channel does not publish this type (for example a video on a channel with a watermark), or the asset's rights do not allow the channel's use.
channel_stopped 404 The channel is turned off. Every asset of the channel has this status until an administrator turns it on again; the URLs then answer again, unchanged.

The list of a channel returns only serving assets unless you ask for another status; status=all returns every asset the channel publishes, with its status.

Image options

url_template contains the literal text {options}. Replace it with comma-separated options to get any size or crop; the signature stays valid, so you need no call to the API.

Option Example Effect
w w=800 Width, served at the smallest channel width at least as wide.
h w=800,h=450 Height, with w only: the image is cropped to the ratio around the focus point.
fmt w=1024,fmt=hero The ratio of a channel format. Not with h.
f f=webp File format: avif, webp, jpeg, png. Without it, the browser gets the best format it accepts.

Full rules: Published URL options.

Examples

The examples use the TypeScript SDK (see Official SDKs):

import { FreedamClient } from '@freedam/sdk';

const client = new FreedamClient({
    baseUrl: 'https://acme.freedam.io',
    token: process.env.FREEDAM_TOKEN!,
});

Your products carry a sku metadata field. List what the website channel publishes for one SKU and group it by type: images for the gallery, videos for the player, documents for the downloads.

curl -G https://acme.freedam.io/api/v1/publications/channels/k3j9x2m1p0qa/assets \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode 'filters={"type":"filter","field":"metadata.sku","operator":"equals","value":"SKU-1042"}' \
  --data-urlencode 'per_page=100'
{
    "data": [
        {
            "gaid": "IM-20260309-UDXZH8PP6VPW",
            "title": "Taper bowl, front",
            "alt_text": "White ceramic bowl on an oak table",
            "type": "image",
            "width": 6000,
            "height": 4000,
            "metadata": [{ "key": "sku", "value": "SKU-1042", "vocabulary_term_id": null, "language": null }],
            "publication": {
                "channel": "k3j9x2m1p0qa",
                "status": "serving",
                "url": "https://acme.freedam.io/i/w=2048/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e",
                "url_template": "https://acme.freedam.io/i/{options}/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e",
                "widths": [128, 256, 512, 1024, 2048],
                "thumbnail_url": "https://acme.freedam.io/i/w=512/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e"
            }
        },
        {
            "gaid": "VI-20260310-K2M8QW4RT7ZA",
            "title": "Taper bowl, turntable",
            "type": "video",
            "publication": {
                "channel": "k3j9x2m1p0qa",
                "status": "serving",
                "player_url": "https://acme.freedam.io/v/VI-20260310-K2M8QW4RT7ZA/k3j9x2m1p0qa/9a7d41"
            }
        }
    ],
    "meta": { "current_page": 1, "last_page": 1, "per_page": 100, "total": 2 }
}
const sku = 'SKU-1042';
const assets = await client.publications.allAssets('k3j9x2m1p0qa', {
    filters: JSON.stringify({ type: 'filter', field: 'metadata.sku', operator: 'equals', value: sku }),
    per_page: 100,
});

const gallery = {
    images: assets.filter((asset) => asset.type === 'image'),
    videos: assets.filter((asset) => asset.type === 'video'),
    documents: assets.filter((asset) => asset.type === 'document'),
};

2. Responsive images and crops

Build srcset from url_template and widths, so the browser picks the size it needs. A 16:9 crop comes from a channel format with fmt=, or from w and h.

curl -G https://acme.freedam.io/api/v1/publications/channels/k3j9x2m1p0qa/assets \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode 'gaids[]=IM-20260309-UDXZH8PP6VPW'
{
    "data": [
        {
            "gaid": "IM-20260309-UDXZH8PP6VPW",
            "alt_text": "White ceramic bowl on an oak table",
            "publication": {
                "url_template": "https://acme.freedam.io/i/{options}/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e",
                "widths": [128, 256, 512, 1024, 2048],
                "formats": [
                    { "name": "hero", "ratio": "16:9", "url": "https://acme.freedam.io/i/w=2048,fmt=hero/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e" }
                ],
                "focus_point": { "x": 45.2, "y": 38.7 }
            }
        }
    ]
}
import type { PublishedAsset } from '@freedam/sdk';

function responsiveImage(asset: PublishedAsset, sizes: string): string {
    const { url_template, widths } = asset.publication;
    const src = (options: string) => url_template.replace('{options}', options);
    const srcset = widths.map((width) => `${src(`w=${width}`)} ${width}w`).join(', ');

    return `<img src="${src('w=1024')}" srcset="${srcset}" sizes="${sizes}" alt="${asset.alt_text ?? ''}">`;
}

// A 16:9 banner: the channel's "hero" format at each width.
function heroSrcset(asset: PublishedAsset): string {
    const { url_template, widths } = asset.publication;

    return widths.map((width) => `${url_template.replace('{options}', `w=${width},fmt=hero`)} ${width}w`).join(', ');
}

Without a channel format, w=1280,h=720 gives the same 16:9 crop, centred on the asset's focus point.

3. Video: iframe or your own player

embed_html is a responsive <iframe> of the channel's player. For your own player, stream_url is an HLS master playlist, poster_url a still image and subtitles the WebVTT tracks.

curl -G https://acme.freedam.io/api/v1/publications/channels/k3j9x2m1p0qa/assets \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode 'type=video'
{
    "data": [
        {
            "gaid": "VI-20260310-K2M8QW4RT7ZA",
            "title": "Taper bowl, turntable",
            "type": "video",
            "publication": {
                "player_url": "https://acme.freedam.io/v/VI-20260310-K2M8QW4RT7ZA/k3j9x2m1p0qa/9a7d41",
                "embed_html": "<div style=\"position:relative;padding-bottom:56.25%;height:0\"><iframe src=\"https://acme.freedam.io/v/VI-20260310-K2M8QW4RT7ZA/k3j9x2m1p0qa/9a7d41\" …></iframe></div>",
                "stream_url": "https://acme.freedam.io/v/VI-20260310-K2M8QW4RT7ZA/k3j9x2m1p0qa/9a7d41/hls/master.m3u8",
                "poster_url": "https://acme.freedam.io/i/w=1024/VI-20260310-K2M8QW4RT7ZA/k3j9x2m1p0qa/9a7d41",
                "duration": 42,
                "subtitles": [
                    { "language": "fr", "label": "Français", "url": "https://acme.freedam.io/v/VI-20260310-K2M8QW4RT7ZA/k3j9x2m1p0qa/9a7d41/subtitles/fr.vtt", "is_default": true }
                ]
            }
        }
    ]
}
import Hls from 'hls.js';

const [video] = (await client.publications.assets('k3j9x2m1p0qa', { type: 'video', per_page: 1 })).data;
const publication = video.publication;

// The channel's player, in an iframe.
document.querySelector('#player')!.innerHTML = publication.embed_html ?? '';

// Your own player.
const element = document.querySelector<HTMLVideoElement>('#custom-player')!;
element.poster = publication.poster_url ?? '';
for (const track of publication.subtitles ?? []) {
    const node = Object.assign(document.createElement('track'), {
        kind: 'subtitles',
        src: track.url,
        srclang: track.language,
        label: track.label,
        default: track.is_default,
    });
    element.appendChild(node);
}

if (element.canPlayType('application/vnd.apple.mpegurl')) {
    element.src = publication.stream_url ?? ''; // Safari plays HLS natively
} else if (Hls.isSupported()) {
    const hls = new Hls();
    hls.loadSource(publication.stream_url ?? '');
    hls.attachMedia(element);
}

Which websites may show the player in an iframe is set on the channel, under Sites allowed to embed the video player (see Publishing).

4. Spec sheets of a product line

List the documents of a product line and offer each as a download, with its PDF when the original is an office file.

curl -G https://acme.freedam.io/api/v1/publications/channels/k3j9x2m1p0qa/assets \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode 'type=document' \
  --data-urlencode 'filters={"type":"filter","field":"metadata.product_line","operator":"equals","value":"Taper"}'
{
    "data": [
        {
            "gaid": "DO-20260311-P4X7N2KD9QWE",
            "title": "Taper bowl spec sheet",
            "type": "document",
            "file_size": 482113,
            "publication": {
                "download_url": "https://acme.freedam.io/d/DO-20260311-P4X7N2KD9QWE/k3j9x2m1p0qa/3be802",
                "pdf_url": "https://acme.freedam.io/d/DO-20260311-P4X7N2KD9QWE/k3j9x2m1p0qa/3be802/pdf",
                "viewer_url": "https://acme.freedam.io/d/DO-20260311-P4X7N2KD9QWE/k3j9x2m1p0qa/3be802/view",
                "page_count": 2,
                "extension": "docx"
            }
        }
    ]
}
const sheets = await client.publications.allAssets('k3j9x2m1p0qa', {
    type: 'document',
    filters: JSON.stringify({ type: 'filter', field: 'metadata.product_line', operator: 'equals', value: 'Taper' }),
});

const list = sheets
    .map(({ title, publication }) => {
        const pdf = publication.pdf_url && publication.pdf_url !== publication.download_url
            ? ` (<a href="${publication.pdf_url}">PDF</a>)`
            : '';

        return `<li><a href="${publication.download_url}" download>${title}</a>${pdf}</li>`;
    })
    .join('');

5. Nightly catalogue sync

Store the URLs in your catalogue once, and refresh what changed every night: ask for the assets published since the last run, page by page. Because the URLs do not expire, your pages read them from your own database; they never call the API while a visitor waits.

curl -G https://acme.freedam.io/api/v1/publications/channels/k3j9x2m1p0qa/assets \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode 'published_since=2026-11-11T02:00:00Z' \
  --data-urlencode 'per_page=100' \
  --data-urlencode 'page=1'
{
    "data": [
        {
            "gaid": "IM-20260309-UDXZH8PP6VPW",
            "updated_at": "2026-11-11T16:04:12+00:00",
            "publication": { "status": "serving", "published_at": "2026-11-11T15:58:40+00:00", "url": "https://acme.freedam.io/i/w=2048/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e" }
        }
    ],
    "meta": { "current_page": 1, "last_page": 3, "per_page": 100, "total": 214 }
}
const startedAt = new Date().toISOString();
const since = await catalogue.lastSyncTime(); // your own storage

for await (const page of client.publications.assetPages('k3j9x2m1p0qa', { published_since: since, per_page: 100 })) {
    for (const asset of page) {
        await catalogue.saveMedia(asset.gaid, {
            type: asset.type,
            alt: asset.alt_text,
            url: asset.publication.url,
            urlTemplate: asset.publication.url_template,
            widths: asset.publication.widths,
        });
    }
}

await catalogue.saveLastSyncTime(startedAt);

A page of 100 assets is one request: a sync of 6,000 assets takes 60 requests, one minute of the 60 requests per minute a token may send. published_since finds new publications; to find assets that stopped being served, run a full sync with status=all from time to time and compare.

6. Resolving stored GAIDs in one call

When your content stores GAIDs (for example from the Freedam Picker), resolve up to 100 of them in one request. Unknown GAIDs, assets the channel does not publish and assets you may not view are left out.

curl -G https://acme.freedam.io/api/v1/publications/channels/k3j9x2m1p0qa/assets \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode 'gaids[]=IM-20260309-UDXZH8PP6VPW' \
  --data-urlencode 'gaids[]=VI-20260310-K2M8QW4RT7ZA' \
  --data-urlencode 'gaids[]=DO-20260311-P4X7N2KD9QWE' \
  --data-urlencode 'per_page=100'
{
    "data": [
        { "gaid": "IM-20260309-UDXZH8PP6VPW", "publication": { "url": "https://acme.freedam.io/i/w=2048/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e" } },
        { "gaid": "DO-20260311-P4X7N2KD9QWE", "publication": { "url": "https://acme.freedam.io/d/DO-20260311-P4X7N2KD9QWE/k3j9x2m1p0qa/3be802" } }
    ],
    "meta": { "total": 2 }
}
const stored = ['IM-20260309-UDXZH8PP6VPW', 'VI-20260310-K2M8QW4RT7ZA', 'DO-20260311-P4X7N2KD9QWE'];
const { data } = await client.publications.assets('k3j9x2m1p0qa', { gaids: stored, per_page: 100 });

const urlByGaid = new Map(data.map((asset) => [asset.gaid, asset.publication.url]));
const missing = stored.filter((gaid) => !urlByGaid.has(gaid)); // no longer served on this channel

To see on which channels one asset is published, call GET /api/v1/assets/{gaid}/publications:

curl https://acme.freedam.io/api/v1/assets/IM-20260309-UDXZH8PP6VPW/publications \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
{
    "data": [
        { "channel": "k3j9x2m1p0qa", "channel_name": "Corporate website", "status": "serving", "source": "rule", "url": "https://acme.freedam.io/i/w=2048/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e" }
    ]
}
const publications = await client.publications.forAsset('IM-20260309-UDXZH8PP6VPW');

7. When a published URL answers 404 or 410

A stored URL can stop answering. Your site does not need to call the API to find out why: the status code says it.

Answer Meaning What to do
410 Gone The asset's rights policy reached its end date. Hide the asset. The same URL serves it again if the policy is renewed.
404 Not Found The asset was unpublished from the channel, left the channel's conditions, was deleted or archived, its rights no longer allow the channel's use, the channel was turned off, or an administrator replaced the channel's links. Remove the URL from your content; the next sync gives the new URL if the asset is published again.

Responses, including 404 and 410, are cached for 5 minutes (Cache-Control: public, max-age=300) by browsers and CDNs, so a change can take up to 5 minutes to show, both ways. The HLS master playlist of a video is cached for 1 minute.

curl -I https://acme.freedam.io/i/w=1024/IM-20260309-UDXZH8PP6VPW/k3j9x2m1p0qa/5f1c2e
# HTTP/2 410
# cache-control: public, max-age=300, s-maxage=300
const response = await fetch(storedUrl, { method: 'HEAD' });

if (response.status === 410) {
    await catalogue.hideMedia(gaid); // rights expired; check again later
} else if (response.status === 404) {
    await catalogue.removeMedia(gaid); // no longer published at this URL
}

Try Freedam

Related Documentation

Explore more in this category