Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you create a page 'full-width' with api/v2/pages POST?

SiDawg
Contributor
May 1, 2023

I've seen posts about "'metadata': { 'properties': { 'content-appearance-draft': { 'value': 'full-width' }, 'content-appearance-published': { 'value': 'full-width' } }" but I think this only relates to deprecated Content API

I also see users can set the default to "full width" on creating new pages... and this ALMOST works: when i create manually it works, but when i create with API it is still initially "small", but when i edit it it automatically goes to full width... assumedly the "draft" behind it is being set to full width but not the published version? With 6000 pages to create this isn't really an option

 

3 answers

3 votes
Matteo Ferrari
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 28, 2023

Maybe it is too late, anyway I was able to apply full-width by POST on:

 

https://sitti.atlassian.net/wiki/api/v2/pages/[PAGE-ID}/properties

 

with body:

 

{
    "key": "content-appearance-published",
    "value": "full-width"
}
SiDawg
Contributor
April 23, 2024

Thanks Matteo ill give that a try next time

Stefan Draber
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2024

awesome, thanks a million @Matteo Ferrari - I was desperately searching for this solution for days!

Abhishek Kalamkar April 14, 2025

@Stefan Draber can you please help to get full page working via post. where to use the below clause

 

{
    "key": "content-appearance-published",
    "value": "full-width"
}
Stefan Draber
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 14, 2025

Hi @Abhishek Kalamkar 

disclaimer: all this full-width stuff didn't make it in my final script, so all of the following is the result of the last hour me trying to reproduce it 😉

The following examples have existing pages as prerequisites. I don't remember whether I was able to create a page in full-width.

POST only works if you didn't set the page width in your page yet (= the property doesn't exist yet, POST creates a new one)

My POST request would look like this:

curl --location 'https://******.atlassian.net/wiki/api/v2/pages/1225392688/properties/' \

--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "key": "content-appearance-published",
    "value": "full-width"
}'

 

If you already set a page width on the page in question, you first have to get the ID of this "content-appearance-published" property (https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-content-properties/#api-pages-page-id-properties-get) and then update the property via PUT.

My PUT request would look like this:

curl --location --request PUT 'https://******.atlassian.net/wiki/api/v2/pages/1225687374/properties/1225032267' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"key": "content-appearance-published",
"value": "fixed-width",
"version": {
"number": 2,
"message": "Test"
}
}'

 

Hope that helps.

Like Abhishek Kalamkar likes this
Abhishek Kalamkar April 14, 2025

@Stefan Draber thanks for your reply but still not creating the page with full width. here is my first post via REST API V2/pages

 

{
"spaceId": "1234",
"status": "current",
"title": "1234",
"parentId": "1234",

"key": "content-appearance-published",
"value": "full-width",

"body": {
"representation": "storage",
"value": "<p>new page</p>"


}

}

 

Stefan Draber
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 14, 2025

Hi @Abhishek Kalamkar 

as I said, my API request examples were aiming at changing existing pages to full-width, as this is what Matteo pointed at in his original post.

I think what I did back then was to first create the page with one API request and then update the the page properties to full-width in a seperate API request.

Here you'll find an example request, where you seemingly can put the page-width property into the creation request, but it uses the (deprecated) POST content endpoint, not the current POST page endpoint. I didn't try it.

Like Abhishek Kalamkar likes this
Abhishek Kalamkar April 16, 2025

it worked. 

simple use the following - in 2 different POST web request.

https://sitti.atlassian.net/wiki/api/v2/pages/[PAGE-ID}/properties

{
"key": "content-appearance-draft",
"value": "full-width"
}

 

{
"key": "content-appearance-published",
"value": "full-width"
}

1 vote
SiDawg
Contributor
May 17, 2023

Anyone?

0 votes
Wortho
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 25, 2023

+1 I'm looking for the same answer

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events