---
title: "Publish, schedule, or unpublish an item"
method: POST
path: "/cms/items/{itemId}/set-published"
tags: ["CMS items"]
---

# Publish, schedule, or unpublish an item

`POST /cms/items/{itemId}/set-published`

## Request

- Base URL: `https://api.cactal.ai/v1`
- URL: `https://api.cactal.ai/v1/cms/items/{itemId}/set-published`
- Auth: HTTP bearer

Use exactly one publication action: `published: true` publishes immediately and sets `publishedAt` to now; a future `publishAt` schedules a draft for automatic publication; `published: false` unpublishes an item or cancels its schedule. A published item must be unpublished before it can be scheduled because CMS items do not have revision snapshots. Published websites read only items with an actual `publishedAt`, so immediate and scheduled promotion become visible without a site republish. Repeating the same action is idempotent.

## Path parameters

- `itemId` string, required

## Request body

- object
  - `published` boolean: `true` publishes immediately; `false` unpublishes or cancels a schedule. Use `publishAt` instead to schedule publication.
  - `publishAt` unknown

## Response `200`

The item id plus its actual `publishedAt` and pending `publishAt` after the change.

- object
  - `id` string, required: Id of the item.
  - `publishedAt` string, date-time, nullable, required: Actual publish timestamp after the change. Set when published immediately or by the scheduler; `null` for drafts and scheduled items.
  - `publishAt` string, date-time, nullable, required: Future publication time after the change; `null` for drafts and published items.

## Other responses

- `400`: Validation failed. The response `message` names the first invalid field.
- `401`: Missing, invalid, expired, or revoked API key.
- `403`: The authenticated principal lacks the required capability.
- `404`: The resource does not exist or is outside the principal’s access scope.
- `429`: Rate limit exceeded. Retry after the number of seconds in the `Retry-After` header.

---

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