The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I want to create a space in Confluence programmatically and add a banner to the space at the same time. I do not see that option in the REST API. Am I missing it? We are using Data Center. Thanks
Hi @Bill Brinkley
I hope you are well.
I don't think there's an API method to customize the Space layout, such as a header.
However, you might be able to get a similar result by running the same request from the UI through an automation.
Here's an example of creating a Space and then setting the header to a Panel Macro.
CONFLUENCE_BASE_URL=http://localhost:27180/c7180
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
NEW_SPACE_KEY=TESTSPACE
NEW_SPACE_NAME="Test Space"
NEW_SPACE_HEADER_PANEL='{panel:borderStyle=dashed|borderColor=blue|titleBGColor=#00a400|titleColor=white|bgColor=#72bc72}This is a Test Space{panel}'
# Create the Space
curl -v -o /dev/null -X POST -u ${ADMIN_USERNAME}:${ADMIN_PASSWORD} \
${CONFLUENCE_BASE_URL}'/rest/api/space' \
-H 'Content-Type: application/json' \
-d '{"key": "'${NEW_SPACE_KEY}'", "name": "'${NEW_SPACE_NAME}'"}'
# Adjust the Header
curl -v -o /dev/null -X POST -u ${ADMIN_USERNAME}:${ADMIN_PASSWORD} \
${CONFLUENCE_BASE_URL}'/spaces/docustompagecontent.action' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'X-Atlassian-Token: no-check' \
-d 'sidebarText=' \
--data-urlencode headerText="${NEW_SPACE_HEADER_PANEL}" \
-d 'footerText=' \
-d 'key='${NEW_SPACE_KEY} \
-d 'confirm=Save'
This will result on the following Space.
Kind regards,
Thiago Masutti
Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋♀️ ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.