---
title: "Preview Publish"
method: GET
path: "/v1/projects/{project_id}/cdn/preview"
tags: ["cdn"]
---

# Preview Publish

`GET /v1/projects/{project_id}/cdn/preview`

## Request

- Base URL: `https://api.sonenta.dev`
- URL: `https://api.sonenta.dev/v1/projects/{project_id}/cdn/preview`
- Auth: none declared

Pre-count what 'Publish now' WOULD ship, WITHOUT publishing (Viewer+).

Read-only: no release is created, nothing is uploaded to Bunny, no purge, no
Centrifugo, no audit. For each (language, namespace) — both filters optional,
omit to preview all — it builds the bundle with the same publishable-status
filter as publish and diffs it against the last published bundle, returning
the count of **new + changed strings** per (lang, ns) plus a total.

`to_publish == 0` means there is nothing to publish (button should say so).
`warnings` flags a (lang, ns) whose keys are all below `translated` — it would
ship an empty bundle. Targets the production version.

## Path parameters

- `project_id` string, required

## Query parameters

- `language_code` string, nullable
- `namespace` string, nullable: namespace slug

## Response `200`

Successful Response

- CdnPreviewOut
  - `items` CdnPreviewItem[], required
    - `language_code` string, required
    - `namespace` string, required
    - `new_strings` integer, required: Entries not in the last published bundle.
    - `changed_strings` integer, required: Entries whose value differs from the last bundle.
    - `to_publish` integer, required: new_strings + changed_strings for this (lang, ns).
    - `key_count` integer, required: Total keys in the namespace.
    - `included_count` integer, required: Publishable keys (status ≥ translated).
  - `new_strings` integer, required
  - `changed_strings` integer, required
  - `to_publish` integer, required: Total strings 'Publish now' would ship. 0 = nothing to publish.
  - `warnings` CdnEmptyBundleWarning[]
    - `language_code` string, required
    - `namespace` string, required
    - `key_count` integer, required
    - `included_count` integer, required
    - `excluded_count` integer, required
    - `skipped` boolean, required
    - `reason` string, required
  - `formula` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sonenta/apis/sonenta-api.md) · [All operations](https://skmtc.dev/sonenta/apis/sonenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sonenta/apis/sonenta-api/revisions/f853ea49fb05?raw)
