POST /wiki/rest/api/content/{id}/copy
Copies a single page and its associated properties, permissions, attachments, and custom contents.
The id
path parameter refers to the content ID of the page to copy. The target of the page to be copied
is defined using the destination
in the request body and can be one of the following types.
space
: page will be copied to the specified space as a root page on the spaceparent_page
: page will be copied as a child of the specified parent pageparent_content
: page will be copied as a child of the specified parent contentexisting_page
: page will be copied and replace the specified page
By default, the following objects are expanded: space
, history
, version
.
Permissions required: 'Add' permission for the space that the content will be copied in and permission to update the content if copying to an existing_page
.
Servers
- https://your-domain.atlassian.net
Path parameters
Name |
Type |
Required |
Description |
id |
String |
Yes |
|
Request headers
Name |
Type |
Required |
Description |
Content-Type |
String |
Yes |
The media type of the request body.
Default value: "application/json"
|
Query parameters
Name |
Type |
Required |
Description |
expand[] |
Array |
No |
A multi-value parameter indicating which properties of the content to expand.
Maximum sub-expansions allowed is 8 .
childTypes.all returns whether the content has attachments, comments, or child pages/whiteboards.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment returns whether the content has attachments.childTypes.comment returns whether the content has comments.childTypes.page returns whether the content has child pages.childTypes.whiteboard returns whether the content has child whiteboards.childTypes.database returns whether the content has child databases.childTypes.embed returns whether the content has child embeds (smartlinks).childTypes.folder returns whether the content has child folder.container returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser returns information about the current user in relation to the content,
including when they last viewed it, modified it, contributed to it, or added it as a favorite.metadata.properties returns content properties that have been set via the Confluence REST API.metadata.labels returns the labels that have been added to the content.metadata.frontend this property is only used by Atlassian.operations returns the operations for the content, which are used when setting permissions.children.page returns pages that are descendants at the level immediately below the content.children.whiteboard returns whiteboards that are descendants at the level immediately below the content.children.database returns databases that are descendants at the level immediately below the content.children.embed returns embeds (smartlinks) that are descendants at the level immediately below the content.children.folder returns folders that are descendants at the level immediately below the content.children.attachment returns all attachments for the content.children.comment returns all comments on the content.restrictions.read.restrictions.user returns the users that have permission to read the content.restrictions.read.restrictions.group returns the groups that have permission to read the content. Note that
this may return deleted groups, because deleting a group doesn't remove associated restrictions.restrictions.update.restrictions.user returns the users that have permission to update the content.restrictions.update.restrictions.group returns the groups that have permission to update the content. Note that
this may return deleted groups because deleting a group doesn't remove associated restrictions.history returns the history of the content, including the date it was created.history.lastUpdated returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion returns information about the update prior to the current content update.history.contributors returns all of the users who have contributed to the content.history.nextVersion returns information about the update after to the current content update.ancestors returns the parent content, if the content is a page or whiteboard.body returns the body of the content in different formats, including the editor format,
view format, and export format.body.storage returns the body of content in storage format.body.view returns the body of content in view format.version returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page returns pages that are descendants at any level below the content.descendants.whiteboard returns whiteboards that are descendants at any level below the content.descendants.database returns databases that are descendants at any level below the content.descendants.embed returns embeds (smartlinks) that are descendants at any level below the content.descendants.folder returns folders that are descendants at any level below the content.descendants.attachment returns all attachments for the content, same as children.attachment .descendants.comment returns all comments on the content, same as children.comment .space returns the space that the content is in. This is the same as the information returned by
Get space.
In addition, the following comment-specific expansions can be used:
extensions.inlineProperties returns inline comment-specific properties.extensions.resolution returns the resolution status of each comment.
|
Request body fields
Name |
Type |
Required |
Description |
pageTitle |
String |
No |
If defined, this will replace the title of the destination page.
|
copyLabels |
Boolean |
No |
If set to true , labels are copied to the destination page.
Default value: false
|
destination |
Object |
Yes |
Defines where the page will be copied to, and can be one of the following types.
parent_page : page will be copied as a child of the specified parent pageparent_content : page will be copied as a child of the specified parent contentspace : page will be copied to the specified space as a root page on the spaceexisting_page : page will be copied and replace the specified page
|
destination.type |
String |
Yes |
Possible values:
"parent_page"
"space"
"existing_page"
"parent_content"
|
destination.value |
String |
Yes |
The space key for space type, and content id for parent_page , parent_content , and existing_page
|
copyProperties |
Boolean |
No |
If set to true , content properties are copied to the destination page.
Default value: false
|
body |
Object |
No |
If defined, this will replace the body of the destination page.
|
body.storage |
Object |
No |
This object is used when creating or updating content.
|
body.storage.representation |
String |
Yes |
The content format type. Set the value of this property to
the name of the format being used, e.g. 'storage'.
Possible values:
"editor"
"wiki"
"atlas_doc_format"
"export_view"
"storage"
"plain"
"raw"
"view"
"styled_view"
"editor2"
"anonymous_export_view"
|
body.storage.value |
String |
Yes |
The body of the content in the relevant format.
|
body.editor2 |
Object |
No |
This object is used when creating or updating content.
|
body.editor2.representation |
String |
Yes |
The content format type. Set the value of this property to
the name of the format being used, e.g. 'storage'.
Possible values:
"editor"
"wiki"
"atlas_doc_format"
"export_view"
"storage"
"plain"
"raw"
"view"
"styled_view"
"editor2"
"anonymous_export_view"
|
body.editor2.value |
String |
Yes |
The body of the content in the relevant format.
|
copyAttachments |
Boolean |
No |
If set to true , attachments are copied to the destination page.
Default value: false
|
copyCustomContents |
Boolean |
No |
If set to true , custom contents are copied to the destination page.
Default value: false
|
copyPermissions |
Boolean |
No |
If set to true , page permissions are copied to the destination page.
Default value: false
|
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.