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:


Get space

note

Available only for Confluence Administrators or Space Administrator

This API supports optional parameters

Available only for Confluence Administrators or Space Administrator

This API supports optional parameters

Method type: 

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 - 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",
    "creatorName": "admin",
    "name": "Space A",
    "creationDate": 1589460801648,
    "key": "SPACEA",
    "status": "current"
}


Get all spaces

note

Available only for Confluence Administrators

This API supports Pagination

This API supports optional parameters

Available only for Confluence Administrators

This API supports Pagination

This API supports optional parameters

Method type: 

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)

  • dateFormat - define date format for parameters creationDateFrom, creationDateTo and for JSON output fields creationDateString, lastModificationDateString - default format ‘yyyy-MM-dd'

Example URL:

  • {CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?creationDateTo=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

Response format: JSON

Example response:

{
    "total": 2,
    "maxResults": 100,
    "spaces": {
        "SPACEA": {
            "creationDateString": "05-14-2020 14:53:21",
            "lastModificationDate": 1589460802858,
            "lastModificationDateString": "05-14-2020 14:53:22",
            "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",
            "creatorName": "not exist",
            "name": "Demonstration Space",
            "creationDate": 1537866332331,
            "key": "ds",
            "status": "archived"
        }
    },
    "startAt": 0
}


Change space status

note

Available only for Confluence Administrators or Space Administrator

Available only for Confluence Administrators or Space Administrator

Method type: 

URL: {CONFLUENCE_URL}/rest/extender/1.0/space/changeSpaceStatus

Request format: JSON

Example request:

{
    "spaceKey": "SPACEKEY",
    "status": "archived"
}
{
    "spaceKey": "SPACEKEY",
    "status": "current"
}

spaceKey - required - new key for modified space

status - required - (archived or current) - space status


Change space key

Experimental API

note

Available only for Confluence Administrators

Available only for Confluence Administrators

Method type: 

URL: {CONFLUENCE_URL}/rest/extender/1.0/space/changeSpaceKey

Request format: JSON

Example request:

{
    "currentSpaceKey": "KEYA",
    "newSpaceKey": "NEWKEY",
    "reindexSpace": true
}
{
    "currentSpaceKey": "KEYA",
    "newSpaceKey": "NEWKEY"
}

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

Space reindex is synchronous, if you set it to true, the response time will depend on the amount of contents in the space.

If you do not set the reindex flag, the search results in the application will return pages with the old space key, in this situation you have to reindex content manually Content Index Administration

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:

{
    "startAt" : 0,
    "maxResults" : 10,
    "total": 200,
    "objects": [
        { /* result 0 */ },
        { /* result 1 */ },
        { /* result 2 */ }
    ]
}

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.