REST API - Space Export/Import
Available since v. 2.15.0
Added space export/import REST APIs
Available since v. 2.18.0
Export space is available to all users with space export permission
Available since v. 2.36.0
Export space - added new flags multiple and synchronous
Import space - added new flag synchronous
General information
Due to restrictions imposed by Atlassian, the export/import REST APIs only work in Confluence from version 6.10.* to 8.9.*
For Confluence from version 9.0.*, we suggest using the built-in REST API to export/import space.
Â
Export space
Available only for Confluence Administrator
Available to all users with space EXPORT permission
Method type:Â poST
URL: {CONFLUENCE_URL}/rest/extender/1.0/export/space/{SPACE_KEY}
where {SPACE_KEY} is the space key
Request format: JSON
Example request:
{
"exportType": "XML",
"exportComments": true,
"exportAttachments": true
}
{
"exportType": "HTML"
}
{
"exportType": "XML",
"exportComments": true,
"exportAttachments": true,
"multiple": true
}
exportType - required - export type - XML or HTML
exportComments - optional - export comments flag - true or false (default)
exportAttachments - optional - export comments flag - true or false (default)
multiple - optional - skip checking another export task, which allows you to start exporting another space at the same time - true or false (default)
synchronous - optional - the export will be performed synchronously - true or false (default)
Response format: JSON
Example response:
Â
Check the export task status
Method type:Â GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/export/task/{TASK_ID}
where {TASK_ID} is the task id from export api (example:
4f3a1aec-5493-4049-8e54-54563c19a971
)
Response format: JSON
Example response:
Â
Import space
Method type:Â poST
URL: {CONFLUENCE_URL}/rest/extender/1.0/import/file
Request format: JSON
Example request:
fileName - required - space export file name fromÂ
<confluence-home>/restore
directoryreindex - optional - reindex flag - true or false (default) - this will perform a full reindex of your site immediately after the space or site file is imported
synchronous - optional - the import will be performed synchronously - true or false (default)
Response format: JSON
Example response:
Â
Check the import task status
Method type:Â GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/import/task/{TASK_ID}
where {TASK_ID} is the task id from import api (example:
e142839b-babf-4326-8d34-c7e2ba275c3f
)
Response format: JSON
Example response:
Â