Forums

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

Why are certain spaces excluded from my REST API call?

Bruce Becker July 21, 2025

I have a strange behaviour which I would like to understand and work around.

We are using Confluence Data Centre edition and have very many (O(100)) spaces in it.

 

I am using the REST API to manage content in some of the spaces. Authorization is done via Personal Access Token, using the "Authorization: Bearer ..." header.

 

This works for _some_ of our spaces, but not all, and in particular not for recently created spaces. Some give valid 200 responses, and some just give 404's like this:

 

{"statusCode":404,"data": 
{
"authorized":false,
"valid":true,
"allowedInReadOnlyMode":true,
"errors":[],
"successful":false
},
"message":"No space found with key : <space_name>","reason":"Not Found"
}

I suspect a pagination issue... but that doesn't sound right, according to the REST API documentation.

Can someone help me understand why some of my spaces are being found by key, and some not?

 

Thanks,

1 answer

1 vote
Marc - Devoteam
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 21, 2025

Hi @Bruce Becker 

Probably, you don't have permissions or the right permission to those spaces.

Bruce Becker July 21, 2025

I thought that too, but I do indeed have permission. The Personal Access Token might not have permission, but according to the docs, it's emitted with the same permissions as the user. So if I can see the space browsing as a user, then I should be able to see the space calling the REST API as well.

 

Is there a flaw in that logic?

Marc - Devoteam
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 22, 2025

Hi @Bruce Becker 

Check the logs on the server when executing the API call, see if something in the logs provides a clue on the 404 errors

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events