Fetch list of all spaces in Confluence

Rakshatha Shetty August 10, 2020

I'm using the API  https://confluence.com/rest/api/space?limit=2000 to fetch the list of all spaces in Confluence. But this API returns only 500 spaces. I'm aware since Confluence 5.5 there is a limit on number of results returned (i.e. 500). Is there a way to get all the spaces?

1 answer

1 accepted

1 vote
Answer accepted
Tamas Baglyas August 10, 2020

Hi @Rakshatha Shetty,

The Atlassian set a hard limit, to protect the Confluence server for "accidentally" overload. If you want to get all the spaces you need to use the start properties, as much as you got size: 500
E.g.: https://confluence.com/rest/api/space?start=500&limit=500 and https://confluence.com/rest/api/space?start=1000&limit=500 and so on.
Or you can use type property to filter the global and personal spaces.
E.g.: https://confluence.com/rest/api/space?type=global&start=1&limit=500 or https://confluence.com/rest/api/space?type=personal&start=1&limit=500 and so.

Cheers,
Tamás

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events