---
title: "SetPageState"
method: POST
path: "/kythene.v1.KytheneService/SetPageState"
tags: ["kythene.v1.KytheneService"]
---

# SetPageState

`POST /kythene.v1.KytheneService/SetPageState`

## Request

- Base URL: `https://kythene.com` (the document declares no server; this is the origin it was published from)
- URL: `https://kythene.com/kythene.v1.KytheneService/SetPageState`
- Auth: none required

SetPageState moves a page through its lifecycle by naming a target state -
 the aggregate of publish / request approval / approve / unpublish /
 archive / restore / discard.

## Headers

- `Connect-Protocol-Version` 1, required: Define the version of the Connect protocol
- `Connect-Timeout-Ms` number: Define the timeout, in ms

## Request body

- KytheneV1SetPageStateRequest
  - `wiki` string: wiki is the wiki the page is in - its id or slug.
  - `page` string: page is the page's id or its full path within the wiki.
  - `state` string: state is the target: "published" - publish the newest version. Where the wiki requires an approval this is refused: ask for one instead. "awaiting_approval" - ask for an approval. Optionally name a `reviewer`. "approved" - approve AND publish in one act. "changes_requested" - send it back to draft with a `note` saying why. "draft" - withdraw an approval request, or unpublish a live page (readers lose it). "discarded" - drop unpublished changes and go back to what is live. The discarded version stays in the history. "archived" - archive the page AND everything beneath it. It leaves the tree, search and every reader path; its paths keep redirecting. "restored" - bring an archived page and its subtree back.
  - `reviewer` string: reviewer optionally directs an approval request at one person (a user id).
  - `note` string: note is required when requesting changes.
  - `space` string: space optionally selects which of your spaces to act in (an id or name from list_spaces). Omit it when you belong to a single space.

## Response `200`

Success

- KytheneV1SetPageStateResponse
  - `state` string: state is the page's state afterwards.
  - `revision` integer: revision is the live revision after a publish; 0 otherwise.
  - `pages` integer: pages is how many pages the act covered - more than one for an archive or a restore, which cascade over the subtree.

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/kythene/apis/kythene-v1.md) · [All operations](https://skmtc.dev/kythene/apis/kythene-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/kythene/apis/kythene-v1/revisions/5a768e642d10?raw)
