---
title: "Set the content state of a content and publishes a new version of the content."
method: PUT
path: "/wiki/rest/api/content/{id}/state"
tags: ["Content states"]
---

# Set the content state of a content and publishes a new version of the content.

`PUT /wiki/rest/api/content/{id}/state`

Sets the content state of the content specified and creates a new version
(publishes the content without changing the body) of the content with the new state.

You may pass in either an id of a state, or the name and color of a desired new state.
If all 3 are passed in, id will be used.
If the name and color passed in already exist under the current user's existing custom states, the existing state will be reused.
If custom states are disabled in the space of the content (which can be determined by getting the content state space settings of the content's space)
then this set will fail.

You may not remove a content state via this PUT request. You must use the DELETE method. A specified state is required in the body of this request.

**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
Permission to edit the content.

## Path parameters

- `id` string, required

## Query parameters

- `status` 'current' | 'draft', required

## Request body

- ContentStateRestInput
  - `name` string — Name of content state. Maximum 20 characters.
  - `color` string — Color of state. Must be in 6 digit hex form (#FFFFFF). The default colors offered in the UI are: #ff7452 (red), #2684ff (blue), #ffc400 (yellow), #57d9a3 (green), and #8777d9 (purple)
  - `id` integer — id of state. This can be 0,1, or 2 if you wish to specify a default space state.

## Response `200`

Returned if content state is set successfully.

- ContentStateResponse
  - `contentState` ContentState
    - `id` integer, required — identifier of content state. If 0, 1, or 2, this is a default space state
    - `name` string, required — name of content state.
    - `color` string, required — hex string representing color of state
  - `lastUpdated` string — Timestamp of last publish event where content state changed

## Other responses

- `400` — Invalid Name/Color, non-existent id of content state, or type of state desired is not allowed. Name must be less than or exactly 20 characters. Color must be a valid hex string. Status must be in [draft,current].
- `401` — Returned if the authentication credentials are incorrect or missing from the request.
- `403` — Returned if user does not have content edit permission.
- `404` — Returned if the content with given id can not be found.

---

[API](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api.md) · [All operations](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/the-confluence-cloud-rest-api/versions/70088490f406/schema)
