Hi,
In my space, I have defined 3 statuses. Is there an REST API I can use to set any of these 3 statuses to a specified page?
The create and update page APIs only allows current or
draft statuses to be passed.
Thanks
Hi @Alin Oana
I was able to find the below information
To set a Confluence page's "content state" (which is what Confluence refers to as "page status" in the UI) using the REST API, you can utilize the PUT
method on the /rest/api/content/{id}/state
endpoint.
Code
PUT /wiki/rest/api/content/{id}/state
{id}
: The ID of the Confluence page you want to update.contentState
object. This object includes properties like name
(the status name, e.g., "Draft", "Archived"), color
, and isSpaceState
.Example (using Curl)
curl -u <username>:<password_or_api_token> -X PUT \
-H "Content-Type: application/json" \
-d '{
"name": "Archived",
"color": "green",
"isSpaceState": false
}' \
<your_confluence_base_url>/wiki/rest/api/content/<page_id>/state
-u <username>:<password_or_api_token>
: Authenticates your request. For Confluence Cloud, an API token is recommended.-X PUT
: Specifies the HTTP method.-H "Content-Type: application/json"
: Indicates that the request body is in JSON format.-d '{...}'
: Contains the JSON payload defining the new content state.
"name"
: The desired status name (e.g., "Current", "Deleted", "Historical", "Draft", "Archived")."color"
: (Optional) The color associated with the status."isSpaceState"
: (Optional) A boolean indicating if this is a space-level state.<your_confluence_base_url>/wiki/rest/api/content/<page_id>/state
: The full URL to the content state endpoint for the specific page. Replace <your_confluence_base_url>
and <page_id>
with your actual values.
I hope this helps!
Thanks,
Anwesha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.