REST API - Space
Other:
Available since v. 2.3.0
New REST APIs:
Get space
Get all spaces
Available since v. 2.11.0
New REST API:
Change space key
Available since v. 2.39.0
New REST API:
Change space status
Added space ‘status’ to Get space and Get all spaces
Available since v. 3.12.*
New REST API:
Available since v. 3.16.*
Below REST APIs are now available to space administrators:
Available since v. 4.9.*
Added last content modification date in space (
lastContentModificationDate
andlastContentModificationDateString
) to Get space and Get all spaces
Available since v. 4.16.*
Added date of last modification of permissions in space (
lastPermissionModificationDate
andlastPermissionModificationDateString
) to Get space and Get all spaces
Available since v. 4.21.*
Added new parameters (
lastPermissionModificationDateFrom
andlastPermissionModificationDateTo
) to Get all spaces
Get space
Available only for Confluence Administrators or Space Administrator
This API supports optional parameters
Method type: GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/getSpace/{SPACE_KEY}
Parameters:
dateFormat - define date format for parameters creationDateFrom, creationDateTo and for JSON output fields creationDateString, lastModificationDateString, lastPermissionModificationDateString - default format ‘yyyy-MM-dd'
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/space/getSpace/MYSPACE?dateFormat=MM/dd/yyyy
{CONFLUENCE_URL}/rest/extender/1.0/space/getSpace/DEMO?dateFormat=MM.dd.yyyy
Response format: JSON
Example response:
{
"creationDateString": "05-14-2020 14:53:21",
"lastModificationDate": 1589460802858,
"lastModificationDateString": "05-14-2020 14:53:22",
"lastContentModificationDate": 1631157477946,
"lastContentModificationDateString": "2021-09-09 05:17:57",
"lastPermissionModificationDate": 1631157477946,
"lastPermissionModificationDateString": "2021-09-09 05:17:57",
"creatorName": "admin",
"name": "Space A",
"creationDate": 1589460801648,
"key": "SPACEA",
"status": "current"
}
Get all spaces
Available only for Confluence Administrators
This API supports Pagination
This API supports optional parameters
Method type: GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces
Parameters:
creationDateFrom - filter spaces by created date (creation date >= this date)
creationDateTo - filter spaces by created date (creation date <= this date)
lastPermissionModificationDateFrom - filter spaces by last permission modification date (last permission modification date >= this date)
lastPermissionModificationDateTo - filter spaces by last permission modification date (last permission modification date <= this date)
dateFormat - define date format for parameters creationDateFrom, creationDateTo and for JSON output fields creationDateString, lastModificationDateString, lastPermissionModificationDateString - default format ‘yyyy-MM-dd'
spacesAsArray - change ‘spaces’ parameter in response from HashMap to Array (Available since v. 4.8.0)
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?spacesAsArray=true
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?creationDateTo=2020-05-14
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?lastPermissionModificationDateTo=2020-05-14
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?creationDateFrom=12/01/2019&dateFormat=MM/dd/yyyy
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?creationDateTo=03.01.2020&creationDateFrom=01.01.2020&dateFormat=MM.dd.yyyy
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?lastPermissionModificationDateTo=03.01.2020&creationDateFrom=01.01.2020&dateFormat=MM.dd.yyyy
Response format: JSON
Example response:
Without spacesAsArray
{
"total": 2,
"maxResults": 100,
"spaces": {
"SPACEA": {
"creationDateString": "05-14-2020 14:53:21",
"lastModificationDate": 1589460802858,
"lastModificationDateString": "05-14-2020 14:53:22",
"lastContentModificationDate": 1631157477946,
"lastContentModificationDateString": "2021-09-09 05:17:57",
"lastPermissionModificationDate": 1631157477946,
"lastPermissionModificationDateString": "2021-09-09 05:17:57",
"creatorName": "admin",
"name": "Space A",
"creationDate": 1589460801648,
"key": "SPACEA",
"status": "current"
},
"ds": {
"creationDateString": "09-25-2018 11:05:32",
"lastModificationDate": 1573637171250,
"lastModificationDateString": "11-13-2019 10:26:11",
"lastContentModificationDate": 1631157477946,
"lastContentModificationDateString": "2021-09-09 05:17:57",
"lastPermissionModificationDate": 1631157477946,
"lastPermissionModificationDateString": "2021-09-09 05:17:57",
"creatorName": "not exist",
"name": "Demonstration Space",
"creationDate": 1537866332331,
"key": "ds",
"status": "archived"
}
},
"startAt": 0
}
With spacesAsArray = true
{
"total": 2,
"maxResults": 100,
"spaces": [
{
"creationDateString": "05-14-2020 14:53:21",
"lastModificationDate": 1589460802858,
"lastModificationDateString": "05-14-2020 14:53:22",
"lastContentModificationDate": 1631157477946,
"lastContentModificationDateString": "2021-09-09 05:17:57",
"lastPermissionModificationDate": 1631157477946,
"lastPermissionModificationDateString": "2021-09-09 05:17:57",
"creatorName": "admin",
"name": "Space A",
"creationDate": 1589460801648,
"key": "SPACEA",
"status": "current"
},
{
"creationDateString": "09-25-2018 11:05:32",
"lastModificationDate": 1573637171250,
"lastModificationDateString": "11-13-2019 10:26:11",
"lastContentModificationDate": 1631157477946,
"lastContentModificationDateString": "2021-09-09 05:17:57",
"lastPermissionModificationDate": 1631157477946,
"lastPermissionModificationDateString": "2021-09-09 05:17:57",
"creatorName": "not exist",
"name": "Demonstration Space",
"creationDate": 1537866332331,
"key": "ds",
"status": "archived"
}
],
"startAt": 0
}
Change space status
Method type: PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/changeSpaceStatus
Request format: JSON
Example request:
spaceKey
- required - new key for modified space
status
- required - (archived or current) - space status
Change space key
Method type: PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/changeSpaceKey
Request format: JSON
Example request:
currentSpaceKey
- required - key of the space you want to modify
newSpaceKey
- required - new key for modified space
reindexSpace
- optional - (true or false - default value: false) - reindex flag
Response format: JSON
Pagination
This REST API uses pagination to improve performance for all users. Pagination is enforced for methods that could return a large collection of items. When you make a request to a paged API, the response will wrap the returned array of values in a JSON object with paging metadata, for example:
Where:
startAt
is the index of the first item returned in the page of results.maxResults
is the maximum number of items that can be returned per page. Each API endpoint may have a different limit for the number of items returned, and these limits may change without notice. (default value - 100)total
is the total number of items contained in all pages. This number may change as the client requests the subsequent pages, therefore the client should always assume that the requested page can be empty.