Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Programatically rename space home page title


Hi there,

I would like to programatically rename space home page title (not sure if I call that stuff correctly, screen attached)


I tried the following REST API:

PUT /rest/space/{spaceKey}


When I send the following json as a request body then everything works fine, name and description are updated


    "name""Space name",

     "description": {

        "plain": {

            "value""New description",





However, when I send a json like this


    "name""Space name",

     "description": {

        "plain": {

            "value""New description",




     "homepage": {

        "title""New Home Page"



I get the following response:



    "data": {




        "errors": [


                "message": {

                    "translation""Cannot update space homepage to page in space with key: TEST",

                    "args": []






    "message""Cannot update Space",

    "reason""Bad Request"


I understand that it is a bad request, but I can't figure out what exactly should be sent as a body to have space home page title updated?




1 answer

1 accepted

0 votes
Answer accepted

I think what you're trying to do is change the Homepage selection on the space's Overview -> Edit space details screen, but through the REST API instead of the screen.  If that is correct, then here's what you do.

First, run the Get for the space to see what its details are, something like:


You'll see in the documentation that homepage is of type array, so it's not just the title.

Unfortunately, Confluence's documentation is not nearly as good as Jira's, and this particular piece lacks detail, such as what other fields are required to update the homepage field of a space, and there are a lot.  Here's what I got when I ran the Get (I put in a lot of fake values, but the fields are real):

,"title":"Test Space Home"
,"_links": {


And fortunately, I tested it, and it only needs the page Id to work.  I didn't test with the title, but feel free to.  So here's the Json you need to send (or something like it):

    "name": "Test Space Temp",
    "description": {
        "plain": {
            "value": "New description",
            "representation": "plain"
    "homepage": {
        "id": "11112222"

Just put your homepage's id instead of 11112222.

You just needed a couple of little curly brackets, for the most part.


Thanks for your reply.

I checked that when I send 

     "homepage": {
the server simply ignores title as it needs id only to identify the page to be set as the homepage.
I actually need to change only homepage title just like if to click Edit button
Edit - HomePage.jpg
I assume there might be another REST endpoint  that I didn't manage to find yet.

Ah, so that's what I originally thought your question was asking, but then I thought maybe you were asking how to change the homepage like from the Edit space details screen, since that's kind of tricky.

So, the problem you're having is that you're using the wrong REST API call.  You're trying to update the space details rather than the page information.  The homepage is just like any other page when it comes to editing its content, and any page can be the homepage.

You'd just need to use:

PUT /rest/api/content/{contentId}

instead of:

PUT /rest/space/{spaceKey}
Like yevhen_rudenko likes this


When manually click Edit button and then Update the very end of the url changes accordingly to new title (circles #1 and #2 on the screen) 


Then if refresh F5 then I get another update (circle #3) 


I tried then

PUT /rest/api/content/{contentId}

The json body looks like this

    "version": {

 As a result I have the following


Now the url (circle #1) and whatever that section is (circle #3, which I don't really care about, but still...) have been changed, but the title (circle #2) has never changed.

I also checked if this title is a part of page body and it looks like it is not


Probably missing a property or so, don't really know what I'm doing wrong.

Another thing is that this endpoint requires version, which must be equal to current version + 1, which leads to additional GET request but that is a different story

Yes, you do have to put the next version in there, which I think is stupid, bc why would you put or want anything but current version +1, and I think it has to be +1, but yes, that's another story. :)

I ran the below, and it worked for me.  However, when I refreshed the page I renamed, it said it was in the trash.  So, I clicked on the page from the left navigation panel, and it was renamed, and the version had been updated. I ran it again, refreshed, and it gave me this page doesn't exist, maybe you want this other page.  It definitely works.



"number":2,"minorEdit": true,"message": "Updated title"
,"title":"Test Stuff"

("minorEdit": true is like unchecking the Notify watchers box in the UI)

So, I'm not sure why it's not working for you, but it should work.  Maybe try another browser or clear your cache?  Your pages might not be reindexing properly.  Maybe run a rebuild the index (after hours, and if you're a Confluence admin). 

It looks like the title is just not refreshing for you for some reason, but that the URL is changing and the page really is being renamed, it's just not displaying it.  I wonder if you run it, the wait a while, if it'll display correctly later on.

Well, I think I've answered the how to change the Homepage title question.  Now you may have a different question - why isn't the title change displaying.

I've tried clearing cache, a different browser, Confluence Admin > Content Indexing and click "Rebuild". Well, none of them worked.

Then I sent a GET request and yes it returned updated page title. So the value is there but at the same time kind of not.

When I refresh the page the name of the tab in Chrome changes for a while (while loading the page) to updated title but then gets back to old title


I then assumed something was wrong with the space.

And I tried on a different 'blank' space and everything  worked for it.

The thing is that the space I need to change title of the home page for is created by REST api of Scroll Versions for Confluence plugin. The plugin creates a new space based on another template space and that's  why I need to change the home page title as it seems there is no way to configure this while using the plugin. 

But again this seems to be a different question.

@WW thank you for your support

Like WW likes this

That might have something to do with your problem.  Plugins are notorious for interfering with built-in processes.

I would press F12 on your keyboard / open your browser's Developer Console to see what's going on.   Especially look for something being sent when you see that name in the tab.

Good luck!

Like WW likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

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 . 🙋‍♀️ ...

1,098 views 21 29
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you