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


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 export task status

Available only for Confluence Administrator

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 directory

  • reindex - 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 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: