Skip to content

Publish a theme version

A theme version is a frozen list of graphic versions. An overlay loads the active theme version when its page loads. This guide publishes a theme version, inspects its contents, and activates that exact version. It needs a write key and a theme id.

  1. Read the theme.

    Terminal
    curl 'https://api.ligr.live/rest/v2/themes/203' \
    -H "Authorization: Bearer $LIGR_API_KEY"
    200 OK
    {
    "id": 203,
    "name": "Match Day",
    "activeVersion": 11,
    "versions": [9, 10, 11],
    "graphics": [
    { "graphicId": "8efdf988-1f4d-43ac-873b-06b9b4f3e379", "name": "Scorebug", "type": "code", "workingVersion": 4, "publishedVersions": [1, 2, 3] },
    { "graphicId": "c1e2a9d0-5b7e-4f60-9c3a-2d1f0e8b7a64", "name": "Lower third", "type": "rive", "workingVersion": 7, "publishedVersions": [5, 6] }
    ]
    }

    activeVersion is what an overlay loads on its next page load. Each graphic lists its publishedVersions. The workingVersion is the editable copy. A theme version can pin published versions only.

  2. Decide what the new version pins.

    The request pins every graphic you list at the version you give. Every graphic you do not list is pinned at its latest published version. A graphic with no published version is left out.

    Publish a graphic version first if the change you want is still in a working copy. For a code graphic, see Push and publish. For a Rive graphic, use Import through REST.

  3. Publish the theme version.

    Terminal
    curl -X POST 'https://api.ligr.live/rest/v2/themes/203/versions' \
    -H "Authorization: Bearer $LIGR_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "graphics": [
    { "graphicId": "c1e2a9d0-5b7e-4f60-9c3a-2d1f0e8b7a64", "version": 5 }
    ]
    }'
    201 Created
    { "version": 12, "activeVersion": 11 }

    This pins the lower third at version 5 and the scorebug at its latest, version 3. The active version is still 11. Nothing changed on air.

    With the CLI, run npx ligr-graphic theme publish --theme 203. It sends no graphics list, so every graphic takes its latest published version. Add --dry-run to print the selection first, and --activate to set the new version active.

  4. Inspect the published version.

    Terminal
    curl 'https://api.ligr.live/rest/v2/themes/203/versions/12' \
    -H "Authorization: Bearer $LIGR_API_KEY"

    The response lists the frozen graphic version selections. It includes the lower third at v5, regardless of later graphic publications. With the CLI, run npx ligr-graphic theme inspect --theme 203 --version 12.

  5. Activate that version.

    Select the existing version when the broadcast allows it. This request does not publish a new version or change its contents.

    Terminal
    curl -X PUT 'https://api.ligr.live/rest/v2/themes/203/active-version' \
    -H "Authorization: Bearer $LIGR_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{ "version": 12 }'
    200 OK
    { "activeVersion": 12 }

    With the CLI, run npx ligr-graphic theme activate --theme 203 --version 12. All competitions using this theme share its active version. Existing overlay pages keep their loaded version until reloaded. Reload the preview overlay and check the result before reloading a broadcast browser source.

Read the theme’s versions list, then inspect the old version with GET /v2/themes/203/versions/11. Activate that existing snapshot to restore its exact graphic selection, including the absence of graphics added later.

Terminal
npx ligr-graphic theme inspect --theme 203 --version 11
npx ligr-graphic theme activate --theme 203 --version 11

Reload the preview overlay to verify the rollback. Reload broadcast sources when the operator is ready. Presets for graphics absent from the selected snapshot are hidden. They return if you activate a snapshot containing those graphics.

StatusCause
400A version is not a published version of that graphic, or version is under 1
403A read key. Use a write key
404The theme belongs to another organization, or the requested theme version does not exist
409A graphic in the theme is locked. holder.userName names the editor. Wait, then retry

See Themes in the REST reference.