Publishing with the CMS API

Learn how to publish content with the CMS API

The CMS API uses a staging system that separates draft from published content. This workflow gives you control over what goes live and when, ensuring content quality before publication.

All CMS content exists in one of two states:

Staged

Draft content that can be previewed but isn’t visible on the live site. Use this state to prepare and review changes.

Live

Content that’s published and visible on your site. A live item can have a staged version for updates that don’t affect the original.

Each CMS Item has isDraft and lastPublished properties that indicate its current state. The combination of these properties determines an item’s status, which is reflected in the Webflow UI.

StatusDescriptionlastPublishedisDraft
Published
Content is live and visible on your website.existsfalse
Draft changes
Live content with unpublished draft changes.existstrue
Draft
Content is in a draft state and has never been published.nulltrue
Queued to publish
Content will be published on the next site-wide publish.nullfalse
Scheduled
Content is scheduled for future publication. This can not be controlled by the CMS API.N/AN/A
Archived
Content has been archived and removed from the live site. Use the isArchived flag to archive items.N/AN/A

This mapping helps you understand how API operations affect the content status displayed in the Webflow interface.

Publishing workflows

The CMS API provides flexible publishing options to fit your workflow. Use the accordions below to learn more about each publishing method and see which endpoints to use.

Publish, unpublish, or stage a single item without affecting other content. This gives you granular control for targeted updates, such as publishing a single blog post or making a small correction to an existing page.

Associated endpoints:

POST/collections/:collection_id/items/publish
$curl https://api.webflow.com/collections/:collection_id/items/publish \
> -H "Authorization: Bearer <token>"
DELETE/collections/:collection_id/items/live
$curl https://api.webflow.com/collections/:collection_id/items/live \
> -H "Authorization: Bearer <token>"
publishSingleItem.ts
1import { WebflowClient } from "webflow-api";
2
3const webflow = new WebflowClient({
4 accessToken: "YOUR_ACCESS_TOKEN",
5});
6
7const item = await webflow.collections.items.publishItem("COLLECTION_ID", {
8 itemIds: ["ITEM_ID"],
9});
10
11console.log(item);

Publish all staged content across your entire site in a single operation. This is ideal for coordinated releases, such as a new marketing campaign, a product launch, or a site redesign where multiple content changes need to go live simultaneously.

POST/sites/:site_id/publish
$curl https://api.webflow.com/sites/:site_id/publish \
> -H "Authorization: Bearer <token>"
publishSite.ts
1import { WebflowClient } from "webflow-api";
2
3const webflow = new WebflowClient({
4 accessToken: "YOUR_ACCESS_TOKEN",
5});
6
7const site = await webflow.sites.publish("SITE_ID", {
8 customDomains: ["CUSTOM_DOMAIN_ID_1", "CUSTOM_DOMAIN_ID_2"],
9 publishToWebflowSubdomain: true,
10});
11
12console.log(site);

When a live item’s isDraft property is set to true, it remains published on your site. This allows you to safely update the item in a draft state without changing what’s visible to your site visitors. The changes will only go live when the item’s isDraft property is set to false and the item is published again.

PATCH/collections/:collection_id/items
$curl https://api.webflow.com/collections/:collection_id/items \
> -H "Authorization: Bearer <token>"
updateLiveItem.ts
1import { WebflowClient } from "webflow-api";
2
3const webflow = new WebflowClient({
4 accessToken: "YOUR_ACCESS_TOKEN",
5});
6
7const item = await webflow.collections.items.updateItem("COLLECTION_ID", "ITEM_ID", {
8 isDraft: true, // Set to true to update the live item in a draft state
9 fieldData: {
10 name: "Heart of Gold",
11 slug: "heart-of-gold",
12 description: "The Heart of Gold is a ship that is used to travel through space using the infinite improbability drive.",
13 pilots: ["Trisha McMillan", "Zaphod Beeblebrox"],
14 },
15});
16
17console.log(item);

To update an item and publish the changes to your live site in a single action, use the updateItemLive endpoint. This is useful for making quick corrections or immediate updates without a review stage.

PATCH/collections/:collection_id/items/live
$curl https://api.webflow.com/collections/:collection_id/items/live \
> -H "Authorization: Bearer <token>"
updateLiveItemDirectly.ts
1import { WebflowClient } from "webflow-api";
2
3const webflow = new WebflowClient({
4 accessToken: "YOUR_ACCESS_TOKEN",
5});
6
7const item = await webflow.collections.items.updateItemLive(
8 "COLLECTION_ID",
9 "ITEM_ID",
10 {
11 fieldData: {
12 name: "Heart of Gold",
13 slug: "heart-of-gold",
14 description: "The Heart of Gold is a ship that is used to travel through space using the infinite improbability drive.",
15 pilots: ["Trisha McMillan", "Zaphod Beeblebrox"],
16 }
17 }
18);
19
20console.log(item);

To remove an item from the live site, you must explicitly call the unpublishItem endpoint. This action doesn’t delete the item from the CMS; it unpublishes it and sets its isDraft property to true, allowing you to continue editing it.

DELETE/collections/:collection_id/items/live
$curl https://api.webflow.com/collections/:collection_id/items/live \
> -H "Authorization: Bearer <token>"
unpublishItem.ts
1import { WebflowClient } from "webflow-api";
2
3const webflow = new WebflowClient({
4 accessToken: "YOUR_ACCESS_TOKEN",
5});
6
7// Note: This does not delete the item, it just unpublishes it.
8const item = await webflow.collections.items.deleteItemLive(
9 "COLLECTION_ID",
10 "ITEM_ID"
11);
12
13console.log(item);

Archiving unpublishes items from your live site at the next full-site publish, but keeps the items accessible in the CMS. To archive an item, set the isArchived property on the item to true.

PATCH/collections/:collection_id/items
$curl https://api.webflow.com/collections/:collection_id/items \
> -H "Authorization: Bearer <token>"
PATCH/collections/:collection_id/items/live
$curl https://api.webflow.com/collections/:collection_id/items/live \
> -H "Authorization: Bearer <token>"
archiveItem.ts
1import { WebflowClient } from "webflow-api";
2
3const webflow = new WebflowClient({
4 accessToken: "YOUR_ACCESS_TOKEN",
5});
6
7const item = await webflow.collections.items.updateItem("COLLECTION_ID", "ITEM_ID", {
8 isArchived: true, // Set to true to archive the item
9 fieldData: {
10 name: "Heart of Gold",
11 slug: "heart-of-gold",
12 description: "The Heart of Gold is a ship that is used to travel through space using the infinite improbability drive.",
13 pilots: ["Trisha McMillan", "Zaphod Beeblebrox"],
14 },
15});
16
17console.log(item);

Next steps

Now that you understand the publishing workflows, here are a few topics you might want to explore next: